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
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
|
"use strict";
(self["webpackChunkbrowser_extension"] = self["webpackChunkbrowser_extension"] || []).push([["272"], {
7596(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
H: () => (AbpSnippetInjectionBodyCommon)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Common class for the ABP snippet injection body.
* This class contains shared constants and utilities for handling ABP snippet injection bodies.
*/
class AbpSnippetInjectionBodyCommon {
/**
* Error messages used by the parser and generator.
*/
static ERROR_MESSAGES = {
/**
* Error message indicating that an ABP snippet call is empty.
*/
EMPTY_SCRIPTLET_CALL: 'Empty ABP snippet call',
};
}
},
76466(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
l: () => (isUboResponseHeaderRemovalRuleBody)
});
/* import */ var _utils_constants_js__rspack_import_0 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Checks whether the given HTML filtering rule body represents a uBlock-style response header removal rule.
*
* @param node Potential response header removal rule node.
*
* @returns `true` if the node is a response header removal rule, `false` otherwise.
*
* @note This method checks `HtmlFilteringRuleBody` because, response header
* removal rule syntax is same as uBlock-style HTML filtering rule syntax.
*/
function isUboResponseHeaderRemovalRuleBody(node) {
const { selectorList } = node;
// Must have exactly one complex selector
if (selectorList.children.length !== 1) {
return false;
}
const complexSelector = selectorList.children[0];
// Must have exactly one simple selector
if (complexSelector.children.length !== 1) {
return false;
}
const simpleSelector = complexSelector.children[0];
return (
// Should be a pseudo-class selector
simpleSelector.type === 'PseudoClassSelector'
// Pseudo-class selector name should match `UBO_RESPONSEHEADER_FN`
&& simpleSelector.name.value === _utils_constants_js__rspack_import_0/* .UBO_RESPONSEHEADER_FN */.Bt
// Should have argument
&& simpleSelector.argument !== undefined);
}
},
15862(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
S: () => (UboPseudoName)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Known uBO-specific pseudo-class names.
*/
const UboPseudoName = {
MatchesMedia: 'matches-media',
MatchesPath: 'matches-path',
Remove: 'remove',
Style: 'style',
};
},
21565(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
E: () => (/* binding */ CompatibilityTableBase)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/platforms.js
var platforms = __webpack_require__(9257);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/utils/platform-helpers.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-bitwise */
/**
* @file Provides platform mapping and helper functions.
*/
/**
* Map of specific platforms string names to their corresponding enum values.
*/
const SPECIFIC_PLATFORM_MAP = new Map([
['adg_os_windows', platforms/* .SpecificPlatform.AdgOsWindows */.c.AdgOsWindows],
['adg_os_mac', platforms/* .SpecificPlatform.AdgOsMac */.c.AdgOsMac],
['adg_os_android', platforms/* .SpecificPlatform.AdgOsAndroid */.c.AdgOsAndroid],
['adg_ext_chrome', platforms/* .SpecificPlatform.AdgExtChrome */.c.AdgExtChrome],
['adg_ext_opera', platforms/* .SpecificPlatform.AdgExtOpera */.c.AdgExtOpera],
['adg_ext_edge', platforms/* .SpecificPlatform.AdgExtEdge */.c.AdgExtEdge],
['adg_ext_firefox', platforms/* .SpecificPlatform.AdgExtFirefox */.c.AdgExtFirefox],
['adg_cb_android', platforms/* .SpecificPlatform.AdgCbAndroid */.c.AdgCbAndroid],
['adg_cb_ios', platforms/* .SpecificPlatform.AdgCbIos */.c.AdgCbIos],
['adg_cb_safari', platforms/* .SpecificPlatform.AdgCbSafari */.c.AdgCbSafari],
['ubo_ext_chrome', platforms/* .SpecificPlatform.UboExtChrome */.c.UboExtChrome],
['ubo_ext_opera', platforms/* .SpecificPlatform.UboExtOpera */.c.UboExtOpera],
['ubo_ext_edge', platforms/* .SpecificPlatform.UboExtEdge */.c.UboExtEdge],
['ubo_ext_firefox', platforms/* .SpecificPlatform.UboExtFirefox */.c.UboExtFirefox],
['abp_ext_chrome', platforms/* .SpecificPlatform.AbpExtChrome */.c.AbpExtChrome],
['abp_ext_opera', platforms/* .SpecificPlatform.AbpExtOpera */.c.AbpExtOpera],
['abp_ext_edge', platforms/* .SpecificPlatform.AbpExtEdge */.c.AbpExtEdge],
['abp_ext_firefox', platforms/* .SpecificPlatform.AbpExtFirefox */.c.AbpExtFirefox],
]);
/**
* Map of specific platforms enum values to their corresponding string names.
*
* @note Reverse of {@link SPECIFIC_PLATFORM_MAP}.
*/
const SPECIFIC_PLATFORM_MAP_REVERSE = new Map([...SPECIFIC_PLATFORM_MAP].map(([key, value]) => [value, key]));
/**
* Map of generic platforms string names to their corresponding enum values.
*/
const GENERIC_PLATFORM_MAP = new Map([
['adg_os_any', platforms/* .GenericPlatform.AdgOsAny */.p.AdgOsAny],
['adg_safari_any', platforms/* .GenericPlatform.AdgSafariAny */.p.AdgSafariAny],
['adg_ext_chromium', platforms/* .GenericPlatform.AdgExtChromium */.p.AdgExtChromium],
['adg_ext_any', platforms/* .GenericPlatform.AdgExtAny */.p.AdgExtAny],
['adg_any', platforms/* .GenericPlatform.AdgAny */.p.AdgAny],
['ubo_ext_chromium', platforms/* .GenericPlatform.UboExtChromium */.p.UboExtChromium],
['ubo_ext_any', platforms/* .GenericPlatform.UboExtAny */.p.UboExtAny],
['ubo_any', platforms/* .GenericPlatform.UboAny */.p.UboAny],
['abp_ext_chromium', platforms/* .GenericPlatform.AbpExtChromium */.p.AbpExtChromium],
['abp_ext_any', platforms/* .GenericPlatform.AbpExtAny */.p.AbpExtAny],
['abp_any', platforms/* .GenericPlatform.AbpAny */.p.AbpAny],
['any', platforms/* .GenericPlatform.Any */.p.Any],
]);
/**
* Map of products to their platform name prefixes.
* Used for filtering generic platforms by product.
*/
const PRODUCT_PREFIX_MAP = {
[adblockers/* .AdblockProduct.Adg */.C6.Adg]: 'Adg',
[adblockers/* .AdblockProduct.Ubo */.C6.Ubo]: 'Ubo',
[adblockers/* .AdblockProduct.Abp */.C6.Abp]: 'Abp',
};
const SPECIFIC_PLATFORM_HUMAN_READABLE_NAME_MAP = new Map([
[platforms/* .SpecificPlatform.AdgOsWindows */.c.AdgOsWindows, 'AdGuard App for Windows'],
[platforms/* .SpecificPlatform.AdgOsMac */.c.AdgOsMac, 'AdGuard App for Mac'],
[platforms/* .SpecificPlatform.AdgOsAndroid */.c.AdgOsAndroid, 'AdGuard App for Android'],
[platforms/* .SpecificPlatform.AdgExtChrome */.c.AdgExtChrome, 'AdGuard Browser Extension for Chrome'],
[platforms/* .SpecificPlatform.AdgExtOpera */.c.AdgExtOpera, 'AdGuard Browser Extension for Opera'],
[platforms/* .SpecificPlatform.AdgExtEdge */.c.AdgExtEdge, 'AdGuard Browser Extension for Edge'],
[platforms/* .SpecificPlatform.AdgExtFirefox */.c.AdgExtFirefox, 'AdGuard Browser Extension for Firefox'],
[platforms/* .SpecificPlatform.AdgCbAndroid */.c.AdgCbAndroid, 'AdGuard Content Blocker for Android'],
[platforms/* .SpecificPlatform.AdgCbIos */.c.AdgCbIos, 'AdGuard Content Blocker for iOS'],
[platforms/* .SpecificPlatform.AdgCbSafari */.c.AdgCbSafari, 'AdGuard Content Blocker for Safari'],
[platforms/* .SpecificPlatform.UboExtChrome */.c.UboExtChrome, 'uBlock Origin Browser Extension for Chrome'],
[platforms/* .SpecificPlatform.UboExtOpera */.c.UboExtOpera, 'uBlock Origin Browser Extension for Opera'],
[platforms/* .SpecificPlatform.UboExtEdge */.c.UboExtEdge, 'uBlock Origin Browser Extension for Edge'],
[platforms/* .SpecificPlatform.UboExtFirefox */.c.UboExtFirefox, 'uBlock Origin Browser Extension for Firefox'],
[platforms/* .SpecificPlatform.AbpExtChrome */.c.AbpExtChrome, 'AdBlock / Adblock Plus Browser Extension for Chrome'],
[platforms/* .SpecificPlatform.AbpExtOpera */.c.AbpExtOpera, 'AdBlock / Adblock Plus Browser Extension for Opera'],
[platforms/* .SpecificPlatform.AbpExtEdge */.c.AbpExtEdge, 'AdBlock / Adblock Plus Browser Extension for Edge'],
[platforms/* .SpecificPlatform.AbpExtFirefox */.c.AbpExtFirefox, 'AdBlock / Adblock Plus Browser Extension for Firefox'],
]);
const GENERIC_PLATFORM_HUMAN_READABLE_NAME_MAP = new Map([
[platforms/* .GenericPlatform.AdgOsAny */.p.AdgOsAny, 'Any System-level AdGuard App'],
[platforms/* .GenericPlatform.AdgSafariAny */.p.AdgSafariAny, 'Any AdGuard Content Blocker for Safari'],
[platforms/* .GenericPlatform.AdgExtChromium */.p.AdgExtChromium, 'Any AdGuard Browser Extension for Chromium'],
[platforms/* .GenericPlatform.AdgExtAny */.p.AdgExtAny, 'Any AdGuard Browser Extension'],
[platforms/* .GenericPlatform.AdgAny */.p.AdgAny, 'Any AdGuard product'],
[platforms/* .GenericPlatform.UboExtChromium */.p.UboExtChromium, 'Any uBlock Origin Browser Extension for Chromium'],
[platforms/* .GenericPlatform.UboExtAny */.p.UboExtAny, 'Any uBlock Origin Browser Extension'],
[platforms/* .GenericPlatform.UboAny */.p.UboAny, 'Any uBlock Origin product'],
[platforms/* .GenericPlatform.AbpExtChromium */.p.AbpExtChromium, 'Any AdBlock / Adblock Plus Browser Extension for Chromium'],
[platforms/* .GenericPlatform.AbpExtAny */.p.AbpExtAny, 'Any AdBlock / Adblock Plus Browser Extension'],
[platforms/* .GenericPlatform.AbpAny */.p.AbpAny, 'Any AdBlock / Adblock Plus product'],
[platforms/* .GenericPlatform.Any */.p.Any, 'Any product'],
]);
/**
* Generic platforms for each product, ordered from most specific to least specific.
* Computed lazily on first access.
*/
let PRODUCT_GENERIC_PLATFORMS = null;
/**
* Map of products to their specific platforms.
* Cached after first call to avoid recomputing.
*/
let PRODUCT_SPECIFIC_PLATFORMS = null;
/**
* Initializes and returns the product generic platforms map.
* Filters all generic platforms by product prefix and sorts by specificity (fewer bits = more specific).
*
* @returns Map of products to their generic platforms, ordered from most to least specific.
*/
const getProductGenericPlatforms = () => {
if (PRODUCT_GENERIC_PLATFORMS !== null) {
return PRODUCT_GENERIC_PLATFORMS;
}
const result = {
[AdblockProduct.Adg]: [],
[AdblockProduct.Ubo]: [],
[AdblockProduct.Abp]: [],
};
// Iterate over all generic platforms and group by product prefix
const genericPlatformEntries = Object.entries(GenericPlatform);
for (const [name, platform] of genericPlatformEntries) {
// Check which product this platform belongs to
for (const [product, prefix] of Object.entries(PRODUCT_PREFIX_MAP)) {
if (name.startsWith(prefix)) {
result[product].push(platform);
break;
}
}
}
// Sort each product's platforms by specificity (fewer bits set = more specific)
for (const product of Object.keys(result)) {
result[product].sort((a, b) => {
const bitsA = getBitCount(a);
const bitsB = getBitCount(b);
return bitsA - bitsB; // Ascending: fewer bits first (more specific)
});
}
// Cache the result as readonly
PRODUCT_GENERIC_PLATFORMS = result;
return PRODUCT_GENERIC_PLATFORMS;
};
/**
* Check if the platform is a generic platform (or a combination of platforms).
*
* @param platform Platform to check.
*
* @returns True if the platform is a generic platform or combined platforms, false if it's a specific platform.
*/
const isGenericPlatform = (platform) => {
// if more than one bit is set, it's a generic platform or combined platforms
// Cast to number for bitwise operations
const num = platform;
return !!(num & (num - 1));
};
/**
* Check if the platform has multiple products specified.
* Multiple products means at least 2 of: AdgAny, AbpAny, UboAny.
*
* @param platform Platform to check.
*
* @returns True if at least 2 products are specified, false otherwise.
*/
const hasPlatformMultipleProducts = (platform) => {
const hasAdg = !!(platform & GenericPlatform.AdgAny);
const hasAbp = !!(platform & GenericPlatform.AbpAny);
const hasUbo = !!(platform & GenericPlatform.UboAny);
return ((hasAdg && hasAbp)
|| (hasAdg && hasUbo)
|| (hasAbp && hasUbo));
};
/**
* Converts a platform to its corresponding adblock products.
*
* Note: This conversion is less specific than the platform itself, as it only returns
* which products (AdGuard/uBlock/Abp) are present, dropping specific platform information
* (e.g., Windows vs Chrome extension).
*
* @param platform Platform to convert.
*
* @returns Array of AdblockProduct values:
* - Empty array `[]` if platform is 0 or no products are found
* - Array of specific products based on which products are present
* (e.g., `['AdGuard', 'UblockOrigin']` if both AdGuard and uBlock Origin are specified)
* - `['AdGuard', 'UblockOrigin', 'AdblockPlus']` for GenericPlatform.Any.
*/
const platformToAdblockProduct = (platform) => {
const products = [];
if (platform & GenericPlatform.AdgAny) {
products.push(AdblockProduct.Adg);
}
if (platform & GenericPlatform.UboAny) {
products.push(AdblockProduct.Ubo);
}
if (platform & GenericPlatform.AbpAny) {
products.push(AdblockProduct.Abp);
}
return products;
};
/**
* Optimizes platform representation by combining specific platforms into generic ones.
* Returns the minimal set of platforms needed to represent the input.
*
* @param extractedPlatforms Platform bits for a single product.
* @param productGenericPlatforms Array of generic platforms for this product, ordered by specificity.
*
* @returns Optimized array of platforms.
*/
const optimizePlatformRepresentation = (extractedPlatforms, productGenericPlatforms) => {
if (extractedPlatforms === 0) {
return [];
}
// Check if the input exactly matches any single generic platform (already optimal)
for (const genericPlatform of productGenericPlatforms) {
if (extractedPlatforms === genericPlatform) {
return [genericPlatform];
}
}
const result = [];
let remainingBits = extractedPlatforms;
// Try to match generic platforms from most specific to least specific
for (const genericPlatform of productGenericPlatforms) {
const genericBits = genericPlatform;
// Check if all bits of this generic platform are present in remaining bits
if ((remainingBits & genericBits) === genericBits) {
result.push(genericPlatform);
// Remove the matched bits from remaining
remainingBits &= ~genericBits;
// If no bits remain, we're done
if (remainingBits === 0) {
break;
}
}
}
// If there are remaining bits, we need to add them as specific platforms
// This shouldn't normally happen if our generic platforms cover all combinations,
// but we handle it for safety
if (remainingBits !== 0) {
result.push(remainingBits);
}
return result;
};
/**
* Splits a platform by products, returning a record mapping each product to its platforms.
* This is useful for iterating over each product separately when validating or processing.
*
* The function optimizes the platform representation by combining specific platforms
* into generic ones when possible, returning the minimal set needed.
*
* @param platform Platform to split (can be single or multi-product).
*
* @returns Record mapping products to optimized platform arrays:
* - Empty object `{}` if platform is 0 or no products are found
* - Object with single product key for single-product platforms
* - Object with multiple product keys for multi-product platforms
* - Each array contains the minimal representation using generic platforms where possible.
*
* @example
* ```typescript
* // Multi-product platform
* const platforms = getPlatformsByProduct(GenericPlatform.AdgAny | GenericPlatform.UboAny);
* // Returns: {
* // 'AdGuard': [GenericPlatform.AdgAny],
* // 'UblockOrigin': [GenericPlatform.UboAny]
* // }
*
* // Mixed specific and generic
* const mixed = SpecificPlatform.AdgExtChrome | SpecificPlatform.AdgExtFirefox | SpecificPlatform.AdgOsWindows;
* const result = getPlatformsByProduct(mixed);
* // Might return: { 'AdGuard': [GenericPlatform.AdgExtChromium, SpecificPlatform.AdgOsWindows] }
*
* // Iterate and validate for each product
* for (const [product, platformList] of Object.entries(platforms)) {
* for (const p of platformList) {
* const result = modifierValidator.validate(p, modifier);
* console.log(`${product}: ${result.valid}`);
* }
* }
* ```
*/
const getPlatformsByProduct = (platform) => {
const result = {};
const productPlatforms = getProductGenericPlatforms();
if (platform & GenericPlatform.AdgAny) {
const extracted = (platform & GenericPlatform.AdgAny);
result[AdblockProduct.Adg] = optimizePlatformRepresentation(extracted, productPlatforms[AdblockProduct.Adg]);
}
if (platform & GenericPlatform.UboAny) {
const extracted = (platform & GenericPlatform.UboAny);
result[AdblockProduct.Ubo] = optimizePlatformRepresentation(extracted, productPlatforms[AdblockProduct.Ubo]);
}
if (platform & GenericPlatform.AbpAny) {
const extracted = (platform & GenericPlatform.AbpAny);
result[AdblockProduct.Abp] = optimizePlatformRepresentation(extracted, productPlatforms[AdblockProduct.Abp]);
}
return result;
};
/**
* Returns the platform enum value for the given platform string name.
*
* @param platform Platform string name, e.g., 'adg_os_windows'.
*
* @returns Specific or generic platform enum value.
*
* @throws Error if the platform is unknown.
*/
const getPlatformId = (platform) => {
const specificPlatform = SPECIFIC_PLATFORM_MAP.get(platform);
if (specificPlatform) {
return specificPlatform;
}
const genericPlatform = GENERIC_PLATFORM_MAP.get(platform);
if (genericPlatform) {
return genericPlatform;
}
throw new Error(`Unknown platform: ${platform}`);
};
/**
* Returns the specific platform string name for the given platform enum value.
*
* @param platform Specific platform enum value.
*
* @returns Specific platform string name, e.g., 'adg_os_windows'.
*
* @throws Error if the platform is unknown.
*/
const getSpecificPlatformName = (platform) => {
const specificPlatform = SPECIFIC_PLATFORM_MAP_REVERSE.get(platform);
if (!specificPlatform) {
throw new Error(`Unknown platform: ${platform}`);
}
return specificPlatform;
};
/**
* Returns the human-readable platform name for the given platform enum value.
*
* @param platform Platform enum value.
*
* @returns Human-readable platform name, e.g., 'AdGuard for Windows'.
*
* @throws Error if the platform is unknown.
*/
const getHumanReadablePlatformName = (platform) => {
// Try specific platform first
const specificPlatform = SPECIFIC_PLATFORM_HUMAN_READABLE_NAME_MAP.get(platform);
if (specificPlatform) {
return specificPlatform;
}
// Then try generic platform
const genericPlatform = GENERIC_PLATFORM_HUMAN_READABLE_NAME_MAP.get(platform);
if (genericPlatform) {
return genericPlatform;
}
throw new Error(`Unknown platform: ${platform}`);
};
/**
* Gets all specific platforms for a given AdblockProduct.
* Results are cached after the first call.
*
* @param product AdblockProduct to get specific platforms for.
*
* @returns Array of all specific platforms for the given product.
*
* @example
* ```typescript
* const adgPlatforms = getProductSpecificPlatforms(AdblockProduct.Adg);
* // Returns: [AdgOsWindows, AdgOsMac, AdgOsAndroid, AdgExtChrome, ...]
* ```
*/
const getProductSpecificPlatforms = (product) => {
// Initialize cache if needed
if (PRODUCT_SPECIFIC_PLATFORMS === null) {
const result = {
[AdblockProduct.Adg]: [],
[AdblockProduct.Ubo]: [],
[AdblockProduct.Abp]: [],
};
// Iterate over all specific platforms and group by product prefix
const specificPlatformEntries = Object.entries(SpecificPlatform);
for (const [name, platform] of specificPlatformEntries) {
// Check which product this platform belongs to
for (const [prod, prefix] of Object.entries(PRODUCT_PREFIX_MAP)) {
if (name.startsWith(prefix)) {
result[prod].push(platform);
break;
}
}
}
// Cache the result as readonly
PRODUCT_SPECIFIC_PLATFORMS = result;
}
return PRODUCT_SPECIFIC_PLATFORMS[product];
};
/**
* Gets all available platform names from the platform maps.
*
* @returns Object containing arrays of all specific and generic platform names.
*
* @example
* ```typescript
* const { specificPlatformNames, genericPlatformNames } = getAllPlatformNames();
* // specificPlatformNames: ['adg_os_windows', 'adg_os_mac', 'adg_os_android', ...]
* // genericPlatformNames: ['adg_os_any', 'adg_safari_any', 'adg_ext_chromium', ...]
* ```
*/
const getAllPlatformNames = () => {
return {
specificPlatformNames: Array.from(SPECIFIC_PLATFORM_MAP.keys()),
genericPlatformNames: Array.from(GENERIC_PLATFORM_MAP.keys()),
};
};
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/base.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-bitwise */
/**
* @file Provides common compatibility table methods.
*/
/**
* Base compatibility table class which provides common methods to work with compatibility data.
*
* @template T Compatibility data schema.
*/
class CompatibilityTableBase {
/**
* Compatibility table data.
*/
data;
/**
* Optional name transformer function. If provided,
* it will be called in all methods before processing compatibility data names.
*/
nameTransformer;
/**
* Creates a new instance of the common compatibility table.
*
* @param data Compatibility table data.
* @param nameTransformer Optional name transformer function.
*/
constructor(data, nameTransformer = null) {
this.data = data;
this.nameTransformer = nameTransformer;
}
/**
* Helper method to get a 'row' from the compatibility table data by name.
*
* @param name Compatibility data name.
*
* @returns Compatibility table row storage or `null` if not found.
*/
getRowStorage(name) {
const idx = this.data.map[name];
if ((0,type_guards/* .isUndefined */.b0)(idx)) {
return null;
}
return this.data.shared[idx];
}
/**
* Checks whether a compatibility data `name` exists for any platform.
*
* @param name Compatibility data name.
*
* @returns True if the compatibility data exists, false otherwise.
*
* @note Technically, do the same as `exists()` method with generic platform _any_
* but it is faster because it does not apply complex logic.
*/
existsAny(name) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
return !(0,type_guards/* .isUndefined */.b0)(this.data.map[normalizedName]);
}
/**
* Checks whether a compatibility data `name` exists for a specified platform.
*
* @param name Compatibility data name.
* @param platform Specific or generic platform.
*
* @returns True if the compatibility data exists, false otherwise.
*/
exists(name, platform) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
const data = this.getRowStorage(normalizedName);
if (!data) {
return false;
}
const isMatch = (idx) => {
const el = data.shared[idx];
return !(0,type_guards/* .isUndefined */.b0)(el) && (el.name === normalizedName || !!el.aliases?.includes(normalizedName));
};
if (isGenericPlatform(platform)) {
// Since indexes are specific platforms in the compatibility table data,
// we can't index them directly if the platform is generic (union of specific platforms).
// In this case, we need to iterate over the keys and return true on the first match.
const keys = Object.keys(data.map);
for (let i = 0; i < keys.length; i += 1) {
const key = Number(keys[i]);
if (platform & key) {
const idx = data.map[key];
if (isMatch(idx)) {
return true;
}
}
}
return false;
}
const idx = data.map[platform];
return isMatch(idx);
}
/**
* Returns a compatibility data by name and specific platform.
*
* @param name The name of the compatibility data.
* @param platform The specific platform.
*
* @returns A single compatibility data or `null` if not found.
*/
getSingle(name, platform) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
const data = this.getRowStorage(normalizedName);
if (!data) {
return null;
}
const idx = data.map[platform];
return (0,type_guards/* .isUndefined */.b0)(idx) ? null : data.shared[idx];
}
/**
* Returns all compatibility data records for name and specified platform.
*
* @param name Compatibility data name.
* @param platform Specific or generic platform.
*
* @returns Multiple records grouped by platforms.
* Technically, it is an object where keys are platform enums values and values are compatibility data records.
*
* @note Platform enum values can be converted to string names using {@link getSpecificPlatformName} on demand.
*/
getMultiple(name, platform) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
const data = this.getRowStorage(normalizedName);
if (!data) {
return null;
}
if (isGenericPlatform(platform)) {
const result = {};
const keys = Object.keys(data.map);
for (let i = 0; i < keys.length; i += 1) {
const key = Number(keys[i]);
if (platform & key) {
const idx = data.map[key];
if (!(0,type_guards/* .isUndefined */.b0)(idx)) {
result[key] = data.shared[idx];
}
}
}
return result;
}
const idx = data.map[platform];
if ((0,type_guards/* .isUndefined */.b0)(idx)) {
return null;
}
return { key: data.shared[idx] };
}
/**
* Returns all compatibility data records for the specified platform.
*
* @param platform Specific or generic platform.
*
* @returns Array of multiple records grouped by platforms.
*/
getAllMultiple(platform) {
const result = [];
for (let i = 0; i < this.data.shared.length; i += 1) {
const data = this.data.shared[i];
const names = new Set(data.shared.map(({ name }) => name));
names.forEach((name) => {
const multipleRecords = this.getMultiple(name, platform);
if (multipleRecords) {
result.push(multipleRecords);
}
});
}
return result;
}
/**
* Returns the first compatibility data record for name and specified platform.
*
* @param name Compatibility data name.
* @param platform Specific, generic, or combined platform.
*
* @returns First found compatibility data record or `null` if not found.
*/
getFirst(name, platform) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
const data = this.getRowStorage(normalizedName);
if (!data) {
return null;
}
if (isGenericPlatform(platform)) {
const keys = Object.keys(data.map);
for (let i = 0; i < keys.length; i += 1) {
const key = Number(keys[i]);
if (platform & key) {
const idx = data.map[key];
if (!(0,type_guards/* .isUndefined */.b0)(idx)) {
// return the first found record
return data.shared[idx];
}
}
}
return null;
}
const idx = data.map[platform];
if ((0,type_guards/* .isUndefined */.b0)(idx)) {
return null;
}
return data.shared[idx];
}
/**
* Returns all compatibility data records for the specified name.
*
* @param name Compatibility data name.
*
* @returns Array of multiple records grouped by platforms.
*/
getRow(name) {
const normalizedName = this.nameTransformer ? this.nameTransformer(name) : name;
const data = this.getRowStorage(normalizedName);
if (!data) {
return [];
}
return data.shared;
}
/**
* Returns all compatibility data grouped by products.
*
* @returns Array of multiple records grouped by products.
*/
getRowsByProduct() {
const result = [];
for (let i = 0; i < this.data.shared.length; i += 1) {
const data = this.data.shared[i];
const keys = Object.keys(data.map);
const row = {
[adblockers/* .AdblockSyntax.Adg */.YG.Adg]: {},
[adblockers/* .AdblockSyntax.Ubo */.YG.Ubo]: {},
[adblockers/* .AdblockSyntax.Abp */.YG.Abp]: {},
};
for (let j = 0; j < keys.length; j += 1) {
const key = Number(keys[j]);
if (key & platforms/* .GenericPlatform.AdgAny */.p.AdgAny) {
row[adblockers/* .AdblockSyntax.Adg */.YG.Adg][key] = data.shared[data.map[key]];
}
else if (key & platforms/* .GenericPlatform.UboAny */.p.UboAny) {
row[adblockers/* .AdblockSyntax.Ubo */.YG.Ubo][key] = data.shared[data.map[key]];
}
else if (key & platforms/* .GenericPlatform.AbpAny */.p.AbpAny) {
row[adblockers/* .AdblockSyntax.Abp */.YG.Abp][key] = data.shared[data.map[key]];
}
}
result.push(row);
}
return result;
}
}
},
33017(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
YJ: () => (scriptletsCompatibilityTableData),
qL: () => (redirectsCompatibilityTableData),
rd: () => (modifiersCompatibilityTableData)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
const modifiersCompatibilityTableData = {shared:[{shared:[{name:'all',aliases:null,description:'$all modifier is made of $document, $popup, and all content-type modifiers combined.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#all-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:true,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'all',aliases:null,description:'The `all` option is equivalent to specifying all network-based types\n+ `popup`, `document`, `inline-font` and `inline-script`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#all',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'app',aliases:null,description:'The `$app` modifier lets you narrow the rule coverage down to a specific application or a list of applications.\nThe modifier\'s behavior and syntax perfectly match the corresponding basic rules `$app` modifier.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#app-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_apps',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'badfilter',aliases:null,description:'The rules with the `$badfilter` modifier disable other basic rules to which they refer. It means that\nthe text of the disabled rule should match the text of the `$badfilter` rule (without the `$badfilter` modifier).',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#badfilter-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'badfilter',aliases:null,description:'The rules with the `$badfilter` modifier disable other basic rules to which they refer. It means that\nthe text of the disabled rule should match the text of the `$badfilter` rule (without the `$badfilter` modifier).',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#badfilter',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'cname',aliases:null,description:'When used in an exception filter,\nit will bypass blocking CNAME uncloaked requests for the current (specified) document.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#cname',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'content',aliases:null,description:'Disables HTML filtering and `$replace` rules on the pages that match the rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#content-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'cookie',aliases:null,description:'The `$cookie` modifier completely changes rule behavior.\nInstead of blocking a request, this modifier makes us suppress or modify the Cookie and Set-Cookie headers.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#cookie-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'^([^;=\\s]*?)((?:;(maxAge=\\d+;?)?|(sameSite=(lax|none|strict);?)?){1,3})(?<!;)$',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'csp',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied to a rule, it will not block the matching request.\nThe response headers are going to be modified instead.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#csp-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','important','subdocument','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'csp_value',valueFormatFlags:null},{name:'csp',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied to a rule, it will not block the matching request.\nThe response headers are going to be modified instead.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#csp',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['1p','3p','domain','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'csp_value',valueFormatFlags:null},{name:'csp',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied to a rule, it will not block the matching request.\nThe response headers are going to be modified instead.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#content-security-policies',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','subdocument'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'csp_value',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'denyallow',aliases:null,description:'The `$denyallow` modifier allows to avoid creating additional rules\nwhen it is needed to disable a certain rule for specific domains.\n`$denyallow` matches only target domains and not referrer domains.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#denyallow-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['to'],inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_denyallow_domains',valueFormatFlags:null},{name:'denyallow',aliases:null,description:'The `$denyallow` modifier allows to avoid creating additional rules\nwhen it is needed to disable a certain rule for specific domains.\n`$denyallow` matches only target domains and not referrer domains.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#denyallow',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['to'],inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_denyallow_domains',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'document',aliases:null,description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#document-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'document',aliases:null,description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#document-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'document',aliases:null,description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#document-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'document',aliases:null,description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#document-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'document',aliases:['doc'],description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#document',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'document',aliases:null,description:'The rule corresponds to the main frame document requests,\ni.e. HTML documents that are loaded in the browser tab.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#allowlist',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'256':2,'512':3,'1024':4,'2048':4,'4096':4,'8192':4,'16384':5,'32768':5,'65536':5,'131072':5}},{shared:[{name:'domain',aliases:['from'],description:'The `$domain` modifier limits the rule application area to a list of domains and their subdomains.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#domain-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null},{name:'domain',aliases:['from'],description:'The `$domain` modifier limits the rule application area to a list of domains and their subdomains.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#from',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null},{name:'domain',aliases:null,description:'The `$domain` modifier limits the rule application area to a list of domains and their subdomains.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#domain-restrictions',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'elemhide',aliases:['ehide'],description:'Disables any cosmetic rules on the pages matching the rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#elemhide-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'elemhide',aliases:['ehide'],description:'Disables any cosmetic rules on the pages matching the rule.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#elemhide-1',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'elemhide',aliases:['ehide'],description:'Disables any cosmetic rules on the pages matching the rule.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'empty',aliases:null,description:'This modifier is deprecated in favor of the $redirect modifier.\nRules with `$empty` are still supported and being converted into `$redirect=nooptext` now\nbut the support shall be removed in the future.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#empty-modifier',versionAdded:null,versionRemoved:null,deprecated:true,deprecationMessage:'Rules with `$empty` are still supported and being converted into `$redirect=nooptext` now\nbut the support shall be removed in the future.',removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'empty',aliases:null,description:'This modifier is deprecated in favor of the $redirect modifier.\nRules with `$empty` are still supported and being converted into `$redirect=nooptext` now\nbut the support shall be removed in the future.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#empty-modifier',versionAdded:null,versionRemoved:null,deprecated:true,deprecationMessage:'Rules with `$empty` are still supported and being converted into `$redirect=nooptext` now\nbut the support shall be removed in the future.',removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'empty',aliases:null,description:'This modifier is deprecated in favor of the $redirect modifier.\nRules with `$empty` are supported and being converted into `$redirect=nooptext`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#empty',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'extension',aliases:null,description:'Disables all userscripts on the pages matching this rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#extension-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','genericblock','urlblock','jsinject','content','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:true,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'first-party',aliases:['1p','~third-party'],description:'A restriction of first-party requests. Equal to `~third-party`.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#third-party-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'first-party',aliases:['1p','~third-party'],description:'A restriction of first-party requests. Equal to `~third-party`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#1p',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'font',aliases:null,description:'The rule corresponds to requests for fonts, e.g. `.woff` filename extension.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#font-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'font',aliases:null,description:'The rule corresponds to requests for fonts, e.g. `.woff` filename extension.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'font',aliases:null,description:'The rule corresponds to requests for fonts, e.g. `.woff` filename extension.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'genericblock',aliases:null,description:'Disables generic basic rules on pages that correspond to exception rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#genericblock-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','extension','jsinject','content','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'genericblock',aliases:null,description:'Disables generic basic rules on pages that correspond to exception rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#genericblock-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','jsinject','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'genericblock',aliases:null,description:'Disables generic basic rules on pages that correspond to exception rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#genericblock-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','jsinject','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'genericblock',aliases:null,description:'Disables generic basic rules on pages that correspond to exception rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#genericblock-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','jsinject','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'genericblock',aliases:null,description:'Disables generic basic rules on pages that correspond to exception rule.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'256':2,'512':3,'16384':4,'32768':4,'65536':4,'131072':4}},{shared:[{name:'generichide',aliases:['ghide'],description:'Disables all generic cosmetic rules.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#generichide-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','genericblock','urlblock','extension','jsinject','content','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'generichide',aliases:['ghide'],description:'Disables all generic cosmetic rules.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#generichide',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'generichide',aliases:null,description:'Disables all generic cosmetic rules.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'header',aliases:null,description:'The `$header` modifier allows matching the HTTP response\nhaving a specific header with (optionally) a specific value.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#header-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'^(?:)[\\w-]+(:(?:)(\\w+|\\/.+\\/))?',valueFormatFlags:'i'},{name:'header',aliases:null,description:'The `$header` modifier allows matching the HTTP response\nhaving a specific header with (optionally) a specific value.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#header-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'^(?:)[\\w-]+(:(?:)(\\w+|\\/.+\\/))?',valueFormatFlags:'i'},{name:'header',aliases:null,description:'The `$header` modifier allows matching the HTTP response\nhaving a specific header with (optionally) a specific value.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#header',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'^(?:)[\\w-]+(:(?:)(\\w+|\\/.+\\/))?',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'hls',aliases:null,description:'The `$hls` rules modify the response of a matching request.\nThey are intended as a convenient way to remove segments from HLS playlists (RFC 8216).',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#hls-modifier',versionAdded:'CoreLibs 1.10',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','third-party','app','important','match-case','xmlhttprequest'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'((?:)\\w+(?:)|(?:)\\/.+\\/(?:)([ti]*)?)',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'image',aliases:null,description:'The rule corresponds to images requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#image-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'image',aliases:null,description:'The rule corresponds to images requests.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'image',aliases:null,description:'The rule corresponds to images requests.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'important',aliases:null,description:'The `$important` modifier applied to a rule increases its priority\nover any other rule without `$important` modifier. Even over basic exception rules.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#important-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'important',aliases:null,description:'The `$important` modifier applied to a rule increases its priority\nover any other rule without `$important` modifier. Even over basic exception rules.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#important',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'inline-font',aliases:null,description:'The `$inline-font` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-font` is converting into:\n```adblock\n||example.org^$csp=font-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-font-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'inline-font',aliases:null,description:'The `$inline-font` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-font` is converting into:\n```adblock\n||example.org^$csp=font-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-font-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'inline-font',aliases:null,description:'The `$inline-font` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-font` is converting into:\n```adblock\n||example.org^$csp=font-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#inline-font',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'inline-script',aliases:null,description:'The `$inline-script` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-script` is converting into:\n```adblock\n||example.org^$csp=script-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-script-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'inline-script',aliases:null,description:'The `$inline-script` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-script` is converting into:\n```adblock\n||example.org^$csp=script-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#inline-script-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'inline-script',aliases:null,description:'The `$inline-script` modifier is a sort of a shortcut for $csp modifier with specific value.\nE.g. `||example.org^$inline-script` is converting into:\n```adblock\n||example.org^$csp=script-src \'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:\n```',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#inline-script',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'jsinject',aliases:null,description:'Forbids adding of javascript code to the page.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsinject-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','genericblock','urlblock','extension','content','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'jsinject',aliases:null,description:'Forbids adding of javascript code to the page.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsinject-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','genericblock','urlblock','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'jsinject',aliases:null,description:'Forbids adding of javascript code to the page.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsinject-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','genericblock','urlblock','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'jsinject',aliases:null,description:'Forbids adding of javascript code to the page.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsinject-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','genericblock','urlblock','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'256':2,'512':3}},{shared:[{name:'jsonprune',aliases:null,description:'The `$jsonprune` rules modify the response to a matching request\nby removing JSON items that match a modified JSONPath expression.\nThey do not modify responses which are not valid JSON documents.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#jsonprune-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'^(?:)\\\\(?:)\\$(?:)\\.?(?:).+(?:)$',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'match-case',aliases:null,description:'This modifier defines a rule which applies only to addresses that match the case.\nDefault rules are case-insensitive.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#match-case-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'match-case',aliases:null,description:'This modifier defines a rule which applies only to addresses that match the case.\nDefault rules are case-insensitive.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#match-case',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'match-case',aliases:null,description:'This modifier defines a rule which applies only to addresses that match the case.\nDefault rules are case-insensitive.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'media',aliases:null,description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#media-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'media',aliases:null,description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'media',aliases:null,description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'method',aliases:null,description:'This modifier limits the rule scope to requests that use the specified set of HTTP methods.\nNegated methods are allowed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#method-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_methods',valueFormatFlags:null},{name:'method',aliases:null,description:'This modifier limits the rule scope to requests that use the specified set of HTTP methods.\nNegated methods are allowed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#method-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_methods',valueFormatFlags:null},{name:'method',aliases:null,description:'This modifier limits the rule scope to requests that use the specified set of HTTP methods.\nNegated methods are allowed.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#method',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_methods',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'mp4',aliases:null,description:'As a response to blocked request AdGuard returns a short video placeholder.\nRules with `$mp4` are still supported and being converted into `$redirect=noopmp4-1s` now\nbut the support shall be removed in the future.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#mp4-modifier',versionAdded:null,versionRemoved:null,deprecated:true,deprecationMessage:'Rules with `$mp4` are still supported and being converted into `$redirect=noopmp4-1s` now\nbut the support shall be removed in the future.',removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'mp4',aliases:null,description:'As a response to blocked request AdGuard returns a short video placeholder.\nRules with `$mp4` are still supported and being converted into `$redirect=noopmp4-1s` now\nbut the support shall be removed in the future.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#mp4-modifier',versionAdded:null,versionRemoved:null,deprecated:true,deprecationMessage:'Rules with `$mp4` are still supported and being converted into `$redirect=noopmp4-1s` now\nbut the support shall be removed in the future.',removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'mp4',aliases:null,description:'As a response to blocked request a short video placeholder is returned.\nRules with `$mp4` are supported and being converted into `$redirect=noopmp4-1s`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#mp4',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'network',aliases:null,description:'This is basically a Firewall-kind of rules allowing to fully block\nor unblock access to a specified remote address.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#network-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['app','important'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'_',aliases:null,description:'The noop modifier does nothing and can be used solely to increase rules\' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#noop-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'_',aliases:null,description:'The noop modifier does nothing and can be used solely to increase rules\' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#noop-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'_',aliases:null,description:'The noop modifier does nothing and can be used solely to increase rules\' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#noop-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'_',aliases:null,description:'The noop modifier does nothing and can be used solely to increase rules\' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#noop-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'_',aliases:null,description:'The noop modifier does nothing and can be used solely to increase rules\' readability.\nIt consists of a sequence of underscore characters (_) of any length\nand can appear in a rule as many times as needed.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#_-aka-noop',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'256':2,'512':3,'1024':4,'2048':4,'4096':4,'8192':4}},{shared:[{name:'object-subrequest',aliases:null,description:'The `$object-subrequest` modifier is removed and is no longer supported.\nRules with it are considered as invalid.\nThe rule corresponds to requests by browser plugins (it is usually Flash).',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#object-subrequest-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:true,removalMessage:'The `$object-subrequest` modifier is removed and is no longer supported.\nRules with it are considered as invalid.',conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0}},{shared:[{name:'object',aliases:null,description:'The rule corresponds to browser plugins resources, e.g. Java or Flash',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#object-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'object',aliases:null,description:'The rule corresponds to browser plugins resources, e.g. Java or Flash.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'object',aliases:null,description:'The rule corresponds to browser plugins resources, e.g. Java or Flash.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'other',aliases:null,description:'The rule applies to requests for which the type has not been determined\nor does not match the types listed above.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#other-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'other',aliases:null,description:'The rule applies to requests for which the type has not been determined\nor does not match the types listed above.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'other',aliases:null,description:'The rule applies to requests for which the type has not been determined\nor does not match the types listed above.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'permissions',aliases:null,description:'For the requests matching a `$permissions` rule, ad blocker strengthens response\'s feature policy\nby adding additional feature policy equal to the `$permissions` modifier contents.\n`$permissions` rules are applied independently from any other rule type.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#permissions-modifier',versionAdded:'CoreLibs 1.11',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','important','subdocument'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'permissions_value',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'ping',aliases:null,description:'The rule corresponds to requests caused by either navigator.sendBeacon() or the ping attribute on links.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#ping-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'ping',aliases:null,description:'The rule corresponds to requests caused by either navigator.sendBeacon() or the ping attribute on links.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'ping',aliases:null,description:'The rule corresponds to requests caused by either navigator.sendBeacon() or the ping attribute on links.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'popunder',aliases:null,description:'To block "popunders" windows/tabs where the original page redirects to an advertisement\nand the desired content loads in the newly created one.\nTo be used in the same manner as the popup filter option, except that it will block popunders.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#popunder',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:true,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'popup',aliases:null,description:'Pages opened in a new tab or window.\nNote: Filters will not block pop-ups by default, only if the `$popup` type option is specified.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#popup-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'popup',aliases:null,description:'Pages opened in a new tab or window.\nNote: Filters will not block pop-ups by default, only if the `$popup` type option is specified.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'popup',aliases:null,description:'Pages opened in a new tab or window.\nNote: Filters will not block pop-ups by default, only if the `$popup` type option is specified.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'redirect-rule',aliases:null,description:'This is basically an alias to `$redirect`\nsince it has the same "redirection" values and the logic is almost similar.\nThe difference is that `$redirect-rule` is applied only in the case\nwhen the target request is blocked by a different basic rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-rule-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','to','third-party','popup','match-case','header','first-party','document','image','stylesheet','script','object','font','media','subdocument','ping','xmlhttprequest','websocket','other','webrtc','important','badfilter','app'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(1x1-transparent\\.gif|2x2-transparent\\.png|3x2-transparent\\.png|32x32-transparent\\.png|noopframe|noopcss|noopjs|noopjson|nooptext|empty|noopvmap-1\\.0|noopvast-2\\.0|noopvast-3\\.0|noopvast-4\\.0|noopmp3-0\\.1s|noopmp4-1s|amazon-apstag|ati-smarttag|didomi-loader|fingerprintjs2|fingerprintjs3|gemius|google-analytics-ga|google-analytics|googletagmanager-gtm|google-ima3|googlesyndication-adsbygoogle|googletagservices-gpt|matomo|metrika-yandex-tag|metrika-yandex-watch|naver-wcslog|noeval|pardot-1\\.0|prebid-ads|prebid|prevent-bab|prevent-bab2|prevent-fab-3\\.2\\.0|prevent-popads-net|scorecardresearch-beacon|set-popads-dummy|click2load\\.html|)?$',valueFormatFlags:null},{name:'redirect-rule',aliases:null,description:'This is basically an alias to `$redirect`\nsince it has the same "redirection" values and the logic is almost similar.\nThe difference is that `$redirect-rule` is applied only in the case\nwhen the target request is blocked by a different basic rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-rule-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','to','third-party','popup','match-case','header','first-party','document','image','stylesheet','script','object','font','media','subdocument','ping','xmlhttprequest','websocket','other','webrtc','important','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(1x1-transparent\\.gif|2x2-transparent\\.png|3x2-transparent\\.png|32x32-transparent\\.png|noopframe|noopcss|noopjs|noopjson|nooptext|empty|noopvmap-1\\.0|noopvast-2\\.0|noopvast-3\\.0|noopvast-4\\.0|noopmp3-0\\.1s|noopmp4-1s|amazon-apstag|ati-smarttag|didomi-loader|fingerprintjs2|fingerprintjs3|gemius|google-analytics-ga|google-analytics|googletagmanager-gtm|google-ima3|googlesyndication-adsbygoogle|googletagservices-gpt|matomo|metrika-yandex-tag|metrika-yandex-watch|naver-wcslog|noeval|pardot-1\\.0|prebid-ads|prebid|prevent-bab|prevent-bab2|prevent-fab-3\\.2\\.0|prevent-popads-net|scorecardresearch-beacon|set-popads-dummy|click2load\\.html|)?$',valueFormatFlags:null},{name:'redirect-rule',aliases:null,description:'This is basically an alias to `$redirect`\nsince it has the same "redirection" values and the logic is almost similar.\nThe difference is that `$redirect-rule` is applied only in the case\nwhen the target request is blocked by a different basic rule.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect-rule',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','to','third-party','popup','match-case','header','first-party','document','image','stylesheet','script','object','font','media','subdocument','ping','xmlhttprequest','websocket','other','webrtc','important','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'^(1x1\\.gif|2x2\\.png|3x2\\.png|32x32\\.png|noop\\.css|noop\\.html|noopframe|noop\\.js|noop\\.txt|noop-0\\.1s\\.mp3|noop-0\\.5s\\.mp3|noop-1s\\.mp4|none|click2load\\.html|addthis_widget\\.js|amazon_ads\\.js|amazon_apstag\\.js|monkeybroker\\.js|doubleclick_instream_ad_status|google-analytics_ga\\.js|google-analytics_analytics\\.js|google-analytics_inpage_linkid\\.js|google-analytics_cx_api\\.js|google-ima\\.js|googletagservices_gpt\\.js|googletagmanager_gtm\\.js|googlesyndication_adsbygoogle\\.js|scorecardresearch_beacon\\.js|outbrain-widget\\.js|hd-main\\.js)(:[0-9]+)?$',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'redirect',aliases:null,description:'Used to redirect web requests to a local "resource".',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(1x1-transparent\\.gif|2x2-transparent\\.png|3x2-transparent\\.png|32x32-transparent\\.png|noopframe|noopcss|noopjs|noopjson|nooptext|empty|noopvmap-1\\.0|noopvast-2\\.0|noopvast-3\\.0|noopvast-4\\.0|noopmp3-0\\.1s|noopmp4-1s|amazon-apstag|ati-smarttag|didomi-loader|fingerprintjs2|fingerprintjs3|gemius|google-analytics-ga|google-analytics|googletagmanager-gtm|google-ima3|googlesyndication-adsbygoogle|googletagservices-gpt|matomo|metrika-yandex-tag|metrika-yandex-watch|naver-wcslog|noeval|pardot-1\\.0|prebid-ads|prebid|prevent-bab|prevent-bab2|prevent-fab-3\\.2\\.0|prevent-popads-net|scorecardresearch-beacon|set-popads-dummy|click2load\\.html)?$',valueFormatFlags:null},{name:'redirect',aliases:null,description:'Used to redirect web requests to a local "resource".',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#redirect-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(1x1-transparent\\.gif|2x2-transparent\\.png|3x2-transparent\\.png|32x32-transparent\\.png|noopframe|noopcss|noopjs|noopjson|nooptext|empty|noopvmap-1\\.0|noopvast-2\\.0|noopvast-3\\.0|noopvast-4\\.0|noopmp3-0\\.1s|noopmp4-1s|amazon-apstag|ati-smarttag|didomi-loader|fingerprintjs2|fingerprintjs3|gemius|google-analytics-ga|google-analytics|googletagmanager-gtm|google-ima3|googlesyndication-adsbygoogle|googletagservices-gpt|matomo|metrika-yandex-tag|metrika-yandex-watch|naver-wcslog|noeval|pardot-1\\.0|prebid-ads|prebid|prevent-bab|prevent-bab2|prevent-fab-3\\.2\\.0|prevent-popads-net|scorecardresearch-beacon|set-popads-dummy|click2load\\.html)?$',valueFormatFlags:null},{name:'redirect',aliases:null,description:'Used to redirect web requests to a local "resource".',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'^(1x1\\.gif|2x2\\.png|3x2\\.png|32x32\\.png|noop\\.css|noop\\.html|noopframe|noop\\.js|noop\\.txt|noop-0\\.1s\\.mp3|noop-0\\.5s\\.mp3|noop-1s\\.mp4|none|click2load\\.html|addthis_widget\\.js|amazon_ads\\.js|amazon_apstag\\.js|monkeybroker\\.js|doubleclick_instream_ad_status|google-analytics_ga\\.js|google-analytics_analytics\\.js|google-analytics_inpage_linkid\\.js|google-analytics_cx_api\\.js|google-ima\\.js|googletagservices_gpt\\.js|googletagmanager_gtm\\.js|googlesyndication_adsbygoogle\\.js|scorecardresearch_beacon\\.js|outbrain-widget\\.js|hd-main\\.js)(:[0-9]+)?$',valueFormatFlags:null},{name:'rewrite',aliases:null,description:'The `rewrite=` option allows the rewriting of URLs (or redirecting requests) to an internal\nresource in order to deactivate it without causing an error. Indicate the internal resource\nby name and prefix `abp-resource:` in order to be recognized. For example\n`$rewrite=abp-resource:blank-js` sends an empty JavaScript.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'(?:)^abp-resource:(?:)(blank-text|blank-css|blank-js|blank-html|blank-mp3|1x1-transparent-gif|2x2-transparent-png|3x2-transparent-png|32x32-transparent-png)$',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2,'16384':3,'32768':3,'65536':3,'131072':3}},{shared:[{name:'referrerpolicy',aliases:null,description:'This modifier allows overriding of a page\'s referrer policy.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#referrerpolicy-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['document','subdocument'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'referrerpolicy_value',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0}},{shared:[{name:'removeheader',aliases:null,description:'Rules with the `$removeheader` modifier are intended to remove headers from HTTP requests and responses.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeheader-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','third-party','first-party','app','important','match-case','document','image','stylesheet','script','object','font','media','subdocument','ping','xmlhttpreqeust','websocket','other','webrtc'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)(request:)?(?:)(?!(access-control-allow-origin|access-control-allow-credentials|access-control-allow-headers|access-control-allow-methods|access-control-expose-headers|access-control-max-age|access-control-request-headers|access-control-request-method|origin|timing-allow-origin|allow|cross-origin-embedder-policy|cross-origin-opener-policy|cross-origin-resource-policy|content-security-policy|content-security-policy-report-only|expect-ct|feature-policy|origin-isolation|strict-transport-security|upgrade-insecure-requests|x-content-type-options|x-download-options|x-frame-options|x-permitted-cross-domain-policies|x-powered-by|x-xss-protection|public-key-pins|public-key-pins-report-only|sec-websocket-key|sec-websocket-extensions|sec-websocket-accept|sec-websocket-protocol|sec-websocket-version|p3p|sec-fetch-mode|sec-fetch-dest|sec-fetch-site|sec-fetch-user|referrer-policy|content-type|content-length|accept|accept-encoding|host|connection|transfer-encoding|upgrade)$)(?:)[A-z0-9-]+(?:)$',valueFormatFlags:'i'},{name:'removeheader',aliases:null,description:'Rules with the `$removeheader` modifier are intended to remove headers from HTTP requests and responses.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeheader-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','third-party','first-party','app','important','match-case','document','image','stylesheet','script','object','font','media','subdocument','ping','xmlhttpreqeust','websocket','other','webrtc'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)(request:)?(?:)(?!(access-control-allow-origin|access-control-allow-credentials|access-control-allow-headers|access-control-allow-methods|access-control-expose-headers|access-control-max-age|access-control-request-headers|access-control-request-method|origin|timing-allow-origin|allow|cross-origin-embedder-policy|cross-origin-opener-policy|cross-origin-resource-policy|content-security-policy|content-security-policy-report-only|expect-ct|feature-policy|origin-isolation|strict-transport-security|upgrade-insecure-requests|x-content-type-options|x-download-options|x-frame-options|x-permitted-cross-domain-policies|x-powered-by|x-xss-protection|public-key-pins|public-key-pins-report-only|sec-websocket-key|sec-websocket-extensions|sec-websocket-accept|sec-websocket-protocol|sec-websocket-version|p3p|sec-fetch-mode|sec-fetch-dest|sec-fetch-site|sec-fetch-user|referrer-policy|content-type|content-length|accept|accept-encoding|host|connection|transfer-encoding|upgrade)$)(?:)[A-z0-9-]+(?:)$',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1}},{shared:[{name:'removeparam',aliases:null,description:'Rules with the `$removeparam` modifier are intended to strip query parameters from requests\' URLs.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'((?:)\\w+(?:)|\\/.+\\/(?:)([gimuy]+)?)',valueFormatFlags:'i'},{name:'removeparam',aliases:null,description:'Rules with the `$removeparam` modifier are intended to strip query parameters from requests\' URLs.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#removeparam-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'((?:)\\w+(?:)|\\/.+\\/(?:)([gimuy]+)?)',valueFormatFlags:'i'},{name:'removeparam',aliases:null,description:'Rules with the `$removeparam` modifier are intended to strip query parameters from requests\' URLs.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#removeparam',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'((?:)\\w+(?:)|\\/.+\\/(?:)([gimuy]+)?)',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'replace',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied, the rule will not block the request. The response is going to be modified instead.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#replace-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['app','domain','document','subdocument','script','stylesheet','other','xmlhttprequest','first-party','third-party','important','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)\\/(?:)(.+)(?:)\\/(?:)(.+)?(?:)\\/(?:)([gimuy]*)?(?:)$',valueFormatFlags:'i'},{name:'replace',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied, the rule will not block the request. The response is going to be modified instead.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#replace-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['app','domain','document','subdocument','script','stylesheet','other','xmlhttprequest','first-party','third-party','important','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)\\/(?:)(.+)(?:)\\/(?:)(.+)?(?:)\\/(?:)([gimuy]*)?(?:)$',valueFormatFlags:'i'},{name:'replace',aliases:null,description:'This modifier completely changes the rule behavior.\nIf it is applied, the rule will not block the request. The response is going to be modified instead.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#replace',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['app','domain','document','subdocument','script','stylesheet','other','xmlhttprequest','first-party','third-party','important','badfilter'],inverseConflicts:true,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'^(?:)\\/(?:)(.+)(?:)\\/(?:)(.+)?(?:)\\/(?:)([gimuy]*)?(?:)$',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0,'64':1,'8192':2}},{shared:[{name:'script',aliases:null,description:'The rule corresponds to script requests, e.g. javascript, vbscript.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#script-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'script',aliases:null,description:'The rule corresponds to script requests, e.g. javascript, vbscript.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'script',aliases:null,description:'The rule corresponds to script requests, e.g. javascript, vbscript.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'specifichide',aliases:['shide'],description:'Disables all specific element hiding and CSS rules, but not general ones.\nHas an opposite effect to `$generichide`.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#specifichide-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','genericblock','urlblock','extension','jsinject','content','xmlhttprequest','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'specifichide',aliases:['shide'],description:'Disables all specific element hiding and CSS rules, but not general ones.\nHas an opposite effect to `$generichide`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specifichide',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'stealth',aliases:null,description:'Disables the Stealth Mode module for all corresponding pages and requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stealth-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_stealth_options',valueFormatFlags:null},{name:'stealth',aliases:null,description:'Disables the Stealth Mode module for all corresponding pages and requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stealth-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_stealth_options',valueFormatFlags:null},{name:'stealth',aliases:null,description:'Disables the Stealth Mode module for all corresponding pages and requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stealth-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_stealth_options',valueFormatFlags:null},{name:'stealth',aliases:null,description:'Disables the Stealth Mode module for all corresponding pages and requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stealth-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_stealth_options',valueFormatFlags:null},{name:'stealth',aliases:null,description:'Disables the Stealth Mode module for all corresponding pages and requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stealth-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:true,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_stealth_options',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':2,'32':3,'64':4}},{shared:[{name:'strict1p',aliases:null,description:'This new `strict1p` option can check for strict partyness.\nFor example, a network request qualifies as 1st-party if both the context and the request share the same hostname.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#strict1p',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'strict3p',aliases:null,description:'This new `strict3p` option can check for strict partyness.\nFor example, a network request qualifies as 3rd-party if the context and the request hostnames are different.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#strict3p',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'stylesheet',aliases:null,description:'The rule corresponds to CSS files requests.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#stylesheet-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'stylesheet',aliases:['css'],description:'The rule corresponds to CSS files requests.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#css',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'stylesheet',aliases:null,description:'The rule corresponds to CSS files requests.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'subdocument',aliases:null,description:'The rule corresponds to requests for built-in pages — HTML tags frame and iframe.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#subdocument-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'subdocument',aliases:['frame'],description:'The rule corresponds to requests for built-in pages — HTML tags frame and iframe.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#frame',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'subdocument',aliases:null,description:'The rule corresponds to requests for built-in pages — HTML tags frame and iframe.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'third-party',aliases:['3p'],description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#third-party-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'3p',aliases:['third-party'],description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#3p',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'third-party',aliases:null,description:'A restriction of third-party and own requests.\nA third-party request is a request from a different domain.\nFor example, a request to `example.org` from `domain.com` is a third-party request.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#party-requests',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'to',aliases:null,description:'`$to` limits the rule scope to requests made to the specified domains and their subdomains.\nTo add multiple domains to one rule, use the `|` character as a separator.',docs:'https://adguard.com/kb/general/ad-filtering/create-own-filters/#to-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['denyallow'],inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null},{name:'to',aliases:null,description:'`$to` limits the rule scope to requests made to the specified domains and their subdomains.\nTo add multiple domains to one rule, use the `|` character as a separator.',docs:'https://adguard.com/kb/general/ad-filtering/create-own-filters/#to-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['denyallow'],inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null},{name:'to',aliases:null,description:'The main motivation of this option is\nto give static network filtering engine an equivalent of DNR\'s `requestDomains` and `excludedRequestDomains`.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#to',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['denyallow'],inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:'pipe_separated_domains',valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'1024':2,'2048':2,'4096':2,'8192':2}},{shared:[{name:'urlblock',aliases:null,description:'Disables blocking of all requests sent from the pages matching the rule.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#urlblock-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:['domain','specifichide','generichide','elemhide','extension','jsinject','content','badfilter'],inverseConflicts:true,assignable:false,negatable:false,blockOnly:false,exceptionOnly:true,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0}},{shared:[{name:'urltransform',aliases:null,description:'Rules with the `$urltransform` modifier are intended to transform the URL\nof a request by applying a regular expression-based find/replace on the\npath and query portion of the URL. The origin (scheme + host + port)\ncannot be changed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#urltransform-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)\\/(?:)(.+)(?:)\\/(?:)(.*)?(?:)\\/(?:)([gimuy]*)?(?:)$',valueFormatFlags:'i'},{name:'urltransform',aliases:null,description:'Rules with the `$urltransform` modifier are intended to transform the URL\nof a request by applying a regular expression-based find/replace on the\npath and query portion of the URL. The origin (scheme + host + port)\ncannot be changed.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#urltransform-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:true,negatable:false,blockOnly:false,exceptionOnly:false,valueOptional:true,valueOptionalExceptionOnly:true,valueFormat:'^(?:)\\/(?:)(.+)(?:)\\/(?:)(.*)?(?:)\\/(?:)([gimuy]*)?(?:)$',valueFormatFlags:'i'}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1}},{shared:[{name:'webrtc',aliases:null,description:'The rule applies only to WebRTC connections.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#webrtc-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:true,removalMessage:'This modifier is removed and is no longer supported.\nRules with it are considered as invalid. If you need to suppress WebRTC, consider using\nthe [nowebrtc scriptlet](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#nowebrtc).',conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'webrtc',aliases:null,description:'The rule applies only to WebRTC connections.',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:true,removalMessage:'This modifier is removed and is no longer supported.\nIf you need to suppress WebRTC, consider using\nthe [nowebrtc scriptlet](https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-).',conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'webrtc',aliases:null,description:'The rule applies only to WebRTC connections.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:'1.13.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#websocket-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#websocket-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#websocket-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#websocket-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'websocket',aliases:null,description:'The rule applies only to WebSocket connections.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':1,'16':1,'32':1,'64':1,'256':2,'512':3,'1024':4,'2048':4,'4096':4,'8192':4,'16384':5,'32768':5,'65536':5,'131072':5}},{shared:[{name:'xmlhttprequest',aliases:['xhr'],description:'The rule applies only to ajax requests (requests sent via javascript object XMLHttpRequest).',docs:'https://adguard.app/kb/general/ad-filtering/create-own-filters/#xmlhttprequest-modifier',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'xhr',aliases:['xmlhttprequest'],description:'The rule applies only to ajax requests (requests sent via javascript object XMLHttpRequest).',docs:'https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#xhr',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null},{name:'xmlhttprequest',aliases:null,description:'The rule applies only to ajax requests (requests sent via javascript object XMLHttpRequest).',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#type-options',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,conflicts:null,inverseConflicts:false,assignable:false,negatable:true,blockOnly:false,exceptionOnly:false,valueOptional:false,valueOptionalExceptionOnly:false,valueFormat:null,valueFormatFlags:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'128':0,'256':0,'512':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}}],map:{all:0,app:1,badfilter:2,cname:3,content:4,cookie:5,csp:6,denyallow:7,document:8,doc:8,domain:9,from:9,elemhide:10,ehide:10,empty:11,extension:12,'first-party':13,'1p':13,'~third-party':13,font:14,genericblock:15,generichide:16,ghide:16,header:17,hls:18,image:19,important:20,'inline-font':21,'inline-script':22,jsinject:23,jsonprune:24,'match-case':25,media:26,method:27,mp4:28,network:29,_:30,'object-subrequest':31,object:32,other:33,permissions:34,ping:35,popunder:36,popup:37,'redirect-rule':38,redirect:39,rewrite:39,referrerpolicy:40,removeheader:41,removeparam:42,replace:43,script:44,specifichide:45,shide:45,stealth:46,strict1p:47,strict3p:48,stylesheet:49,css:49,subdocument:50,frame:50,'third-party':51,'3p':51,to:52,urlblock:53,urltransform:54,webrtc:55,websocket:56,xmlhttprequest:57,xhr:57}};
const redirectsCompatibilityTableData = {shared:[{shared:[{name:'1x1-transparent.gif',aliases:['1x1.gif','1x1-transparent-gif'],description:'Redirects to a 1x1 transparent GIF.',docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#1x1-transparent.gif',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'1x1.gif',aliases:null,description:'Redirects to a 1x1 transparent GIF.',docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#available-empty-redirect-resources',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['image']},{name:'1x1-transparent-gif',aliases:null,description:'Redirects to a 1x1 transparent GIF.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'2x2-transparent.png',aliases:['2x2.png','2x2-transparent-png'],description:'Redirects to a 2x2 transparent PNG.',docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#2x2-transparent.png',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'2x2.png',aliases:null,description:'Redirects to a 2x2 transparent PNG.',docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#available-empty-redirect-resources',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['image']},{name:'2x2-transparent-png',aliases:null,description:'Redirects to a 2x2 transparent PNG.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'32x32-transparent.png',aliases:['32x32.png','32x32-transparent-png'],description:'Redirects to a 32x32 transparent PNG.',docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#32x32-transparent.png',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'32x32.png',aliases:null,description:'Redirects to a 32x32 transparent PNG.',docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#available-empty-redirect-resources',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['image']},{name:'32x32-transparent-png',aliases:null,description:'Redirects to a 32x32 transparent PNG.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'3x2-transparent.png',aliases:['3x2.png','3x2-transparent-png'],description:'Redirects to a 3x2 transparent PNG.',docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#3x2-transparent.png',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'3x2.png',aliases:null,description:'Redirects to a 3x2 transparent PNG.',docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#available-empty-redirect-resources',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['image']},{name:'3x2-transparent-png',aliases:null,description:'Redirects to a 3x2 transparent PNG.',docs:'https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'amazon-apstag',aliases:['ubo-amazon_apstag.js','amazon_apstag.js'],description:'Mocks Amazon\'s apstag.js',docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#amazon-apstag',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'amazon_apstag.js',aliases:null,description:'Mocks Amazon\'s apstag.js',docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#amazon_apstagjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'amazon_ads.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'ampproject_v0.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'ati-smarttag',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'chartbeat.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'click2load.html',aliases:['click2load.html','ubo-click2load.html'],description:'Redirects resource and replaces supposed content by decoy frame with button for original content recovering.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:true,resourceTypes:[]},{name:'click2load.html',aliases:null,description:'Redirects resource and replaces supposed content by decoy frame with button for original content recovering.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:true,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'didomi-loader',aliases:null,description:'Mocks Didomi\'s CMP loader script.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'empty',aliases:null,description:'Redirects to an empty file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'empty',aliases:null,description:'Redirects to an empty file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'fingerprintjs2',aliases:['fingerprint2.js'],description:'Mocks FingerprintJS2 script.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'fingerprint2.js',aliases:null,description:'Mocks FingerprintJS2 script.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'fingerprintjs3',aliases:['fingerprint3.js'],description:'Mocks FingerprintJS v3.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'fingerprint3.js',aliases:null,description:'Mocks FingerprintJS v3.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'gemius',aliases:null,description:'Mocks Gemius Analytics.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'google-analytics-ga',aliases:['ubo-google-analytics_ga.js','google-analytics_ga.js'],description:'Mocks old Google Analytics API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'google-analytics_ga.js',aliases:null,description:'Mocks old Google Analytics API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'google-analytics',aliases:['ubo-google-analytics_analytics.js','google-analytics_analytics.js','googletagmanager-gtm','ubo-googletagmanager_gtm.js','googletagmanager_gtm.js'],description:'Mocks Google\'s Analytics and Tag Manager APIs.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'google-analytics_analytics.js',aliases:null,description:'Mocks Google\'s Analytics and Tag Manager APIs.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'google-analytics_cx_api.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'google-analytics_inpage_linkid.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'google-ima3',aliases:['ubo-google-ima.js','google-ima.js'],description:'Mocks the IMA SDK of Google.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'google-ima.js',aliases:null,description:'Mocks the IMA SDK of Google.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'googlesyndication-adsbygoogle',aliases:['ubo-googlesyndication_adsbygoogle.js','ubo-googlesyndication.com/adsbygoogle.js','googlesyndication_adsbygoogle.js','googlesyndication.com/adsbygoogle.js'],description:'Mocks Google AdSense API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'googlesyndication_adsbygoogle.js',aliases:['googlesyndication.com/adsbygoogle.js'],description:'Mocks Google AdSense API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'googletagservices-gpt',aliases:['ubo-googletagservices_gpt.js','googletagservices_gpt.js'],description:'Mocks Google Publisher Tag API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'googletagservices_gpt.js',aliases:null,description:'Mocks Google Publisher Tag API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'hd-main.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'matomo',aliases:null,description:'Mocks the piwik.js file of Matomo (formerly Piwik).',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'metrika-yandex-tag',aliases:null,description:'Mocks Yandex Metrika API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'metrika-yandex-watch',aliases:null,description:'Mocks the old Yandex Metrika API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'naver-wcslog',aliases:null,description:'Mocks wcslog.js of Naver Analytics.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'no-protected-audience',aliases:null,description:'Prevents using the Protected Audience API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'no-topics',aliases:null,description:'Prevents using the Topics API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'noeval',aliases:['noeval.js','silent-noeval.js','ubo-noeval.js','ubo-silent-noeval.js','ubo-noeval','ubo-silent-noeval'],description:'Prevents page to use eval.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noeval.js',aliases:null,description:'Prevents page to use eval.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'noop-0.5s.mp3',aliases:null,description:'Redirects to an empty MP3 file with a duration of 0.5 seconds.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['media']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'noopcss',aliases:['noop.css','blank-css'],description:'Redirects to an empty CSS file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop.css',aliases:null,description:'Redirects to an empty CSS file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['stylesheet']},{name:'blank-css',aliases:null,description:'Redirects to an empty CSS file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'noopframe',aliases:['noop.html','blank-html'],description:'Redirects to an empty HTML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop.html',aliases:null,description:'Redirects to an empty HTML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['sub_frame']},{name:'blank-html',aliases:null,description:'Redirects to an empty HTML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'noopjs',aliases:['noop.js','blank-js'],description:'Redirects to an empty JavaScript file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop.js',aliases:null,description:'Redirects to an empty JavaScript file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']},{name:'blank-js',aliases:null,description:'Redirects to an empty JavaScript file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'noopjson',aliases:['noop.json'],description:'Redirects to an empty JSON file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop.json',aliases:null,description:'Redirects to an empty JSON file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'noopmp3-0.1s',aliases:['noop-0.1s.mp3','blank-mp3'],description:'Redirects to an empty MP3 file with a duration of 0.1 seconds.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop-0.1s.mp3',aliases:null,description:'Redirects to an empty MP3 file with a duration of 0.1 seconds.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['media']},{name:'blank-mp3',aliases:null,description:'Redirects to an empty MP3 file with a duration of 0.1 seconds.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'noopmp4-1s',aliases:['noop-1s.mp4','blank-mp4'],description:'Redirects to an empty MP4 file with a duration of 1 second.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop-1s.mp4',aliases:null,description:'Redirects to an empty MP4 file with a duration of 1 second.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['media']},{name:'blank-mp4',aliases:null,description:'Redirects to an empty MP4 file with a duration of 1 second.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'nooptext',aliases:['noop.txt','blank-text'],description:'Redirects to an empty text file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop.txt',aliases:null,description:'Redirects to an empty text file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['image','media','sub_frame','stylesheet','script','xmlhttprequest','other']},{name:'blank-text',aliases:null,description:'Redirects to an empty text file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'noopvast-2.0',aliases:null,description:'Redirects to an empty VAST 2.0 XML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'noopvast-3.0',aliases:null,description:'Redirects to an empty VAST 3.0 XML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'noopvast-4.0',aliases:null,description:'Redirects to an empty VAST 4.0 XML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'noopvmap-1.0',aliases:['noop-vmap1.0.xml'],description:'Redirects to an empty VMAP 1.0 XML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'noop-vmap1.0.xml',aliases:null,description:'Redirects to an empty VMAP 1.0 XML file.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['media']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'nowebrtc',aliases:['nowebrtc.js','ubo-nowebrtc.js','ubo-nowebrtc'],description:'Disables WebRTC by overriding `RTCPeerConnection`.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'nowebrtc.js',aliases:null,description:'Disables WebRTC by overriding `RTCPeerConnection`.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['other']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'outbrain-widget.js',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1024':0,'2048':0,'4096':0,'8192':0}},{shared:[{name:'pardot-1.0',aliases:null,description:'Mocks the pd.js file of Salesforce.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prebid-ads',aliases:['prebid-ads.js'],description:'Mocks prebid-ads.js script.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'prebid-ads.js',aliases:null,description:'Mocks prebid-ads.js script.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prebid',aliases:null,description:'Mocks the prebid.js header bidding suit.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prevent-bab',aliases:['nobab.js'],description:'Prevents BlockAdblock script from detecting an ad blocker.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'nobab.js',aliases:null,description:'Prevents BlockAdblock script from detecting an ad blocker.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-bab2',aliases:['nobab2.js'],description:'Prevents BlockAdblock script from detecting an ad blocker.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'nobab2.js',aliases:null,description:'Prevents BlockAdblock script from detecting an ad blocker.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-fab-3.2.0',aliases:['nofab.js'],description:'Mocks FAB script v3.2.0.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'nofab.js',aliases:['fuckadblock.js-3.2.0','fuckadblock.js-3.2.0.js'],description:'Mocks FAB script v3.2.0.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-popads-net',aliases:['popads.js'],description:'Aborts on property write (PopAds, popns), throws reference error with random id.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'popads.js',aliases:null,description:'Aborts on property write (PopAds, popns), throws reference error with random id.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'scorecardresearch-beacon',aliases:['scorecardresearch_beacon.js'],description:'Mocks Scorecard Research API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'scorecardresearch_beacon.js',aliases:null,description:'Mocks Scorecard Research API.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'set-popads-dummy',aliases:['popads-dummy.js'],description:'Sets static properties PopAds and popns.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:[]},{name:'popads-dummy.js',aliases:null,description:'Sets static properties PopAds and popns.',docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,isBlocking:false,resourceTypes:['script']}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}}],map:{'1x1-transparent.gif':0,'1x1.gif':0,'1x1-transparent-gif':0,'2x2-transparent.png':1,'2x2.png':1,'2x2-transparent-png':1,'32x32-transparent.png':2,'32x32.png':2,'32x32-transparent-png':2,'3x2-transparent.png':3,'3x2.png':3,'3x2-transparent-png':3,'amazon-apstag':4,'ubo-amazon_apstag.js':4,'amazon_apstag.js':4,'amazon_ads.js':5,'ampproject_v0.js':6,'ati-smarttag':7,'chartbeat.js':8,'click2load.html':9,'ubo-click2load.html':9,'didomi-loader':10,empty:11,fingerprintjs2:12,'fingerprint2.js':12,fingerprintjs3:13,'fingerprint3.js':13,gemius:14,'google-analytics-ga':15,'ubo-google-analytics_ga.js':15,'google-analytics_ga.js':15,'google-analytics':16,'ubo-google-analytics_analytics.js':16,'google-analytics_analytics.js':16,'googletagmanager-gtm':16,'ubo-googletagmanager_gtm.js':16,'googletagmanager_gtm.js':16,'google-analytics_cx_api.js':17,'google-analytics_inpage_linkid.js':18,'google-ima3':19,'ubo-google-ima.js':19,'google-ima.js':19,'googlesyndication-adsbygoogle':20,'ubo-googlesyndication_adsbygoogle.js':20,'ubo-googlesyndication.com/adsbygoogle.js':20,'googlesyndication_adsbygoogle.js':20,'googlesyndication.com/adsbygoogle.js':20,'googletagservices-gpt':21,'ubo-googletagservices_gpt.js':21,'googletagservices_gpt.js':21,'hd-main.js':22,matomo:23,'metrika-yandex-tag':24,'metrika-yandex-watch':25,'naver-wcslog':26,'no-protected-audience':27,'no-topics':28,noeval:29,'noeval.js':29,'silent-noeval.js':29,'ubo-noeval.js':29,'ubo-silent-noeval.js':29,'ubo-noeval':29,'ubo-silent-noeval':29,'noop-0.5s.mp3':30,noopcss:31,'noop.css':31,'blank-css':31,noopframe:32,'noop.html':32,'blank-html':32,noopjs:33,'noop.js':33,'blank-js':33,noopjson:34,'noop.json':34,'noopmp3-0.1s':35,'noop-0.1s.mp3':35,'blank-mp3':35,'noopmp4-1s':36,'noop-1s.mp4':36,'blank-mp4':36,nooptext:37,'noop.txt':37,'blank-text':37,'noopvast-2.0':38,'noopvast-3.0':39,'noopvast-4.0':40,'noopvmap-1.0':41,'noop-vmap1.0.xml':41,nowebrtc:42,'nowebrtc.js':42,'ubo-nowebrtc.js':42,'ubo-nowebrtc':42,'outbrain-widget.js':43,'pardot-1.0':44,'prebid-ads':45,'prebid-ads.js':45,prebid:46,'prevent-bab':47,'nobab.js':47,'prevent-bab2':48,'nobab2.js':48,'prevent-fab-3.2.0':49,'nofab.js':49,'fuckadblock.js-3.2.0':49,'fuckadblock.js-3.2.0.js':49,'prevent-popads-net':50,'popads.js':50,'scorecardresearch-beacon':51,'scorecardresearch_beacon.js':51,'set-popads-dummy':52,'popads-dummy.js':52}};
const scriptletsCompatibilityTableData = {shared:[{shared:[{name:'abort-current-inline-script',aliases:['abort-current-script.js','ubo-abort-current-script.js','acs.js','ubo-acs.js','ubo-abort-current-script','ubo-acs','abort-current-inline-script.js','ubo-abort-current-inline-script.js','acis.js','ubo-acis.js','ubo-abort-current-inline-script','ubo-acis','abp-abort-current-inline-script'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#abort-current-inline-script',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-current-script.js',aliases:['acs.js','abort-current-inline-script.js','acis.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-current-scriptjs-',versionAdded:'1.37.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-current-inline-script',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.4.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'api',required:true,description:null,pattern:null,'default':null,debug:false},{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'abort-on-property-read',aliases:['abort-on-property-read.js','ubo-abort-on-property-read.js','aopr.js','ubo-aopr.js','ubo-abort-on-property-read','ubo-aopr','abp-abort-on-property-read'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#abort-on-property-read',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-on-property-read.js',aliases:['aopr.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-on-property-read',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.4.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'setConfigurable',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'abort-on-property-write',aliases:['abort-on-property-write.js','ubo-abort-on-property-write.js','aopw.js','ubo-aopw.js','ubo-abort-on-property-write','ubo-aopw','abp-abort-on-property-write'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#abort-on-property-write',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-on-property-write.js',aliases:['aopw.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-on-property-write',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.4.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'setConfigurable',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'abort-on-stack-trace',aliases:['abort-on-stack-trace.js','ubo-abort-on-stack-trace.js','aost.js','ubo-aost.js','ubo-abort-on-stack-trace','ubo-aost','abp-abort-on-stack-trace'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#abort-on-stack-trace',versionAdded:'1.5.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'abort-on-stack-trace.js',aliases:['aost.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-stack-tracejs-',versionAdded:'1.29.3rc9',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'adjust-setInterval',aliases:['nano-setInterval-booster.js','ubo-nano-setInterval-booster.js','nano-sib.js','ubo-nano-sib.js','adjust-setInterval.js','ubo-adjust-setInterval.js','ubo-nano-setInterval-booster','ubo-nano-sib','ubo-adjust-setInterval'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#adjust-setInterval',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'boost',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'adjust-setInterval.js',aliases:['nano-setInterval-booster.js','nano-sib.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#adjust-setIntervaljs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'boost',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'adjust-setTimeout',aliases:['adjust-setTimeout.js','ubo-adjust-setTimeout.js','nano-setTimeout-booster.js','ubo-nano-setTimeout-booster.js','nano-stb.js','ubo-nano-stb.js','ubo-adjust-setTimeout','ubo-nano-setTimeout-booster','ubo-nano-stb'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#adjust-setTimeout',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'boost',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'adjust-setTimeout.js',aliases:['nano-setTimeout-booster.js','nano-stb.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#adjust-setTimeoutjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'boost',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'amazon-apstag',aliases:['ubo-amazon_apstag.js','amazon_apstag.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#amazon-apstag',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'call-nothrow',aliases:['call-nothrow.js','ubo-call-nothrow.js','ubo-call-nothrow'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#call-nothrow',versionAdded:'1.10.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'functionName',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'call-nothrow.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#call-nothrowjs-',versionAdded:'1.48.1b0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'functionName',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'close-window',aliases:['window-close-if.js','ubo-window-close-if.js','ubo-window-close-if','close-window.js','ubo-close-window.js','ubo-close-window'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#close-window',versionAdded:'1.5.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'path',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'close-window.js',aliases:['window-close-if.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#close-windowjs-',versionAdded:'1.39.3b10',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'path',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'debug-current-inline-script',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#debug-current-inline-script',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'debug-on-property-read',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#debug-on-property-read',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'debug-on-property-write',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#debug-on-property-write',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'didomi-loader',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#didomi-loader',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'dir-string',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#dir-string',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'times',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'disable-newtab-links',aliases:['disable-newtab-links.js','ubo-disable-newtab-links.js','ubo-disable-newtab-links'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#disable-newtab-links',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null},{name:'disable-newtab-links.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'evaldata-prune',aliases:['evaldata-prune.js','ubo-evaldata-prune.js','ubo-evaldata-prune'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#evaldata-prune',versionAdded:'1.9.37',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'evaldata-prune.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#evaldata-prunejs-',versionAdded:'1.49.3rc15',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'fingerprintjs2',aliases:['ubo-fingerprint2.js','fingerprint2.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#fingerprintjs2',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'fingerprintjs3',aliases:['ubo-fingerprint3.js','fingerprint3.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#fingerprintjs3',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'gemius',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#gemius',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'google-analytics-ga',aliases:['ubo-google-analytics_ga.js','google-analytics_ga.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#google-analytics-ga',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'google-analytics',aliases:['ubo-google-analytics_analytics.js','google-analytics_analytics.js','googletagmanager-gtm','ubo-googletagmanager_gtm.js','googletagmanager_gtm.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#google-analytics',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'google-ima3',aliases:['ubo-google-ima.js','google-ima.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#google-ima3',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null},{name:'google-ima.js',aliases:['google-ima3'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#google-imajs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'googlesyndication-adsbygoogle',aliases:['ubo-googlesyndication_adsbygoogle.js','googlesyndication_adsbygoogle.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#googlesyndication-adsbygoogle',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'googletagservices-gpt',aliases:['ubo-googletagservices_gpt.js','googletagservices_gpt.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#googletagservices-gpt',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'hide-in-shadow-dom',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#hide-in-shadow-dom',versionAdded:'1.3.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'baseSelector',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'href-sanitizer',aliases:['href-sanitizer.js','ubo-href-sanitizer.js','ubo-href-sanitizer'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#href-sanitizer',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attribute',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'href-sanitizer.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#href-sanitizerjs-',versionAdded:'1.47.5b4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attribute',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'inject-css-in-shadow-dom',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#inject-css-in-shadow-dom',versionAdded:'1.8.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'cssRule',required:true,description:null,pattern:null,'default':null,debug:false},{name:'hostSelector',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'json-prune-fetch-response',aliases:['json-prune-fetch-response.js','ubo-json-prune-fetch-response.js','ubo-json-prune-fetch-response'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#json-prune-fetch-response',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'json-prune-fetch-response.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#json-prune-fetch-responsejs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'json-prune-xhr-response',aliases:['json-prune-xhr-response.js','ubo-json-prune-xhr-response.js','ubo-json-prune-xhr-response'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#json-prune-xhr-response',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'json-prune-xhr-response.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#json-prune-xhr-responsejs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'json-prune',aliases:['json-prune.js','ubo-json-prune.js','ubo-json-prune','abp-json-prune'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#json-prune',versionAdded:'1.1.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'json-prune.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#json-prunejs-',versionAdded:'1.23.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'json-prune',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.9.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'rawPrunePaths',required:true,description:null,pattern:null,'default':null,debug:false},{name:'rawNeedlePaths',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'log-addEventListener',aliases:['addEventListener-logger.js','ubo-addEventListener-logger.js','aell.js','ubo-aell.js','ubo-addEventListener-logger','ubo-aell'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#log-addEventListener',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'log-eval',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#log-eval',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'log-on-stack-trace',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#log-on-stack-trace',versionAdded:'1.5.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'log',aliases:['abp-log'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#log',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'arguments',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'m3u-prune',aliases:['m3u-prune.js','ubo-m3u-prune.js','ubo-m3u-prune'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#m3u-prune',versionAdded:'1.9.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'urlToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'m3u-prune.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#m3u-prunejs-',versionAdded:'1.44.5b6',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'urlToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'matomo',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#matomo',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'metrika-yandex-tag',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#metrika-yandex-tag',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'metrika-yandex-watch',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#metrika-yandex-watch',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'naver-wcslog',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#naver-wcslog',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'no-protected-audience',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#no-protected-audience',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'no-topics',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#no-topics',versionAdded:'1.6.18',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'noeval',aliases:['noeval.js','silent-noeval.js','ubo-noeval.js','ubo-silent-noeval.js','ubo-noeval','ubo-silent-noeval'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#noeval',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'nowebrtc',aliases:['nowebrtc.js','ubo-nowebrtc.js','ubo-nowebrtc'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#nowebrtc',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null},{name:'nowebrtc.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'pardot-1.0',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#pardot-1.0',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prebid',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prebid',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prevent-addEventListener',aliases:['addEventListener-defuser.js','ubo-addEventListener-defuser.js','aeld.js','ubo-aeld.js','ubo-addEventListener-defuser','ubo-aeld','abp-prevent-listener'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-addEventListener',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'typeSearch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'listenerSearch',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'addEventListener-defuser.js',aliases:['aeld.js','prevent-addEventListener.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#addEventListener-defuserjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'typeSearch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'listenerSearch',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'prevent-listener',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.11.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'type',required:true,description:null,pattern:null,'default':null,debug:false},{name:'handler',required:false,description:null,pattern:null,'default':null,debug:false},{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'prevent-adfly',aliases:['adfly-defuser.js','ubo-adfly-defuser.js','ubo-adfly-defuser'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-adfly',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prevent-bab',aliases:['nobab.js','ubo-nobab.js','bab-defuser.js','ubo-bab-defuser.js','ubo-nobab','ubo-bab-defuser'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-bab',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null},{name:'nobab',aliases:null,description:null,docs:'https://github.com/gorhill/ublock/wiki/Resources-Library#nobabjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-canvas',aliases:['prevent-canvas.js','ubo-prevent-canvas.js','ubo-prevent-canvas'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-canvas',versionAdded:'2.0.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'contextType',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'prevent-canvas.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#prevent-canvasjs-',versionAdded:'1.52.3b2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'contextType',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-element-src-loading',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-element-src-loading',versionAdded:'1.6.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'tagName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'match',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prevent-eval-if',aliases:['noeval-if.js','ubo-noeval-if.js','ubo-noeval-if'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-eval-if',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'noeval-if.js',aliases:['prevent-eval-if.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-fab-3.2.0',aliases:['nofab.js','ubo-nofab.js','fuckadblock.js-3.2.0','ubo-fuckadblock.js-3.2.0','ubo-nofab'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-fab-3.2.0',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null},{name:'nofab.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#nofabjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-fetch',aliases:['prevent-fetch.js','no-fetch-if.js','ubo-no-fetch-if.js','ubo-no-fetch-if'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-fetch',versionAdded:'1.3.18',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'responseBody',required:false,description:null,pattern:null,'default':null,debug:false},{name:'responseType',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'prevent-fetch.js',aliases:['no-fetch-if.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#prevent-fetchjs-',versionAdded:'1.31.3b9',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'responseBody',required:false,description:null,pattern:null,'default':null,debug:false},{name:'responseType',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-innerHTML',aliases:['prevent-innerHTML.js','no-innerHTML-if.js','ubo-no-innerHTML-if.js','ubo-no-innerHTML-if'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-innerHTML',versionAdded:'2.2.14',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'pattern',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'prevent-innerHTML.js',aliases:['no-innerHTML-if.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#prevent-innerHTMLjs-',versionAdded:'1.63.1b0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'pattern',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-popads-net',aliases:['popads.net.js','ubo-popads.net.js','ubo-popads.net'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-popads-net',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'prevent-refresh',aliases:['prevent-refresh.js','refresh-defuser.js','refresh-defuser','ubo-prevent-refresh.js','ubo-prevent-refresh','ubo-refresh-defuser.js','ubo-refresh-defuser'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-refresh',versionAdded:'1.6.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'delay',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'prevent-refresh.js',aliases:['refresh-defuser.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#prevent-refreshjs-',versionAdded:'1.38.7b3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'delay',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-requestAnimationFrame',aliases:['no-requestAnimationFrame-if.js','ubo-no-requestAnimationFrame-if.js','norafif.js','ubo-norafif.js','ubo-no-requestAnimationFrame-if','ubo-norafif'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-requestAnimationFrame',versionAdded:'1.1.15',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'no-requestAnimationFrame-if.js',aliases:['norafif.js','prevent-requestAnimationFrame.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#no-requestAnimationFrame-ifjs-',versionAdded:'1.27.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'search',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-setInterval',aliases:['no-setInterval-if.js','ubo-no-setInterval-if.js','setInterval-defuser.js','ubo-setInterval-defuser.js','nosiif.js','ubo-nosiif.js','sid.js','ubo-sid.js','ubo-no-setInterval-if','ubo-setInterval-defuser','ubo-nosiif','ubo-sid'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-setInterval',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'no-setInterval-if.js',aliases:['nosiif.js','prevent-setInterval.js','setInterval-defuser.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setInterval-ifjs-',versionAdded:'1.23.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-setTimeout',aliases:['no-setTimeout-if.js','ubo-no-setTimeout-if.js','nostif.js','ubo-nostif.js','ubo-no-setTimeout-if','ubo-nostif','setTimeout-defuser.js','ubo-setTimeout-defuser.js','ubo-setTimeout-defuser','std.js','ubo-std.js','ubo-std'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-setTimeout',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'no-setTimeout-if.js',aliases:['nostif.js','prevent-setTimeout.js','setTimeout-defuser.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setTimeout-ifjs-',versionAdded:'1.23.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'matchCallback',required:false,description:null,pattern:null,'default':null,debug:false},{name:'matchDelay',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-window-open',aliases:['window.open-defuser.js','ubo-window.open-defuser.js','ubo-window.open-defuser','nowoif.js','ubo-nowoif.js','ubo-nowoif','no-window-open-if.js','ubo-no-window-open-if.js','ubo-no-window-open-if'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-window-open',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'match',required:false,description:null,pattern:null,'default':null,debug:false},{name:'delay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'replacement',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'no-window-open-if.js',aliases:['nowoif.js','prevent-window-open.js','window.open-defuser.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#no-window-open-ifjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'match',required:false,description:null,pattern:null,'default':null,debug:false},{name:'delay',required:false,description:null,pattern:null,'default':null,debug:false},{name:'replacement',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'prevent-xhr',aliases:['no-xhr-if.js','ubo-no-xhr-if.js','ubo-no-xhr-if'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#prevent-xhr',versionAdded:'1.5.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'randomize',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'no-xhr-if.js',aliases:['prevent-xhr.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#no-xhr-ifjs-',versionAdded:'1.38.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'randomize',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'remove-attr',aliases:['remove-attr.js','ubo-remove-attr.js','ra.js','ubo-ra.js','ubo-remove-attr','ubo-ra'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-attr',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'attrs',required:true,description:null,pattern:null,'default':null,debug:false},{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'applying',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'remove-attr.js',aliases:['ra.js','ra','remove-attr'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'attrs',required:true,description:null,pattern:null,'default':null,debug:false},{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'applying',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'remove-class',aliases:['remove-class.js','ubo-remove-class.js','rc.js','ubo-rc.js','ubo-remove-class','ubo-rc'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-class',versionAdded:'1.1.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'classes',required:true,description:null,pattern:null,'default':null,debug:false},{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'applying',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'remove-class.js',aliases:['rc.js','rc','remove-class'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'classes',required:true,description:null,pattern:null,'default':null,debug:false},{name:'selector',required:false,description:null,pattern:null,'default':null,debug:false},{name:'applying',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'remove-cookie',aliases:['cookie-remover.js','ubo-cookie-remover.js','ubo-cookie-remover','remove-cookie.js','ubo-remove-cookie.js','ubo-remove-cookie','abp-cookie-remover'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-cookie',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'match',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'remove-cookie.js',aliases:['cookie-remover.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-cookiejs-',versionAdded:'1.28.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'match',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'cookie-remover',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.11.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'cookie',required:true,description:null,pattern:null,'default':null,debug:false},{name:'autoRemoveCookie',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'remove-in-shadow-dom',aliases:null,description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-in-shadow-dom',versionAdded:'1.3.14',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'baseSelector',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'remove-node-text',aliases:['remove-node-text.js','ubo-remove-node-text.js','rmnt.js','ubo-rmnt.js','ubo-remove-node-text','ubo-rmnt'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-node-text',versionAdded:'1.9.37',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'nodeName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'textMatch',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'remove-node-text.js',aliases:['rmnt.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-node-textjs-',versionAdded:'1.49.3rc15',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'nodeName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'textMatch',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'scorecardresearch-beacon',aliases:['ubo-scorecardresearch_beacon.js','scorecardresearch_beacon.js'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#scorecardresearch-beacon',versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'set-attr',aliases:['set-attr.js','ubo-set-attr.js','ubo-set-attr'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-attr',versionAdded:'1.5.0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attr',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'set-attr.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-attrjs-',versionAdded:'1.50.1b16',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attr',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'set-constant',aliases:['set-constant.js','ubo-set-constant.js','set.js','ubo-set.js','ubo-set-constant','ubo-set'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-constant',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false},{name:'valueWrapper',required:false,description:null,pattern:null,'default':null,debug:false},{name:'setProxyTrap',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'set-constant.js',aliases:['set.js'],description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-constantjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'chain',required:true,description:null,pattern:null,'default':null,debug:false},{name:'rawValue',required:true,description:null,pattern:null,'default':null,debug:false},{name:'runAt',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'override-property-read',aliases:null,description:null,docs:'https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial#snippets-ref',versionAdded:'3.9.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'setConfigurable',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1,'16384':2,'32768':2,'65536':2,'131072':2}},{shared:[{name:'set-cookie-reload',aliases:['set-cookie-reload.js','ubo-set-cookie-reload.js','ubo-set-cookie-reload'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-cookie-reload',versionAdded:'1.3.14',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false},{name:'domain',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'set-cookie-reload.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-cookie-reloadjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false},{name:'domain',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'set-cookie',aliases:['set-cookie.js','ubo-set-cookie.js','ubo-set-cookie'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-cookie',versionAdded:'1.2.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'set-cookie.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-cookiejs-',versionAdded:'1.50.1b0',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'set-local-storage-item',aliases:['set-local-storage-item.js','ubo-set-local-storage-item.js','ubo-set-local-storage-item'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-local-storage-item',versionAdded:'1.4.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'key',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'set-local-storage-item.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-local-storage-itemjs-',versionAdded:'1.50.1b4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'key',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'set-popads-dummy',aliases:['popads-dummy.js','ubo-popads-dummy.js','ubo-popads-dummy'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-popads-dummy',versionAdded:'1.0.4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'set-session-storage-item',aliases:['set-session-storage-item.js','ubo-set-session-storage-item.js','ubo-set-session-storage-item'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-session-storage-item',versionAdded:'1.4.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'key',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'set-session-storage-item.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#set-session-storage-itemjs-',versionAdded:'1.50.1b4',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'key',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'spoof-css',aliases:['spoof-css.js','ubo-spoof-css.js','ubo-spoof-css'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#spoof-css',versionAdded:'1.10.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selectors',required:true,description:null,pattern:null,'default':null,debug:false},{name:'cssPropertyName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'cssPropertyValue',required:true,description:null,pattern:null,'default':null,debug:false}]},{name:'spoof-css.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#spoof-cssjs-',versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selectors',required:true,description:null,pattern:null,'default':null,debug:false},{name:'cssPropertyName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'cssPropertyValue',required:true,description:null,pattern:null,'default':null,debug:false},{name:'arguments',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}},{shared:[{name:'trusted-click-element',aliases:null,description:null,docs:null,versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selectors',required:true,description:null,pattern:null,'default':null,debug:false},{name:'extraMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'delay',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-create-element',aliases:null,description:null,docs:null,versionAdded:'1.10.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'parentSelector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'tagName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attributePairs',required:false,description:null,pattern:null,'default':null,debug:false},{name:'textContent',required:false,description:null,pattern:null,'default':null,debug:false},{name:'cleanupDelayMs',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-dispatch-event',aliases:null,description:null,docs:null,versionAdded:null,versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'event',required:true,description:null,pattern:null,'default':null,debug:false},{name:'target',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-prune-inbound-object',aliases:null,description:null,docs:null,versionAdded:'1.9.91',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'functionName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'propsToRemove',required:false,description:null,pattern:null,'default':null,debug:false},{name:'obligatoryProps',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-replace-fetch-response',aliases:null,description:null,docs:null,versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'pattern',required:false,description:null,pattern:null,'default':null,debug:false},{name:'replacement',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-replace-node-text',aliases:null,description:null,docs:null,versionAdded:'1.9.37',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'nodeName',required:true,description:null,pattern:null,'default':null,debug:false},{name:'textMatch',required:true,description:null,pattern:null,'default':null,debug:false},{name:'pattern',required:true,description:null,pattern:null,'default':null,debug:false},{name:'replacement',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-replace-xhr-response',aliases:null,description:null,docs:null,versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'pattern',required:false,description:null,pattern:null,'default':null,debug:false},{name:'replacement',required:false,description:null,pattern:null,'default':null,debug:false},{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-set-attr',aliases:null,description:null,docs:null,versionAdded:'1.10.1',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'selector',required:true,description:null,pattern:null,'default':null,debug:false},{name:'attr',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-set-constant',aliases:null,description:null,docs:null,versionAdded:'1.8.2',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'property',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-set-cookie-reload',aliases:null,description:null,docs:null,versionAdded:'1.7.10',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'offsetExpiresSec',required:false,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false},{name:'domain',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-set-cookie',aliases:null,description:null,docs:null,versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'name',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false},{name:'offsetExpiresSec',required:false,description:null,pattern:null,'default':null,debug:false},{name:'path',required:false,description:null,pattern:null,'default':null,debug:false},{name:'domain',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-set-local-storage-item',aliases:null,description:null,docs:null,versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'key',required:true,description:null,pattern:null,'default':null,debug:false},{name:'value',required:true,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'trusted-suppress-native-method',aliases:null,description:null,docs:null,versionAdded:'1.10.25',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'methodPath',required:true,description:null,pattern:null,'default':null,debug:false},{name:'signatureStr',required:true,description:null,pattern:null,'default':null,debug:false},{name:'how',required:false,description:null,pattern:null,'default':null,debug:false},{name:'stack',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0}},{shared:[{name:'xml-prune',aliases:['xml-prune.js','ubo-xml-prune.js','ubo-xml-prune'],description:null,docs:'https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#xml-prune',versionAdded:'1.7.3',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'optionalProp',required:false,description:null,pattern:null,'default':null,debug:false},{name:'urlToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]},{name:'xml-prune.js',aliases:null,description:null,docs:'https://github.com/gorhill/uBlock/wiki/Resources-Library#xml-prunejs-',versionAdded:'1.49.3rc6',versionRemoved:null,deprecated:false,deprecationMessage:null,removed:false,removalMessage:null,parameters:[{name:'propsToMatch',required:false,description:null,pattern:null,'default':null,debug:false},{name:'optionalProp',required:false,description:null,pattern:null,'default':null,debug:false},{name:'urlToMatch',required:false,description:null,pattern:null,'default':null,debug:false}]}],map:{'1':0,'2':0,'4':0,'8':0,'16':0,'32':0,'64':0,'1024':1,'2048':1,'4096':1,'8192':1}}],map:{'abort-current-inline-script':0,'abort-current-script.js':0,'ubo-abort-current-script.js':0,'acs.js':0,'ubo-acs.js':0,'ubo-abort-current-script':0,'ubo-acs':0,'abort-current-inline-script.js':0,'ubo-abort-current-inline-script.js':0,'acis.js':0,'ubo-acis.js':0,'ubo-abort-current-inline-script':0,'ubo-acis':0,'abp-abort-current-inline-script':0,'abort-on-property-read':1,'abort-on-property-read.js':1,'ubo-abort-on-property-read.js':1,'aopr.js':1,'ubo-aopr.js':1,'ubo-abort-on-property-read':1,'ubo-aopr':1,'abp-abort-on-property-read':1,'abort-on-property-write':2,'abort-on-property-write.js':2,'ubo-abort-on-property-write.js':2,'aopw.js':2,'ubo-aopw.js':2,'ubo-abort-on-property-write':2,'ubo-aopw':2,'abp-abort-on-property-write':2,'abort-on-stack-trace':3,'abort-on-stack-trace.js':3,'ubo-abort-on-stack-trace.js':3,'aost.js':3,'ubo-aost.js':3,'ubo-abort-on-stack-trace':3,'ubo-aost':3,'abp-abort-on-stack-trace':3,'adjust-setInterval':4,'nano-setInterval-booster.js':4,'ubo-nano-setInterval-booster.js':4,'nano-sib.js':4,'ubo-nano-sib.js':4,'adjust-setInterval.js':4,'ubo-adjust-setInterval.js':4,'ubo-nano-setInterval-booster':4,'ubo-nano-sib':4,'ubo-adjust-setInterval':4,'adjust-setTimeout':5,'adjust-setTimeout.js':5,'ubo-adjust-setTimeout.js':5,'nano-setTimeout-booster.js':5,'ubo-nano-setTimeout-booster.js':5,'nano-stb.js':5,'ubo-nano-stb.js':5,'ubo-adjust-setTimeout':5,'ubo-nano-setTimeout-booster':5,'ubo-nano-stb':5,'amazon-apstag':6,'ubo-amazon_apstag.js':6,'amazon_apstag.js':6,'call-nothrow':7,'call-nothrow.js':7,'ubo-call-nothrow.js':7,'ubo-call-nothrow':7,'close-window':8,'window-close-if.js':8,'ubo-window-close-if.js':8,'ubo-window-close-if':8,'close-window.js':8,'ubo-close-window.js':8,'ubo-close-window':8,'debug-current-inline-script':9,'debug-on-property-read':10,'debug-on-property-write':11,'didomi-loader':12,'dir-string':13,'disable-newtab-links':14,'disable-newtab-links.js':14,'ubo-disable-newtab-links.js':14,'ubo-disable-newtab-links':14,'evaldata-prune':15,'evaldata-prune.js':15,'ubo-evaldata-prune.js':15,'ubo-evaldata-prune':15,fingerprintjs2:16,'ubo-fingerprint2.js':16,'fingerprint2.js':16,fingerprintjs3:17,'ubo-fingerprint3.js':17,'fingerprint3.js':17,gemius:18,'google-analytics-ga':19,'ubo-google-analytics_ga.js':19,'google-analytics_ga.js':19,'google-analytics':20,'ubo-google-analytics_analytics.js':20,'google-analytics_analytics.js':20,'googletagmanager-gtm':20,'ubo-googletagmanager_gtm.js':20,'googletagmanager_gtm.js':20,'google-ima3':21,'ubo-google-ima.js':21,'google-ima.js':21,'googlesyndication-adsbygoogle':22,'ubo-googlesyndication_adsbygoogle.js':22,'googlesyndication_adsbygoogle.js':22,'googletagservices-gpt':23,'ubo-googletagservices_gpt.js':23,'googletagservices_gpt.js':23,'hide-in-shadow-dom':24,'href-sanitizer':25,'href-sanitizer.js':25,'ubo-href-sanitizer.js':25,'ubo-href-sanitizer':25,'inject-css-in-shadow-dom':26,'json-prune-fetch-response':27,'json-prune-fetch-response.js':27,'ubo-json-prune-fetch-response.js':27,'ubo-json-prune-fetch-response':27,'json-prune-xhr-response':28,'json-prune-xhr-response.js':28,'ubo-json-prune-xhr-response.js':28,'ubo-json-prune-xhr-response':28,'json-prune':29,'json-prune.js':29,'ubo-json-prune.js':29,'ubo-json-prune':29,'abp-json-prune':29,'log-addEventListener':30,'addEventListener-logger.js':30,'ubo-addEventListener-logger.js':30,'aell.js':30,'ubo-aell.js':30,'ubo-addEventListener-logger':30,'ubo-aell':30,'log-eval':31,'log-on-stack-trace':32,log:33,'abp-log':33,'m3u-prune':34,'m3u-prune.js':34,'ubo-m3u-prune.js':34,'ubo-m3u-prune':34,matomo:35,'metrika-yandex-tag':36,'metrika-yandex-watch':37,'naver-wcslog':38,'no-protected-audience':39,'no-topics':40,noeval:41,'noeval.js':41,'silent-noeval.js':41,'ubo-noeval.js':41,'ubo-silent-noeval.js':41,'ubo-noeval':41,'ubo-silent-noeval':41,nowebrtc:42,'nowebrtc.js':42,'ubo-nowebrtc.js':42,'ubo-nowebrtc':42,'pardot-1.0':43,prebid:44,'prevent-addEventListener':45,'addEventListener-defuser.js':45,'ubo-addEventListener-defuser.js':45,'aeld.js':45,'ubo-aeld.js':45,'ubo-addEventListener-defuser':45,'ubo-aeld':45,'abp-prevent-listener':45,'prevent-addEventListener.js':45,'prevent-listener':45,'prevent-adfly':46,'adfly-defuser.js':46,'ubo-adfly-defuser.js':46,'ubo-adfly-defuser':46,'prevent-bab':47,'nobab.js':47,'ubo-nobab.js':47,'bab-defuser.js':47,'ubo-bab-defuser.js':47,'ubo-nobab':47,'ubo-bab-defuser':47,nobab:47,'prevent-canvas':48,'prevent-canvas.js':48,'ubo-prevent-canvas.js':48,'ubo-prevent-canvas':48,'prevent-element-src-loading':49,'prevent-eval-if':50,'noeval-if.js':50,'ubo-noeval-if.js':50,'ubo-noeval-if':50,'prevent-eval-if.js':50,'prevent-fab-3.2.0':51,'nofab.js':51,'ubo-nofab.js':51,'fuckadblock.js-3.2.0':51,'ubo-fuckadblock.js-3.2.0':51,'ubo-nofab':51,'prevent-fetch':52,'prevent-fetch.js':52,'no-fetch-if.js':52,'ubo-no-fetch-if.js':52,'ubo-no-fetch-if':52,'prevent-innerHTML':53,'prevent-innerHTML.js':53,'no-innerHTML-if.js':53,'ubo-no-innerHTML-if.js':53,'ubo-no-innerHTML-if':53,'prevent-popads-net':54,'popads.net.js':54,'ubo-popads.net.js':54,'ubo-popads.net':54,'prevent-refresh':55,'prevent-refresh.js':55,'refresh-defuser.js':55,'refresh-defuser':55,'ubo-prevent-refresh.js':55,'ubo-prevent-refresh':55,'ubo-refresh-defuser.js':55,'ubo-refresh-defuser':55,'prevent-requestAnimationFrame':56,'no-requestAnimationFrame-if.js':56,'ubo-no-requestAnimationFrame-if.js':56,'norafif.js':56,'ubo-norafif.js':56,'ubo-no-requestAnimationFrame-if':56,'ubo-norafif':56,'prevent-requestAnimationFrame.js':56,'prevent-setInterval':57,'no-setInterval-if.js':57,'ubo-no-setInterval-if.js':57,'setInterval-defuser.js':57,'ubo-setInterval-defuser.js':57,'nosiif.js':57,'ubo-nosiif.js':57,'sid.js':57,'ubo-sid.js':57,'ubo-no-setInterval-if':57,'ubo-setInterval-defuser':57,'ubo-nosiif':57,'ubo-sid':57,'prevent-setInterval.js':57,'prevent-setTimeout':58,'no-setTimeout-if.js':58,'ubo-no-setTimeout-if.js':58,'nostif.js':58,'ubo-nostif.js':58,'ubo-no-setTimeout-if':58,'ubo-nostif':58,'setTimeout-defuser.js':58,'ubo-setTimeout-defuser.js':58,'ubo-setTimeout-defuser':58,'std.js':58,'ubo-std.js':58,'ubo-std':58,'prevent-setTimeout.js':58,'prevent-window-open':59,'window.open-defuser.js':59,'ubo-window.open-defuser.js':59,'ubo-window.open-defuser':59,'nowoif.js':59,'ubo-nowoif.js':59,'ubo-nowoif':59,'no-window-open-if.js':59,'ubo-no-window-open-if.js':59,'ubo-no-window-open-if':59,'prevent-window-open.js':59,'prevent-xhr':60,'no-xhr-if.js':60,'ubo-no-xhr-if.js':60,'ubo-no-xhr-if':60,'prevent-xhr.js':60,'remove-attr':61,'remove-attr.js':61,'ubo-remove-attr.js':61,'ra.js':61,'ubo-ra.js':61,'ubo-remove-attr':61,'ubo-ra':61,ra:61,'remove-class':62,'remove-class.js':62,'ubo-remove-class.js':62,'rc.js':62,'ubo-rc.js':62,'ubo-remove-class':62,'ubo-rc':62,rc:62,'remove-cookie':63,'cookie-remover.js':63,'ubo-cookie-remover.js':63,'ubo-cookie-remover':63,'remove-cookie.js':63,'ubo-remove-cookie.js':63,'ubo-remove-cookie':63,'abp-cookie-remover':63,'cookie-remover':63,'remove-in-shadow-dom':64,'remove-node-text':65,'remove-node-text.js':65,'ubo-remove-node-text.js':65,'rmnt.js':65,'ubo-rmnt.js':65,'ubo-remove-node-text':65,'ubo-rmnt':65,'scorecardresearch-beacon':66,'ubo-scorecardresearch_beacon.js':66,'scorecardresearch_beacon.js':66,'set-attr':67,'set-attr.js':67,'ubo-set-attr.js':67,'ubo-set-attr':67,'set-constant':68,'set-constant.js':68,'ubo-set-constant.js':68,'set.js':68,'ubo-set.js':68,'ubo-set-constant':68,'ubo-set':68,'override-property-read':68,'set-cookie-reload':69,'set-cookie-reload.js':69,'ubo-set-cookie-reload.js':69,'ubo-set-cookie-reload':69,'set-cookie':70,'set-cookie.js':70,'ubo-set-cookie.js':70,'ubo-set-cookie':70,'set-local-storage-item':71,'set-local-storage-item.js':71,'ubo-set-local-storage-item.js':71,'ubo-set-local-storage-item':71,'set-popads-dummy':72,'popads-dummy.js':72,'ubo-popads-dummy.js':72,'ubo-popads-dummy':72,'set-session-storage-item':73,'set-session-storage-item.js':73,'ubo-set-session-storage-item.js':73,'ubo-set-session-storage-item':73,'spoof-css':74,'spoof-css.js':74,'ubo-spoof-css.js':74,'ubo-spoof-css':74,'trusted-click-element':75,'trusted-create-element':76,'trusted-dispatch-event':77,'trusted-prune-inbound-object':78,'trusted-replace-fetch-response':79,'trusted-replace-node-text':80,'trusted-replace-xhr-response':81,'trusted-set-attr':82,'trusted-set-constant':83,'trusted-set-cookie-reload':84,'trusted-set-cookie':85,'trusted-set-local-storage-item':86,'trusted-suppress-native-method':87,'xml-prune':88,'xml-prune.js':88,'ubo-xml-prune.js':88,'ubo-xml-prune':88}};
},
6674(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: () => (/* binding */ modifiersCompatibilityTable)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/deep-freeze.js
var deep_freeze = __webpack_require__(41666);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/noop-modifier.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Validates the noop modifier (i.e. only underscores).
*
* @param value Value of the modifier.
*
* @returns True if the modifier is valid, false otherwise.
*/
const isValidNoopModifier = (value) => {
const { length } = value;
if (length === 0) {
return false;
}
for (let i = 0; i < length; i += 1) {
if (value[i] !== constants/* .UNDERSCORE */.fB) {
return false;
}
}
return true;
};
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/base.js + 1 modules
var base = __webpack_require__(21565);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/compatibility-table-data.js
var compatibility_table_data = __webpack_require__(33017);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/modifiers.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Compatibility tables for modifiers.
*/
/**
* Transforms the name of the modifier to a normalized form.
* This is a special case: the noop modifier normally '_', but it can consist of any number of characters,
* e.g. '____' is also valid. In this case, we need to normalize the name to '_'.
*
* @param name Modifier name to normalize.
*
* @returns Normalized modifier name.
*/
const noopModifierNameNormalizer = (name) => {
if (name.startsWith(constants/* .UNDERSCORE */.fB)) {
if (isValidNoopModifier(name)) {
// in compatibility tables, we just store '_', so we need to reduce the number of underscores to 1
// before checking the existence of the noop modifier
return constants/* .UNDERSCORE */.fB;
}
}
return name;
};
/**
* Compatibility table for modifiers.
*/
class ModifiersCompatibilityTable extends base/* .CompatibilityTableBase */.E {
/**
* Creates a new instance of the compatibility table for modifiers.
*
* @param data Compatibility table data.
*/
constructor(data) {
super(data, noopModifierNameNormalizer);
}
}
/**
* Deep freeze the compatibility table data to avoid accidental modifications.
*/
(0,deep_freeze/* .deepFreeze */.o)(compatibility_table_data/* .modifiersCompatibilityTableData */.rd);
/**
* Compatibility table instance for modifiers.
*/
const modifiersCompatibilityTable = new ModifiersCompatibilityTable(compatibility_table_data/* .modifiersCompatibilityTableData */.rd);
},
9257(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
c: () => (SpecificPlatform),
p: () => (GenericPlatform)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-bitwise */
/**
* @file Provides platform enums.
* The difference between specific and generic platforms is that specific platforms are individual platforms
* (e.g. AdGuard for Windows, AdGuard for Android, etc.),
* while generic platforms are groups of specific platforms
* (e.g. AdGuard for any OS, AdGuard for any Chromium-based extension, etc.).
*/
/**
* List of specific platforms.
*/
// eslint-disable-next-line @typescript-eslint/no-redeclare
const SpecificPlatform = {
AdgOsWindows: 1,
AdgOsMac: (1 << 1),
AdgOsAndroid: (1 << 2),
AdgExtChrome: (1 << 3),
AdgExtOpera: (1 << 4),
AdgExtEdge: (1 << 5),
AdgExtFirefox: (1 << 6),
AdgCbAndroid: (1 << 7),
AdgCbIos: (1 << 8),
AdgCbSafari: (1 << 9),
UboExtChrome: (1 << 10),
UboExtOpera: (1 << 11),
UboExtEdge: (1 << 12),
UboExtFirefox: (1 << 13),
AbpExtChrome: (1 << 14),
AbpExtOpera: (1 << 15),
AbpExtEdge: (1 << 16),
AbpExtFirefox: (1 << 17),
};
const AdgOsAny = SpecificPlatform.AdgOsWindows
| SpecificPlatform.AdgOsMac
| SpecificPlatform.AdgOsAndroid;
const AdgSafariAny = SpecificPlatform.AdgCbSafari | SpecificPlatform.AdgCbIos;
const AdgExtChromium = SpecificPlatform.AdgExtChrome
| SpecificPlatform.AdgExtOpera
| SpecificPlatform.AdgExtEdge;
const AdgExtAny = AdgExtChromium | SpecificPlatform.AdgExtFirefox;
const AdgAny = AdgExtAny | AdgOsAny | AdgSafariAny | SpecificPlatform.AdgCbAndroid;
const UboExtChromium = SpecificPlatform.UboExtChrome
| SpecificPlatform.UboExtOpera
| SpecificPlatform.UboExtEdge;
const UboExtAny = UboExtChromium | SpecificPlatform.UboExtFirefox;
const UboAny = UboExtAny;
const AbpExtChromium = SpecificPlatform.AbpExtChrome
| SpecificPlatform.AbpExtOpera
| SpecificPlatform.AbpExtEdge;
const AbpExtAny = AbpExtChromium | SpecificPlatform.AbpExtFirefox;
const AbpAny = AbpExtAny;
const Any = AdgAny | UboAny | AbpAny;
/**
* List of generic platforms (combinations of specific platforms).
*/
// eslint-disable-next-line @typescript-eslint/no-redeclare
const GenericPlatform = {
AdgOsAny: AdgOsAny,
AdgSafariAny: AdgSafariAny,
AdgExtChromium: AdgExtChromium,
AdgExtAny: AdgExtAny,
AdgAny: AdgAny,
UboExtChromium: UboExtChromium,
UboExtAny: UboExtAny,
UboAny: UboAny,
AbpExtChromium: AbpExtChromium,
AbpExtAny: AbpExtAny,
AbpAny: AbpAny,
Any: Any,
};
},
63780(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
S: () => (redirectsCompatibilityTable)
});
/* import */ var _utils_constants_js__rspack_import_0 = __webpack_require__(53097);
/* import */ var _utils_deep_freeze_js__rspack_import_4 = __webpack_require__(41666);
/* import */ var _utils_type_guards_js__rspack_import_2 = __webpack_require__(64505);
/* import */ var _base_js__rspack_import_1 = __webpack_require__(21565);
/* import */ var _compatibility_table_data_js__rspack_import_5 = __webpack_require__(33017);
/* import */ var _utils_resource_type_helpers_js__rspack_import_3 = __webpack_require__(95473);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Compatibility tables for redirects.
*/
/**
* Prefix for resource redirection names.
*/
const ABP_RESOURCE_PREFIX = 'abp-resource:';
const ABP_RESOURCE_PREFIX_LENGTH = ABP_RESOURCE_PREFIX.length;
/**
* Normalizes the redirect name.
*
* @param name Redirect name to normalize.
*
* @returns Normalized redirect name.
*
* @example
* redirectNameNormalizer('abp-resource:my-resource') // => 'my-resource'
* redirectNameNormalizer('noop.js:99') // => 'noop.js'
*/
const redirectNameNormalizer = (name) => {
// Remove ABP resource prefix, if present
if (name.startsWith(ABP_RESOURCE_PREFIX)) {
return name.slice(ABP_RESOURCE_PREFIX_LENGTH);
}
/**
* Remove :[integer] priority suffix from the name, if present.
*
* Note: negative values are also supported, see AG-48788.
*
* @see https://github.com/AdguardTeam/tsurlfilter/issues/59
* @see https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect
*/
const colonIndex = name.lastIndexOf(_utils_constants_js__rspack_import_0/* .COLON */.oH);
if (colonIndex !== -1 && /^-?\d+$/.test(name.slice(colonIndex + 1))) {
return name.slice(0, colonIndex);
}
return name;
};
/**
* Compatibility table for redirects.
*/
class RedirectsCompatibilityTable extends _base_js__rspack_import_1/* .CompatibilityTableBase */.E {
/**
* Creates a new instance of the compatibility table for redirects.
*
* @param data Compatibility table data.
*/
constructor(data) {
super(data, redirectNameNormalizer);
}
/**
* Gets the resource type adblock modifiers for the redirect for the given platform
* based on the `resourceTypes` field.
*
* @param redirect Redirect name or redirect data.
* @param platform Platform to get the modifiers for (can be specific, generic, or combined platforms).
*
* @returns Set of resource type modifiers or an empty set if the redirect is not found or has no resource types.
*/
getResourceTypeModifiers(redirect, platform) {
let redirectData = null;
if ((0,_utils_type_guards_js__rspack_import_2/* .isString */.Kg)(redirect)) {
redirectData = this.getFirst(redirect, platform);
}
else {
redirectData = redirect;
}
const modifierNames = new Set();
if ((0,_utils_type_guards_js__rspack_import_2/* .isNull */.kZ)(redirectData) || (0,_utils_type_guards_js__rspack_import_2/* .isUndefined */.b0)(redirectData.resourceTypes)) {
return modifierNames;
}
for (const resourceType of redirectData.resourceTypes) {
const modifierName = (0,_utils_resource_type_helpers_js__rspack_import_3/* .getResourceTypeModifier */.e)(resourceType, platform);
if ((0,_utils_type_guards_js__rspack_import_2/* .isNull */.kZ)(modifierName)) {
continue;
}
modifierNames.add(modifierName);
}
return modifierNames;
}
}
/**
* Deep freeze the compatibility table data to avoid accidental modifications.
*/
(0,_utils_deep_freeze_js__rspack_import_4/* .deepFreeze */.o)(_compatibility_table_data_js__rspack_import_5/* .redirectsCompatibilityTableData */.qL);
/**
* Compatibility table instance for redirects.
*/
const redirectsCompatibilityTable = new RedirectsCompatibilityTable(_compatibility_table_data_js__rspack_import_5/* .redirectsCompatibilityTableData */.qL);
},
95473(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
x: () => (/* binding */ isValidResourceType),
e: () => (/* binding */ getResourceTypeModifier)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/modifiers.js + 1 modules
var modifiers = __webpack_require__(6674);
// EXTERNAL MODULE: ./node_modules/.pnpm/zod@3.24.4/node_modules/zod/lib/index.mjs
var lib = __webpack_require__(53034);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/schemas/resource-type.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Resource type schema.
*/
/**
* Resource type.
*
* @see {@link https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-ResourceType}
*/
const ResourceType = {
MainFrame: 'main_frame',
SubFrame: 'sub_frame',
Stylesheet: 'stylesheet',
Script: 'script',
Image: 'image',
Font: 'font',
Object: 'object',
XmlHttpRequest: 'xmlhttprequest',
Ping: 'ping',
Media: 'media',
WebSocket: 'websocket',
Other: 'other',
};
/**
* Resource type schema.
*/
const resourceTypeSchema = lib/* ["default"].nativeEnum */.Ay.nativeEnum(ResourceType);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/utils/resource-type-helpers.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Map of resource types to their corresponding adblock modifier names.
*
* @note Record type is used to ensure that all resource types are present in the map.
*/
const RESOURCE_TYPE_MODIFIER_MAP = Object.freeze({
[ResourceType.MainFrame]: 'document',
[ResourceType.SubFrame]: 'subdocument',
[ResourceType.Stylesheet]: 'stylesheet',
[ResourceType.Script]: 'script',
[ResourceType.Image]: 'image',
[ResourceType.Font]: 'font',
[ResourceType.Object]: 'object',
[ResourceType.XmlHttpRequest]: 'xmlhttprequest',
[ResourceType.Ping]: 'ping',
[ResourceType.Media]: 'media',
[ResourceType.WebSocket]: 'websocket',
[ResourceType.Other]: 'other',
});
/**
* Gets the adblock modifier name for the given resource type.
*
* @param resourceType Resource type to get the modifier name for.
* @param platform Platform to get the modifier for (can be specific, generic, or combined platforms).
*
* @returns A string containing the adblock modifier name for the given resource type
* or `null` if the modifier could not be found.
*/
const getResourceTypeModifier = (resourceType, platform) => {
const modifierName = RESOURCE_TYPE_MODIFIER_MAP[resourceType];
if (!modifierName) {
return null;
}
const modifierData = modifiers/* .modifiersCompatibilityTable.getFirst */.Z.getFirst(modifierName, platform);
if ((0,type_guards/* .isNull */.kZ)(modifierData)) {
return null;
}
return modifierData.name;
};
/**
* Checks if the given resource type is valid.
*
* @param resourceType Resource type to check.
*
* @returns `true` if the resource type is valid, `false` otherwise.
*/
const isValidResourceType = (resourceType) => {
return Object.values(ResourceType).includes(resourceType);
};
},
83956(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
I: () => (BaseConverter)
});
/* import */ var _errors_not_implemented_error_js__rspack_import_0 = __webpack_require__(82535);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Base class for converters.
*
* TS doesn't support abstract static methods, so we should use
* a workaround and extend this class instead of implementing it.
*/
/* eslint-disable jsdoc/require-returns-check */
/* eslint-disable @typescript-eslint/no-unused-vars */
/**
* Basic class for rule converters.
*/
class BaseConverter {
/**
* Converts some data to AdGuard format.
*
* @param data Data to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the data is invalid or incompatible.
*/
static convertToAdg(data) {
throw new _errors_not_implemented_error_js__rspack_import_0/* .NotImplementedError */.E();
}
/**
* Converts some data to Adblock Plus format.
*
* @param data Data to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the data is invalid or incompatible.
*/
static convertToAbp(data) {
throw new _errors_not_implemented_error_js__rspack_import_0/* .NotImplementedError */.E();
}
/**
* Converts some data to uBlock Origin format.
*
* @param data Data to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the data is invalid or incompatible.
*/
static convertToUbo(data) {
throw new _errors_not_implemented_error_js__rspack_import_0/* .NotImplementedError */.E();
}
}
},
51548(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
c: () => (createConversionResult),
k: () => (createNodeConversionResult)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Conversion result interface and helper functions.
*/
/**
* Helper function to create a generic conversion result.
*
* @template T Type of the item to convert.
* @template U Type of the conversion result (defaults to `T`, but can be `T[]` as well).
*
* @param result Conversion result.
* @param isConverted Indicates whether the input item was converted.
*
* @returns Generic conversion result.
*/
// eslint-disable-next-line max-len
function createConversionResult(result, isConverted) {
return {
result,
isConverted,
};
}
/**
* Helper function to create a node conversion result.
*
* @template T Type of the node (extends `Node`).
*
* @param nodes Array of nodes.
* @param isConverted Indicates whether the input item was converted.
*
* @returns Node conversion result.
*/
function createNodeConversionResult(nodes, isConverted) {
return createConversionResult(nodes, isConverted);
}
},
63829(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
FH: () => (REMOVE_VALUE),
JX: () => (REMOVE_PROPERTY),
PY: () => (ABP_EXT_CSS_PREFIX),
Ss: () => (EXT_CSS_PSEUDO_CLASSES),
Y_: () => (NATIVE_CSS_PSEUDO_CLASSES),
at: () => (LEGACY_EXT_CSS_ATTRIBUTE_PREFIX),
ig: () => (EXT_CSS_PSEUDO_CLASSES_STRICT)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Known CSS elements and attributes.
* TODO: Implement a compatibility table for Extended CSS.
*/
/**
* Legacy Extended CSS attribute prefix.
*
* @example
* ```css
* [-ext-<name>=...]
* ```
*/
const LEGACY_EXT_CSS_ATTRIBUTE_PREFIX = '-ext-';
/**
* ABP Extended CSS prefix.
*
* @example
* ```css
* [-abp-<name>=...]
* -abp-<name>(...)
* ```
*/
const ABP_EXT_CSS_PREFIX = '-abp';
/**
* Known CSS pseudo-classes that are supported by all browsers natively,
* but can also be applied as extended.
*/
const NATIVE_CSS_PSEUDO_CLASSES = new Set([
/**
* Https://developer.mozilla.org/en-US/docs/Web/CSS/:has
* https://github.com/AdguardTeam/ExtendedCss#extended-css-has.
*/
'has',
/**
* Https://developer.mozilla.org/en-US/docs/Web/CSS/:is
* https://github.com/AdguardTeam/ExtendedCss#extended-css-is.
*/
'is',
/**
* Https://developer.mozilla.org/en-US/docs/Web/CSS/:not
* https://github.com/AdguardTeam/ExtendedCss#extended-css-not.
*/
'not',
]);
/**
* Known _strict_ Extended CSS pseudo-classes. Please, keep this list sorted.
* Strict means that these pseudo-classes are not supported by any browser natively,
* and they always require Extended CSS libraries to work.
*/
const EXT_CSS_PSEUDO_CLASSES_STRICT = new Set([
// AdGuard
// https://github.com/AdguardTeam/ExtendedCss
'contains',
'if-not',
'matches-attr',
'matches-css',
'matches-property',
'nth-ancestor',
'remove',
'upward',
'xpath',
// uBlock Origin
// https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#procedural-cosmetic-filters
'has-text',
'matches-css-after',
'matches-css-before',
'matches-path',
'min-text-length',
'watch-attr',
// Adblock Plus
// https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide-emulation
'-abp-contains',
'-abp-has',
'-abp-properties',
]);
/**
* _ALL_ known Extended CSS pseudo-classes. Please, keep this list sorted.
* It includes strict pseudo-classes and additional pseudo-classes that may be
* supported by some browsers natively.
*/
const EXT_CSS_PSEUDO_CLASSES = new Set([
...EXT_CSS_PSEUDO_CLASSES_STRICT,
...NATIVE_CSS_PSEUDO_CLASSES,
]);
/**
* Known extended CSS property that is used to remove elements.
*
* @see {@link https://github.com/AdguardTeam/ExtendedCss#remove-pseudos}
*/
const REMOVE_PROPERTY = 'remove';
/**
* Known extended CSS value for {@link REMOVE_PROPERTY} property to remove elements.
*
* @see {@link https://github.com/AdguardTeam/ExtendedCss#remove-pseudos}
*/
const REMOVE_VALUE = 'true';
},
26982(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
$: () => (RawRuleConverter)
});
/* import */ var _parser_rule_parser_js__rspack_import_2 = __webpack_require__(53550);
/* import */ var _base_interfaces_base_converter_js__rspack_import_0 = __webpack_require__(83956);
/* import */ var _base_interfaces_conversion_result_js__rspack_import_3 = __webpack_require__(51548);
/* import */ var _rule_js__rspack_import_1 = __webpack_require__(53026);
/* import */ var _generator_rule_generator_js__rspack_import_4 = __webpack_require__(11598);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Rule converter for raw rules.
*
* Technically, this is a wrapper around `RuleConverter` that works with nodes instead of strings.
*/
/**
* Adblock filtering rule converter class.
*
* You can use this class to convert string-based adblock rules, since most of the converters work with nodes.
* This class just provides an extra layer on top of the {@link RuleConverter} and calls the parser/serializer
* before/after the conversion internally.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class RawRuleConverter extends _base_interfaces_base_converter_js__rspack_import_0/* .BaseConverter */.I {
/**
* Converts an adblock filtering rule to AdGuard format, if possible.
*
* @param rawRule Raw rule text to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the array of converted rule texts, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the original rule text will be returned.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rawRule) {
const conversionResult = _rule_js__rspack_import_1/* .RuleConverter.convertToAdg */.b.convertToAdg(_parser_rule_parser_js__rspack_import_2/* .RuleParser.parse */.G.parse(rawRule));
// If the rule was not converted, return the original rule text
if (!conversionResult.isConverted) {
return (0,_base_interfaces_conversion_result_js__rspack_import_3/* .createConversionResult */.c)([rawRule], false);
}
// Otherwise, serialize the converted rule nodes
return (0,_base_interfaces_conversion_result_js__rspack_import_3/* .createConversionResult */.c)(conversionResult.result.map(_generator_rule_generator_js__rspack_import_4/* .RuleGenerator.generate */.u.generate), true);
}
}
},
53026(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
b: () => (/* binding */ RuleConverter)
});
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/rule-conversion-error.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Customized error class for conversion errors.
*/
const ERROR_NAME = 'RuleConversionError';
/**
* Customized error class for conversion errors.
*/
class RuleConversionError extends Error {
/**
* Constructs a new `RuleConversionError` instance.
*
* @param message Error message.
*/
constructor(message) {
super(message);
this.name = ERROR_NAME;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/base-interfaces/conversion-result.js
var conversion_result = __webpack_require__(51548);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/not-implemented-error.js
var not_implemented_error = __webpack_require__(82535);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/base-interfaces/base-converter.js
var base_converter = __webpack_require__(83956);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/base-interfaces/rule-converter-base.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Base class for rule converters.
*
* TS doesn't support abstract static methods, so we should use
* a workaround and extend this class instead of implementing it.
*/
/* eslint-disable jsdoc/require-returns-check */
/* eslint-disable @typescript-eslint/no-unused-vars */
/**
* Basic class for rule converters.
*/
class RuleConverterBase extends base_converter/* .BaseConverter */.I {
/**
* Converts an adblock filtering rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
throw new not_implemented_error/* .NotImplementedError */.E();
}
/**
* Converts an adblock filtering rule to Adblock Plus format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAbp(rule) {
throw new not_implemented_error/* .NotImplementedError */.E();
}
/**
* Converts an adblock filtering rule to uBlock Origin format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToUbo(rule) {
throw new not_implemented_error/* .NotImplementedError */.E();
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js
var clone_deep = __webpack_require__(98518);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/clone.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Clone related utilities.
*
* We should keep clone related functions in this file. Thus, we just provide
* a simple interface for cloning values, we use it across the AGTree project,
* and the implementation "under the hood" can be improved later, if needed.
*/
/**
* Clones an input value to avoid side effects. Use it only in justified cases,
* because it can impact performance negatively.
*
* @param value Value to clone.
*
* @returns Cloned value.
*/
function clone(value) {
// TODO: Replace cloneDeep with a more efficient implementation
return clone_deep(value);
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/comment/index.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Comment rule converter.
*/
/**
* Comment rule converter class.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class CommentRuleConverter extends RuleConverterBase {
/**
* Converts a comment rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
// TODO: Add support for other comment types, if needed
// Main task is # -> ! conversion
switch (rule.type) {
case nodes/* .CommentRuleType.CommentRule */.gV.CommentRule:
// Check if the rule needs to be converted
if (rule.type === nodes/* .CommentRuleType.CommentRule */.gV.CommentRule && rule.marker.value === nodes/* .CommentMarker.Hashmark */.yg.Hashmark) {
// Add a ! to the beginning of the comment
// TODO: Replace with custom clone method
const ruleClone = clone(rule);
ruleClone.marker.value = nodes/* .CommentMarker.Regular */.yg.Regular;
// Add the hashmark to the beginning of the comment text
ruleClone.text.value = `${constants/* .SPACE */.t6}${nodes/* .CommentMarker.Hashmark */.yg.Hashmark}${ruleClone.text.value}`;
return (0,conversion_result/* .createNodeConversionResult */.k)([ruleClone], true);
}
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
// Leave any other comment rule as is
default:
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/css-token-stream.js
var css_token_stream = __webpack_require__(44148);
// EXTERNAL MODULE: ./node_modules/.pnpm/sprintf-js@1.1.3/node_modules/sprintf-js/src/sprintf.js
var sprintf = __webpack_require__(37155);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+css-tokenizer@1.2.0/node_modules/@adguard/css-tokenizer/dist/csstokenizer.mjs
var csstokenizer = __webpack_require__(83747);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/data/css.js
var css = __webpack_require__(63829);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/quotes.js
var quotes = __webpack_require__(68999);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/css/index.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
const ERROR_MESSAGES = {
// eslint-disable-next-line max-len
INVALID_ATTRIBUTE_VALUE: `Expected '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.Ident */.ks.Ident)}' or '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.String */.ks.String)}' as attribute value, but got '%s' with value '%s`,
};
const PseudoClasses = {
AbpContains: '-abp-contains',
AbpHas: '-abp-has',
Contains: 'contains',
Has: 'has',
HasText: 'has-text',
MatchesCss: 'matches-css',
MatchesCssAfter: 'matches-css-after',
MatchesCssBefore: 'matches-css-before'};
const PseudoElements = {
After: 'after',
Before: 'before',
};
const PSEUDO_ELEMENT_NAMES = new Set([
PseudoElements.After,
PseudoElements.Before,
]);
/**
* CSS selector converter.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class CssSelectorConverter extends base_converter/* .BaseConverter */.I {
/**
* Converts Extended CSS elements to AdGuard-compatible ones.
*
* @param selectorList Selector list to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the rule is invalid or incompatible.
*/
static convertToAdg(selectorList) {
const stream = selectorList instanceof css_token_stream/* .CssTokenStream */.d
? selectorList
: new css_token_stream/* .CssTokenStream */.d(selectorList);
const converted = [];
const convertAndPushPseudo = (pseudo) => {
switch (pseudo) {
case PseudoClasses.AbpContains:
case PseudoClasses.HasText:
converted.push(PseudoClasses.Contains);
converted.push(constants/* .OPEN_PARENTHESIS */.Cx);
break;
case PseudoClasses.AbpHas:
converted.push(PseudoClasses.Has);
converted.push(constants/* .OPEN_PARENTHESIS */.Cx);
break;
// a bit special case:
// - `:matches-css-before(...)` → `:matches-css(before, ...)`
// - `:matches-css-after(...)` → `:matches-css(after, ...)`
case PseudoClasses.MatchesCssBefore:
case PseudoClasses.MatchesCssAfter:
converted.push(PseudoClasses.MatchesCss);
converted.push(constants/* .OPEN_PARENTHESIS */.Cx);
converted.push(pseudo.substring(PseudoClasses.MatchesCss.length + 1));
converted.push(constants/* .COMMA */.KE);
break;
default:
converted.push(pseudo);
converted.push(constants/* .OPEN_PARENTHESIS */.Cx);
break;
}
};
while (!stream.isEof()) {
const token = stream.getOrFail();
if (token.type === csstokenizer/* .TokenType.Colon */.ks.Colon) {
// Advance colon
stream.advance();
converted.push(constants/* .COLON */.oH);
const tempToken = stream.getOrFail();
// Double colon is a pseudo-element
if (tempToken.type === csstokenizer/* .TokenType.Colon */.ks.Colon) {
stream.advance();
converted.push(constants/* .COLON */.oH);
continue;
}
if (tempToken.type === csstokenizer/* .TokenType.Ident */.ks.Ident) {
const name = stream.source.slice(tempToken.start, tempToken.end);
if (PSEUDO_ELEMENT_NAMES.has(name)) {
// Add an extra colon to the name
converted.push(constants/* .COLON */.oH);
converted.push(name);
}
else {
// Add the name as is
converted.push(name);
}
// Advance the names
stream.advance();
}
else if (tempToken.type === csstokenizer/* .TokenType.Function */.ks.Function) {
const name = stream.source.slice(tempToken.start, tempToken.end - 1); // omit the last parenthesis
// :-abp-contains(...) → :contains(...)
// :has-text(...) → :contains(...)
// :-abp-has(...) → :has(...)
convertAndPushPseudo(name);
// Advance the function name
stream.advance();
}
}
else if (token.type === csstokenizer/* .TokenType.OpenSquareBracket */.ks.OpenSquareBracket) {
let tempToken;
const { start } = token;
stream.advance();
// Converts legacy Extended CSS selectors to the modern Extended CSS syntax.
// For example:
// - `[-ext-has=...]` → `:has(...)`
// - `[-ext-contains=...]` → `:contains(...)`
// - `[-ext-matches-css-before=...]` → `:matches-css(before, ...)`
stream.skipWhitespace();
stream.expect(csstokenizer/* .TokenType.Ident */.ks.Ident);
tempToken = stream.getOrFail();
let attr = stream.source.slice(tempToken.start, tempToken.end);
// Skip if the attribute name is not a legacy Extended CSS one
if (!(attr.startsWith(css/* .LEGACY_EXT_CSS_ATTRIBUTE_PREFIX */.at) || attr.startsWith(css/* .ABP_EXT_CSS_PREFIX */.PY))) {
converted.push(stream.source.slice(start, tempToken.end));
stream.advance();
continue;
}
if (attr.startsWith(css/* .LEGACY_EXT_CSS_ATTRIBUTE_PREFIX */.at)) {
attr = attr.slice(css/* .LEGACY_EXT_CSS_ATTRIBUTE_PREFIX.length */.at.length);
}
stream.advance();
stream.skipWhitespace();
// Next token should be an equality operator (=), because Extended CSS attribute selectors
// do not support other operators
stream.expect(csstokenizer/* .TokenType.Delim */.ks.Delim, { value: constants/* .EQUALS */.UT });
stream.advance();
// Skip optional whitespace after the operator
stream.skipWhitespace();
// Parse attribute value
tempToken = stream.getOrFail();
// According to the spec, attribute value should be an identifier or a string
if (tempToken.type !== csstokenizer/* .TokenType.Ident */.ks.Ident && tempToken.type !== csstokenizer/* .TokenType.String */.ks.String) {
throw new Error((0,sprintf.sprintf)(ERROR_MESSAGES.INVALID_ATTRIBUTE_VALUE, (0,csstokenizer/* .getFormattedTokenName */.bZ)(tempToken.type), stream.source.slice(tempToken.start, tempToken.end)));
}
const value = stream.source.slice(tempToken.start, tempToken.end);
// Advance the attribute value
stream.advance();
// Skip optional whitespace after the attribute value
stream.skipWhitespace();
// Next character should be a closing square bracket
// We don't allow flags for Extended CSS attribute selectors
stream.expect(csstokenizer/* .TokenType.CloseSquareBracket */.ks.CloseSquareBracket);
stream.advance();
converted.push(constants/* .COLON */.oH);
convertAndPushPseudo(attr);
let processedValue = quotes/* .QuoteUtils.removeQuotes */.Qj.removeQuotes(value);
if (attr === PseudoClasses.Has) {
// TODO: Optimize this to avoid double tokenization
processedValue = CssSelectorConverter.convertToAdg(processedValue).result;
}
converted.push(processedValue);
converted.push(constants/* .CLOSE_PARENTHESIS */.s1);
}
else {
converted.push(stream.source.slice(token.start, token.end));
// Advance the token
stream.advance();
}
}
const convertedSelectorList = converted.join(constants/* .EMPTY */.wg);
return (0,conversion_result/* .createConversionResult */.c)(convertedSelectorList, stream.source !== convertedSelectorList);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/css.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file CSS injection rule converter.
*/
/**
* CSS injection rule converter class.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class CssInjectionRuleConverter extends RuleConverterBase {
/**
* Converts a CSS injection rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
const separator = rule.separator.value;
let convertedSeparator = separator;
const stream = new css_token_stream/* .CssTokenStream */.d(rule.body.selectorList.value);
const convertedSelectorList = CssSelectorConverter.convertToAdg(stream);
// Change the separator if the rule contains ExtendedCSS elements,
// but do not force non-extended CSS separator if the rule does not contain any ExtendedCSS selectors,
// because sometimes we use it to force executing ExtendedCSS library.
if (stream.hasAnySelectorExtendedCssNodeStrict() || rule.body.remove) {
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.AdgExtendedCssInjectionException */.p5.AdgExtendedCssInjectionException
: nodes/* .CosmeticRuleSeparator.AdgExtendedCssInjection */.p5.AdgExtendedCssInjection;
}
else if (rule.syntax !== adblockers/* .AdblockSyntax.Adg */.YG.Adg) {
// If the original rule syntax is not AdGuard, use the default separator
// e.g. if the input rule is from uBO, we need to convert ## to #$#.
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.AdgCssInjectionException */.p5.AdgCssInjectionException
: nodes/* .CosmeticRuleSeparator.AdgCssInjection */.p5.AdgCssInjection;
}
// Check if the rule needs to be converted
if (!(rule.syntax === adblockers/* .AdblockSyntax.Common */.YG.Common || rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg)
|| separator !== convertedSeparator
|| convertedSelectorList.isConverted) {
// TODO: Replace with custom clone method
const ruleClone = clone(rule);
ruleClone.syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
ruleClone.separator.value = convertedSeparator;
ruleClone.body.selectorList.value = convertedSelectorList.result;
return (0,conversion_result/* .createNodeConversionResult */.k)([ruleClone], true);
}
// Otherwise, return the original rule
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/element-hiding.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Element hiding rule converter.
*/
/**
* Element hiding rule converter class.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class ElementHidingRuleConverter extends RuleConverterBase {
/**
* Converts an element hiding rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
const separator = rule.separator.value;
let convertedSeparator = separator;
const stream = new css_token_stream/* .CssTokenStream */.d(rule.body.selectorList.value);
const convertedSelectorList = CssSelectorConverter.convertToAdg(stream);
// Change the separator if the rule contains ExtendedCSS elements,
// but do not force non-extended CSS separator if the rule does not contain any ExtendedCSS selectors,
// because sometimes we use it to force executing ExtendedCSS library.
if (stream.hasAnySelectorExtendedCssNodeStrict()) {
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.ExtendedElementHidingException */.p5.ExtendedElementHidingException
: nodes/* .CosmeticRuleSeparator.ExtendedElementHiding */.p5.ExtendedElementHiding;
}
// Check if the rule needs to be converted
if (!(rule.syntax === adblockers/* .AdblockSyntax.Common */.YG.Common || rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg)
|| separator !== convertedSeparator
|| convertedSelectorList.isConverted) {
// TODO: Replace with custom clone method
const ruleClone = clone(rule);
ruleClone.syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
ruleClone.separator.value = convertedSeparator;
ruleClone.body.selectorList.value = convertedSelectorList.result;
return (0,conversion_result/* .createNodeConversionResult */.k)([ruleClone], true);
}
// Otherwise, return the original rule
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/ast-utils/modifiers.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for working with modifier nodes.
*/
/**
* Creates a modifier node.
*
* @param name Name of the modifier.
* @param value Value of the modifier.
* @param exception Whether the modifier is an exception.
*
* @returns Modifier node.
*/
function createModifierNode(name, value = undefined, exception = false) {
const result = {
type: 'Modifier',
exception,
name: {
type: 'Value',
value: name,
},
};
if (!(0,type_guards/* .isUndefined */.b0)(value)) {
result.value = {
type: 'Value',
value,
};
}
return result;
}
/**
* Creates a modifier list node.
*
* @param modifiers Modifiers to put in the list (optional, defaults to an empty list).
*
* @returns Modifier list node.
*/
function createModifierListNode(modifiers = []) {
const result = {
type: 'ModifierList',
// We need to clone the modifiers to avoid side effects
children: modifiers.length ? clone(modifiers) : [],
};
return result;
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/ast-utils/network-rules.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for working with network rule nodes.
*/
/**
* Creates a network rule node.
*
* @param pattern Rule pattern.
* @param modifiers Rule modifiers (optional, default: undefined).
* @param exception Exception rule flag (optional, default: false).
* @param syntax Adblock syntax (optional, default: Common).
*
* @returns Network rule node.
*/
function createNetworkRuleNode(pattern, modifiers = undefined, exception = false, syntax = adblockers/* .AdblockSyntax.Common */.YG.Common) {
const result = {
category: nodes/* .RuleCategory.Network */.$O.Network,
type: nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule,
syntax,
exception,
pattern: {
type: 'Value',
value: pattern,
},
};
if (!(0,type_guards/* .isUndefined */.b0)(modifiers)) {
result.modifiers = clone(modifiers);
}
return result;
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/ubo-html-filtering-body-common.js
var ubo_html_filtering_body_common = __webpack_require__(76466);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/html-filtering-body/ubo-html-filtering-body-parser.js
var ubo_html_filtering_body_parser = __webpack_require__(91090);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/regexp.js
var regexp = __webpack_require__(64539);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/header-removal.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Converter for request header removal rules.
*/
const ADG_REMOVEHEADER_MODIFIER = 'removeheader';
const header_removal_ERROR_MESSAGES = {
MULTIPLE_DOMAINS_NOT_SUPPORTED: 'Multiple domains are not supported yet',
};
/**
* Converter for request header removal rules.
*
* @todo Implement `convertToUbo` (ABP currently doesn't support header removal rules).
*/
class HeaderRemovalRuleConverter extends RuleConverterBase {
/**
* Converts a header removal rule to AdGuard syntax, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*
* @example
* If the input rule is:
* ```adblock
* example.com##^responseheader(header-name)
* ```
* The output will be:
* ```adblock
* ||example.com^$removeheader=header-name
* ```
*/
static convertToAdg(rule) {
// TODO: Add support for ABP syntax once it starts supporting header removal rules
// Leave the rule as is if it's not a header removal rule
if (rule.category !== nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic || rule.type !== nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
// Handle case when body is raw value string.
// If so, parse it first as we need to work with AST nodes.
let body = null;
if (rule.body.type === 'Value') {
body = ubo_html_filtering_body_parser/* .UboHtmlFilteringBodyParser.parseResponseHeaderRule */.V.parseResponseHeaderRule(rule.body.value, {
isLocIncluded: false,
parseHtmlFilteringRuleBodies: true,
});
}
else {
body = rule.body;
}
// Check if the rule body is a uBO responseheader(...) function
if (!body || !(0,ubo_html_filtering_body_common/* .isUboResponseHeaderRemovalRuleBody */.l)(body)) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
// Length of AST nodes, types of nodes, non-null argument
// check are already done in `isUboResponseHeaderRemovalRuleBody()`
const { selectorList } = body;
const complexSelector = selectorList.children[0];
const pseudoClassSelector = complexSelector.children[0];
const headerName = pseudoClassSelector.argument.value;
// Prepare network rule pattern
const pattern = [];
if (rule.domains.children.length === 1) {
// If the rule has only one domain, we can use a simple network rule pattern:
// ||single-domain-from-the-rule^
pattern.push(regexp/* .ADBLOCK_URL_START */.Cg, rule.domains.children[0].value, regexp/* .ADBLOCK_URL_SEPARATOR */.Fx);
}
else if (rule.domains.children.length > 1) {
// TODO: Add support for multiple domains, for example:
// example.com,example.org,example.net##^responseheader(header-name)
// We should consider allowing $domain with $removeheader modifier,
// for example:
// $removeheader=header-name,domain=example.com|example.org|example.net
throw new RuleConversionError(header_removal_ERROR_MESSAGES.MULTIPLE_DOMAINS_NOT_SUPPORTED);
}
// Prepare network rule modifiers
const modifiers = createModifierListNode();
modifiers.children.push(createModifierNode(ADG_REMOVEHEADER_MODIFIER, headerName));
// Construct the network rule
return (0,conversion_result/* .createNodeConversionResult */.k)([
createNetworkRuleNode(pattern.join(constants/* .EMPTY */.wg), modifiers,
// Copy the exception flag
rule.exception, adblockers/* .AdblockSyntax.Adg */.YG.Adg),
], true);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/ast-utils/clone.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Custom clone functions for AST nodes, this is probably the most efficient way to clone AST nodes.
*
* @todo Maybe move them to parser classes as 'clone' methods.
*/
/**
* Clones a scriptlet rule node.
*
* @param node Node to clone.
*
* @returns Cloned node.
*/
function cloneScriptletRuleNode(node) {
return {
type: node.type,
children: node.children.map((child) => ((0,type_guards/* .isNull */.kZ)(child) ? null : { ...child })),
};
}
/**
* Clones a domain list node.
*
* @param node Node to clone.
*
* @returns Cloned node.
*/
function cloneDomainListNode(node) {
return {
type: node.type,
separator: node.separator,
children: node.children.map((domain) => ({ ...domain })),
};
}
/**
* Clones a modifier list node.
*
* @param node Node to clone.
*
* @returns Cloned node.
*/
function cloneModifierListNode(node) {
return {
type: node.type,
children: node.children.map((modifier) => {
const res = {
type: modifier.type,
exception: modifier.exception,
name: { ...modifier.name },
};
if (modifier.value) {
res.value = { ...modifier.value };
}
return res;
}),
};
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/html-filtering-body/adg-html-filtering-body-generator.js
var adg_html_filtering_body_generator = __webpack_require__(60646);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/html-filtering-body/ubo-html-filtering-body-generator.js
var ubo_html_filtering_body_generator = __webpack_require__(63836);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/html-filtering-body/adg-html-filtering-body-parser.js
var adg_html_filtering_body_parser = __webpack_require__(55576);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/html.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file HTML filtering rule converter.
*/
/**
* From the AdGuard docs:
* Specifies the maximum length for content of HTML element. If this parameter is
* set and the content length exceeds the value, a rule does not apply to the element.
* If this parameter is not specified, the max-length is considered to be 8192 (8 KB).
* When converting from other formats, we set the max-length to 262144 (256 KB).
*
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#html-filtering-rules}
*/
const ADG_HTML_DEFAULT_MAX_LENGTH = 8192;
const ADG_HTML_CONVERSION_MAX_LENGTH = ADG_HTML_DEFAULT_MAX_LENGTH * 32;
/**
* Supported special pseudo-classes from uBlock.
*
* Note: If new pseudo-classes are added here, ensure to update
* the set and logic in the converter methods accordingly.
*/
const UboPseudoClasses = {
HasText: 'has-text',
MinTextLength: 'min-text-length',
};
/**
* Supported special attribute selectors from AdGuard.
*
* Note: If new pseudo-classes are added here, ensure to update
* the set and logic in the converter methods accordingly.
*/
const AdgAttributeSelectors = {
MaxLength: 'max-length',
MinLength: 'min-length',
TagContent: 'tag-content',
Wildcard: 'wildcard',
};
/**
* Supported special pseudo-classes from AdGuard.
*
* Note: If new pseudo-classes are added here, ensure to update
* the set and logic in the converter methods accordingly.
*/
const AdgPseudoClasses = {
Contains: 'contains',
};
/**
* Set of {@link UboPseudoClasses}.
*/
const SUPPORTED_UBO_PSEUDO_CLASSES = new Set([
UboPseudoClasses.HasText,
UboPseudoClasses.MinTextLength,
]);
/**
* Set of {@link AdgAttributeSelectors}.
*/
const SUPPORTED_ADG_ATTRIBUTE_SELECTORS = new Set([
AdgAttributeSelectors.MaxLength,
AdgAttributeSelectors.MinLength,
AdgAttributeSelectors.TagContent,
AdgAttributeSelectors.Wildcard,
]);
/**
* Set of {@link AdgPseudoClasses}.
*/
const SUPPORTED_ADG_PSEUDO_CLASSES = new Set([
AdgPseudoClasses.Contains,
]);
/**
* Error messages used in HTML filtering rule conversion.
*/
/* eslint-disable max-len */
const html_ERROR_MESSAGES = {
ABP_NOT_SUPPORTED: 'Invalid rule, ABP does not support HTML filtering rules',
INVALID_RULE: 'Invalid HTML filtering rule: %s',
MIXED_SYNTAX_ADG_UBO: 'Mixed AdGuard and uBlock syntax',
EMPTY_SELECTOR_LIST: 'Selector list of HTML filtering rule must not be empty',
EMPTY_COMPLEX_SELECTOR: 'Complex selector of selector list must not be empty',
INVALID_SELECTOR_COMBINATOR: "Invalid selector combinator '%s' used between selectors",
UNKNOWN_SELECTOR_TYPE: "Unknown selector type '%s' found during conversion",
SPECIAL_ATTRIBUTE_SELECTOR_OPERATOR_INVALID: "Special attribute selector '%s' has invalid operator '%s'",
SPECIAL_ATTRIBUTE_SELECTOR_FLAG_NOT_SUPPORTED: "Special attribute selector '%s' does not support flags",
SPECIAL_ATTRIBUTE_SELECTOR_VALUE_REQUIRED: "Special attribute selector '%s' requires a value",
SPECIAL_ATTRIBUTE_SELECTOR_VALUE_INT: "Value of special attribute selector '%s' must be an integer, got '%s'",
SPECIAL_ATTRIBUTE_SELECTOR_VALUE_POSITIVE: "Value of special attribute selector '%s' must be a positive integer, got '%s'",
SPECIAL_ATTRIBUTE_SELECTOR_NOT_SUPPORTED: "Special attribute selector '%s' is not supported in conversion",
SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_REQUIRED: "Special pseudo-class selector '%s' requires an argument",
SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_INT: "Argument of special pseudo-class selector '%s' must be an integer, got '%s'",
SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_POSITIVE: "Argument of special pseudo-class selector '%s' must be a positive integer, got '%s'",
SPECIAL_PSEUDO_CLASS_SELECTOR_NOT_SUPPORTED: "Special pseudo-class selector '%s' is not supported in conversion",
};
/**
* HTML filtering rule converter class.
*
* @todo Implement `convertToUbo` (ABP currently doesn't support HTML filtering rules).
*/
class HtmlRuleConverter extends RuleConverterBase {
/**
* Converts a HTML rule to AdGuard syntax, if possible.
* Also can be used to convert AdGuard rules to AdGuard syntax to validate them.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
let parser;
let onSpecialAttributeSelector;
let onSpecialPseudoClassSelector;
let isConverted = false;
if (rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg) {
parser = adg_html_filtering_body_parser/* .AdgHtmlFilteringBodyParser */.h;
onSpecialAttributeSelector = (name, value) => {
/**
* Mark rule as converted in ADG -> ADG conversion only if
* special attribute selectors are present in the rule body,
* because they are deprecated and will be removed soon,
* so we convert them to pseudo-class selectors.
*/
isConverted = true;
return HtmlRuleConverter.convertSpecialAttributeSelectorAdgToAdg(name, value);
};
onSpecialPseudoClassSelector = HtmlRuleConverter.convertSpecialPseudoClassSelectorAdgToAdg;
}
else if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
/**
* Always mark rule as converted in UBO -> ADG conversion.
*/
isConverted = true;
parser = ubo_html_filtering_body_parser/* .UboHtmlFilteringBodyParser */.V;
onSpecialAttributeSelector = HtmlRuleConverter.convertSpecialAttributeSelectorUboToAdg;
onSpecialPseudoClassSelector = HtmlRuleConverter.convertSpecialPseudoClassSelectorUboToAdg;
}
else {
throw new RuleConversionError(html_ERROR_MESSAGES.ABP_NOT_SUPPORTED);
}
// Convert body
const convertedBody = HtmlRuleConverter.convertBody(rule.body, parser, adg_html_filtering_body_generator/* .AdgHtmlFilteringBodyGenerator */.$, onSpecialAttributeSelector, onSpecialPseudoClassSelector, rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg);
if (!isConverted) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
return (0,conversion_result/* .createNodeConversionResult */.k)([{
category: nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic,
type: nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule,
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
exception: rule.exception,
domains: cloneDomainListNode(rule.domains),
// Convert the separator based on the exception status
separator: {
type: 'Value',
value: rule.exception
? nodes/* .CosmeticRuleSeparator.AdgHtmlFilteringException */.p5.AdgHtmlFilteringException
: nodes/* .CosmeticRuleSeparator.AdgHtmlFiltering */.p5.AdgHtmlFiltering,
},
body: convertedBody,
}], true);
}
/**
* Converts a HTML rule to uBlock syntax, if possible.
* Also can be used to convert uBlock rules to uBlock syntax to validate them.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws Error if the rule is invalid or cannot be converted.
*/
static convertToUbo(rule) {
// Ignore uBlock rules
if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
if (rule.syntax === adblockers/* .AdblockSyntax.Abp */.YG.Abp) {
throw new RuleConversionError(html_ERROR_MESSAGES.ABP_NOT_SUPPORTED);
}
// Convert body
const convertedBody = HtmlRuleConverter.convertBody(rule.body, adg_html_filtering_body_parser/* .AdgHtmlFilteringBodyParser */.h, ubo_html_filtering_body_generator/* .UboHtmlFilteringBodyGenerator */.b, HtmlRuleConverter.convertSpecialAttributeSelectorAdgToUbo, HtmlRuleConverter.convertSpecialPseudoClassSelectorAdgToUbo);
return (0,conversion_result/* .createNodeConversionResult */.k)([{
category: nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic,
type: nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule,
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
exception: rule.exception,
domains: cloneDomainListNode(rule.domains),
separator: {
type: 'Value',
value: rule.exception
? nodes/* .CosmeticRuleSeparator.ElementHidingException */.p5.ElementHidingException
: nodes/* .CosmeticRuleSeparator.ElementHiding */.p5.ElementHiding,
},
body: convertedBody,
}], true);
}
/**
* Handles special attribute selectors during AdGuard to AdGuard conversion:
* - `[tag-content="content"]` -> `:contains(content)`
* direct conversion, no changes to value
* - `[wildcard="*content*"]` -> `:contains(/*.content*./s)`
* convert search pattern to regular expression
* - `[min-length="min"]` -> `:contains(/^(?=.{min,}$).*\/s)`
* converts to a length-matching regular expression.
* - `[max-length="max"]` -> `:contains(/^(?=.{0,max}$).*\/s)`
* converts to a length-matching regular expression.
*
* Note: This attribute selector to pseudo-class selector conversion
* is needed because AdGuard special attribute selectors are going
* to be deprecated and removed soon.
*
* @param name Name of the special attribute selector.
* @param value Value of the special attribute selector.
*
* @returns A {@link SimpleSelector} to add to the current complex selector.
*/
static convertSpecialAttributeSelectorAdgToAdg(name, value) {
switch (name) {
// `[tag-content="content"]` -> `:contains(content)`
// direct conversion, no changes to value
case AdgAttributeSelectors.TagContent: {
return HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, value);
}
// `[wildcard="*content*"] -> `:contains(/*.content*./s)`
// convert search pattern to regular expression
case AdgAttributeSelectors.Wildcard: {
return HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, regexp/* .RegExpUtils.globToRegExp */.Lp.globToRegExp(value));
}
// `[min-length="min"]` -> `:contains(/^(?=.{min,}$).*\/s)`
// `[max-length="max"]` -> `:contains(/^(?=.{0,max}$).*\/s)`
// converts to a length-matching regular expression
case AdgAttributeSelectors.MinLength:
case AdgAttributeSelectors.MaxLength: {
// Validate length value
HtmlRuleConverter.assertValidLengthValue(name, value, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_INT, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_POSITIVE);
// It's safe to cast to number here after validation
const length = Number(value);
let min = null;
let max = null;
if (name === AdgAttributeSelectors.MinLength) {
min = length;
}
else {
max = length;
}
return HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, regexp/* .RegExpUtils.getLengthRegexp */.Lp.getLengthRegexp(min, max));
}
// This line is unreachable due to exhausted cases, but we keep it to satisfy TS
default: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_NOT_SUPPORTED, name));
}
}
}
/**
* Since special pseudo-class selectors do not need conversion
* in AdGuard to AdGuard conversion, we simply return `true` to keep them as-is.
*
* @param name Name of the special pseudo-class selector.
*
* @returns `true` to keep the special pseudo-class selector as-is.
*
* @throws Rule conversion error for mixed syntax.
*/
static convertSpecialPseudoClassSelectorAdgToAdg(name) {
if (SUPPORTED_UBO_PSEUDO_CLASSES.has(name)) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, html_ERROR_MESSAGES.MIXED_SYNTAX_ADG_UBO));
}
return true;
}
/**
* Since special attribute selectors only AdGuard-specific,
* we should never encounter them in uBlock rules.
*
* @throws Rule conversion error for mixed syntax.
*/
static convertSpecialAttributeSelectorUboToAdg() {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, html_ERROR_MESSAGES.MIXED_SYNTAX_ADG_UBO));
}
/**
* Handles special pseudo-class selectors during uBlock to AdGuard conversion:
* - `:has-text(text)` -> `:contains(text)`
* direct conversion, no changes to argument
* - `:min-text-length(min)` -> `:contains(/^(?=.{min,MAX_CONVERSION_DEFAULT}$).*\/s)`
* converts to a length-matching regular expression.
*
* @param name Name of the special pseudo-class selector.
* @param argument Argument of the special pseudo-class selector.
*
* @returns A {@link SimpleSelector} to add to the current complex selector.
*
* @throws If AdGuard-specific pseudo-class selector is found in uBlock rule.
*/
static convertSpecialPseudoClassSelectorUboToAdg(name, argument) {
switch (name) {
// `:has-text(text)` -> `:contains(text)`
// direct conversion, no changes to argument
case UboPseudoClasses.HasText: {
return HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, argument);
}
// `:min-text-length(min)` -> `:contains(/^(?=.{min,MAX_CONVERSION_DEFAULT}$).*\/s)`
// converts to a length-matching regular expression
case UboPseudoClasses.MinTextLength: {
// Validate length value
HtmlRuleConverter.assertValidLengthValue(name, argument, html_ERROR_MESSAGES.SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_INT, html_ERROR_MESSAGES.SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_POSITIVE);
// It's safe to cast to number here after validation
const minLength = Number(argument);
return HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, regexp/* .RegExpUtils.getLengthRegexp */.Lp.getLengthRegexp(minLength, ADG_HTML_CONVERSION_MAX_LENGTH));
}
// Throw an error if the AdGuard-specific pseudo-class selector found in uBlock rule
case AdgPseudoClasses.Contains: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, html_ERROR_MESSAGES.MIXED_SYNTAX_ADG_UBO));
}
// This line is unreachable due to exhausted cases, but we keep it to satisfy TS
default: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_PSEUDO_CLASS_SELECTOR_NOT_SUPPORTED, name));
}
}
}
/**
* Handles special attribute selectors during AdGuard to uBlock conversion:
* - `[tag-content="content"]` -> `:has-text(content)`
* direct conversion, no changes to value
* - `[wildcard="*content*"]` -> `:has-text(/*.content*./s)`
* convert search pattern to regular expression
* - `[min-length="min"]` -> `:min-text-length(min)`
* direct conversion, no changes to value
* - `[max-length]` is skipped.
*
* @param name Name of the special attribute selector.
* @param value Value of the special attribute selector.
*
* @returns A {@link SimpleSelector} to add to the current complex selector, or `false` to skip it.
*/
static convertSpecialAttributeSelectorAdgToUbo(name, value) {
switch (name) {
// `[tag-content="content"]` -> `:has-text(content)`
// direct conversion, no changes to value
case AdgAttributeSelectors.TagContent: {
return HtmlRuleConverter.getPseudoClassSelectorNode(UboPseudoClasses.HasText, value);
}
// `[wildcard="*content*"] -> `:has-text(/*.content*./s)`
// convert search pattern to regular expression
case AdgAttributeSelectors.Wildcard: {
return HtmlRuleConverter.getPseudoClassSelectorNode(UboPseudoClasses.HasText, regexp/* .RegExpUtils.globToRegExp */.Lp.globToRegExp(value));
}
// `[min-length="min"]` -> `:min-text-length(min)`
// direct conversion, no changes to value
case AdgAttributeSelectors.MinLength: {
// Validate length value
HtmlRuleConverter.assertValidLengthValue(name, value, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_INT, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_POSITIVE);
return HtmlRuleConverter.getPseudoClassSelectorNode(UboPseudoClasses.MinTextLength, value);
}
// `[max-length]` is skipped
case AdgAttributeSelectors.MaxLength: {
return false;
}
// This line is unreachable due to exhausted cases, but we keep it to satisfy TS
default: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_NOT_SUPPORTED, name));
}
}
}
/**
* Handles special pseudo-class selectors during AdGuard to uBlock conversion:
* - `:contains(text)` -> `:has-text(text)`
* direct conversion, no changes to argument.
*
* @param name Name of the special pseudo-class selector.
* @param argument Argument of the special pseudo-class selector.
*
* @returns A {@link SimpleSelector} to add to the current complex selector.
*
* @throws If uBlock-specific pseudo-class selector is found in AdGuard rule.
*/
static convertSpecialPseudoClassSelectorAdgToUbo(name, argument) {
switch (name) {
// `:contains(text)` -> `:has-text(text)`
// direct conversion, no changes to argument
case AdgPseudoClasses.Contains: {
return HtmlRuleConverter.getPseudoClassSelectorNode(UboPseudoClasses.HasText, argument);
}
// Throw an error if the uBlock-specific pseudo-class selector found in AdGuard rule
case UboPseudoClasses.HasText:
case UboPseudoClasses.MinTextLength: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, html_ERROR_MESSAGES.MIXED_SYNTAX_ADG_UBO));
}
// This line is unreachable due to exhausted cases, but we keep it to satisfy TS
default: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_PSEUDO_CLASS_SELECTOR_NOT_SUPPORTED, name));
}
}
}
/**
* Pre-scans a complex selector's child selectors
* for {@link AdgAttributeSelectors.MinLength}
* and {@link AdgAttributeSelectors.MaxLength} attribute selectors.
*
* Resolves duplicates to the most *restrictive* value:
* - for multiple `[min-length]` selectors, the largest value is selected;
* - for multiple `[max-length]` selectors, the smallest value is selected.
*
* Logs a warning when duplicate length selectors are found.
*
* @param selectors Child selectors of a complex selector to scan.
*
* @returns Resolved length constraints,
* or `null` if no length selectors were found.
*/
static collectLengthConstraints(selectors) {
const minValues = [];
const maxValues = [];
for (let i = 0; i < selectors.length; i += 1) {
const selector = selectors[i];
if (selector.type !== 'AttributeSelector') {
continue;
}
const { value: name } = selector.name;
if (name !== AdgAttributeSelectors.MinLength
&& name !== AdgAttributeSelectors.MaxLength) {
continue;
}
if (!('value' in selector) || selector.value.value === constants/* .EMPTY */.wg) {
continue;
}
const { value } = selector.value;
HtmlRuleConverter.assertValidLengthValue(name, value, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_INT, html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_POSITIVE);
if (name === AdgAttributeSelectors.MinLength) {
minValues.push(Number(value));
}
else {
maxValues.push(Number(value));
}
}
if (minValues.length === 0 && maxValues.length === 0) {
return null;
}
let min = null;
let max = null;
if (minValues.length > 1) {
min = Math.max(...minValues);
// eslint-disable-next-line no-console
console.warn(`Multiple [min-length] selectors found among: [${minValues.join(', ')}]. Selected largest: ${min}.`);
}
else if (minValues.length === 1) {
[min] = minValues;
}
if (maxValues.length > 1) {
max = Math.min(...maxValues);
// eslint-disable-next-line no-console
console.warn(`Multiple [max-length] selectors found among: [${maxValues.join(', ')}]. Selected smallest: ${max}.`);
}
else if (maxValues.length === 1) {
[max] = maxValues;
}
return { min, max };
}
/**
* Converts a HTML filtering rule body by handling special simple selectors via callbacks.
* Special simple selectors are skipped in the converted selector list and should be handled from callee.
*
* @param body HTML filtering rule body to convert.
* @param parser HTML filtering rule body parser used for parsing raw value bodies.
* @param generator HTML filtering rule body generator used for generating raw value bodies.
* @param onSpecialAttributeSelector Callback invoked when a special attribute selector is found.
* @param onSpecialPseudoClassSelector Callback invoked when a special pseudo-class selector is found.
* @param shouldMergeLengthSelectors If true, `[min-length]` and `[max-length]` attribute
* selectors within the same complex selector are merged into a single `:contains()` pseudo-class.
* Defaults to `false`.
*
* @returns Converted selector list without special simple selectors.
*/
static convertBody(body, parser, generator, onSpecialAttributeSelector, onSpecialPseudoClassSelector, shouldMergeLengthSelectors = false) {
// Handle case when body is raw value string.
// If so, parse it first as we need to work with AST nodes.
let processedBody;
if (body.type === 'Value') {
processedBody = parser.parse(body.value, {
isLocIncluded: false,
parseHtmlFilteringRuleBodies: true,
});
}
else {
processedBody = body;
}
const { children: complexSelectors } = processedBody.selectorList;
// Selector list node must not be empty
HtmlRuleConverter.assertNotEmpty(complexSelectors, html_ERROR_MESSAGES.EMPTY_SELECTOR_LIST);
// Convert each complex selector
const convertedComplexSelectors = [];
for (let i = 0; i < complexSelectors.length; i += 1) {
const { children: selectors } = complexSelectors[i];
// Complex selector node must not be empty
HtmlRuleConverter.assertNotEmpty(selectors, html_ERROR_MESSAGES.EMPTY_COMPLEX_SELECTOR);
// Pre-scan for [min-length] / [max-length] constraints to merge them into one :contains()
const lengthConstraints = shouldMergeLengthSelectors
? HtmlRuleConverter.collectLengthConstraints(selectors)
: null;
let lengthContainsEmitted = false;
// Convert each selector
const convertedSelectors = [];
for (let j = 0; j < selectors.length; j += 1) {
const selector = selectors[j];
switch (selector.type) {
case 'SelectorCombinator': {
// Throw if selector combinator used incorrectly
if (
// If first selector in the complex selector (`> div`)
j === 0
// If the previous selector is also a combinator (`div > + span`)
|| j === selectors.length - 1
// If the last selector in the complex selector (`div +`)
|| (j > 0 && selectors[j - 1].type === 'SelectorCombinator')) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, (0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_SELECTOR_COMBINATOR, selector.value)));
}
break;
}
case 'AttributeSelector': {
// Not a special attribute selector - clone as-is after the switch
if (!SUPPORTED_ADG_ATTRIBUTE_SELECTORS.has(selector.name.value)) {
break;
}
// Throw an error if value is missing
if (!('value' in selector) || selector.value.value === constants/* .EMPTY */.wg) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_VALUE_REQUIRED, selector.name.value));
}
// Throw an error if operator is not '='
if (selector.operator.value !== constants/* .EQUALS */.UT) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_OPERATOR_INVALID, selector.name.value, selector.operator.value));
}
// Throw an error if flag is specified
if (selector.flag) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_ATTRIBUTE_SELECTOR_FLAG_NOT_SUPPORTED, selector.name.value));
}
const name = selector.name.value;
const { value } = selector.value;
// Merge [min-length] and [max-length] into a single :contains() (ADG→ADG)
if (lengthConstraints !== null
&& (name === AdgAttributeSelectors.MinLength
|| name === AdgAttributeSelectors.MaxLength)) {
if (!lengthContainsEmitted) {
// Invoke the callback once to trigger its side effects
// (e.g. the isConverted flag in convertToAdg), but discard
// the individual :contains() it returns — we emit the
// merged one instead.
onSpecialAttributeSelector(name, value);
convertedSelectors.push(HtmlRuleConverter.getPseudoClassSelectorNode(AdgPseudoClasses.Contains, regexp/* .RegExpUtils.getLengthRegexp */.Lp.getLengthRegexp(lengthConstraints.min, lengthConstraints.max)));
lengthContainsEmitted = true;
}
continue;
}
// Invoke callback and:
// - add returned simple selector if it's not boolean
// - skip adding if returned value is false
// - keep original simple selector if returned value is true
const result = onSpecialAttributeSelector(name, value);
if (typeof result !== 'boolean') {
convertedSelectors.push(result);
continue;
}
else if (result === false) {
continue;
}
break;
}
case 'PseudoClassSelector': {
// Not a special pseudo-class selector - clone as-is after the switch
if (!SUPPORTED_ADG_PSEUDO_CLASSES.has(selector.name.value)
&& !SUPPORTED_UBO_PSEUDO_CLASSES.has(selector.name.value)) {
break;
}
// Throw an error if argument is missing
if (!selector.argument || selector.argument.value === constants/* .EMPTY */.wg) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.SPECIAL_PSEUDO_CLASS_SELECTOR_ARGUMENT_REQUIRED, selector.name.value));
}
const name = selector.name.value;
const argument = selector.argument.value;
// Invoke callback and:
// - add returned simple selector if it's not boolean
// - skip adding if returned value is false
// - keep original simple selector if returned value is true
const result = onSpecialPseudoClassSelector(name, argument);
if (typeof result !== 'boolean') {
convertedSelectors.push(result);
continue;
}
else if (result === false) {
continue;
}
break;
}
}
// Clone selector if previous conditions are not met
convertedSelectors.push(HtmlRuleConverter.cloneSelector(selector));
}
convertedComplexSelectors.push({
type: 'ComplexSelector',
children: convertedSelectors,
});
}
let convertedBody = {
type: 'HtmlFilteringRuleBody',
selectorList: {
type: 'SelectorList',
children: convertedComplexSelectors,
},
};
// Convert back to Value if the original body was Value
if (body.type === 'Value') {
convertedBody = {
type: 'Value',
value: generator.generate(convertedBody),
};
}
return convertedBody;
}
/**
* Clones a simple selector or selector combinator node.
*
* @param selector Simple selector or selector combinator node to clone.
*
* @returns Cloned simple selector or selector combinator node.
*/
static cloneSelector(selector) {
const { type } = selector;
switch (type) {
case 'TypeSelector':
case 'IdSelector':
case 'ClassSelector':
return {
type: selector.type,
value: selector.value,
};
case 'SelectorCombinator':
return {
type: selector.type,
value: selector.value,
};
case 'AttributeSelector': {
const attributeSelectorClone = {
type: selector.type,
name: {
type: selector.name.type,
value: selector.name.value,
},
};
if ('value' in selector && selector.value) {
attributeSelectorClone.operator = {
type: selector.operator.type,
value: selector.operator.value,
};
attributeSelectorClone.value = {
type: selector.value.type,
value: selector.value.value,
};
if (selector.flag) {
attributeSelectorClone.flag = {
type: selector.flag.type,
value: selector.flag.value,
};
}
}
return attributeSelectorClone;
}
case 'PseudoClassSelector': {
const pseudoClassSelectorClone = {
type: selector.type,
name: {
type: selector.name.type,
value: selector.name.value,
},
};
if (selector.argument) {
pseudoClassSelectorClone.argument = {
type: selector.argument.type,
value: selector.argument.value,
};
}
return pseudoClassSelectorClone;
}
default: {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, (0,sprintf.sprintf)(html_ERROR_MESSAGES.UNKNOWN_SELECTOR_TYPE, type)));
}
}
}
/**
* Creates a CSS pseudo-class selector node.
*
* @param name The name of the pseudo-class selector.
* @param argument Optional argument of the pseudo-class selector.
*
* @returns CSS pseudo-class selector node.
*/
static getPseudoClassSelectorNode(name, argument) {
return {
type: 'PseudoClassSelector',
name: {
type: 'Value',
value: name,
},
argument: argument ? {
type: 'Value',
value: argument,
} : undefined,
};
}
/**
* Asserts that the given array is not empty.
*
* @param array Array to check.
* @param errorMessage Error message to use if the array is empty.
*
* @throws If the array is empty.
*/
static assertNotEmpty(array, errorMessage) {
if (array.length === 0) {
throw new RuleConversionError((0,sprintf.sprintf)(html_ERROR_MESSAGES.INVALID_RULE, errorMessage));
}
}
/**
* Asserts that the given special attribute / pseudo-class length value is valid.
*
* @param name Name of the attribute or pseudo-class.
* @param value Value to parse.
* @param notIntErrorMessage Error message when the value is not an integer.
* @param notPositiveErrorMessage Error message when the value is not positive.
*
* @throws If the value is not a valid number or not positive.
*/
static assertValidLengthValue(name, value, notIntErrorMessage, notPositiveErrorMessage) {
const parsed = Number(value);
if (Number.isNaN(parsed)) {
throw new RuleConversionError((0,sprintf.sprintf)(notIntErrorMessage, name, value));
}
if (parsed < 0) {
throw new RuleConversionError((0,sprintf.sprintf)(notPositiveErrorMessage, name, value));
}
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/path-converter.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Path-in-domain converter helper.
*/
/**
* Finds the index of the first escaped forward slash (`\/`) in a regex string,
* skipping character classes (`[...]`).
*
* @param str Regex content without outer `/` delimiters.
*
* @returns Index of the backslash in the first `\/` sequence, or -1 if not found.
*/
function findFirstEscapedSlash(str) {
let insideCharacterClass = false;
for (let i = 0; i < str.length; i += 1) {
if (str[i] === constants/* .OPEN_SQUARE_BRACKET */.cU && !insideCharacterClass) {
insideCharacterClass = true;
}
else if (str[i] === constants/* .CLOSE_SQUARE_BRACKET */.A1 && insideCharacterClass) {
insideCharacterClass = false;
}
else if (!insideCharacterClass
&& str[i] === constants/* .ESCAPE_CHARACTER */.Kx
&& i + 1 < str.length
&& str[i + 1] === constants/* .SLASH */.o) {
return i;
}
}
return -1;
}
/**
* Converts path-in-domain syntax to $path modifier.
*
* Example: `example.org/path##.ad` → `[$path=/path]example.org##.ad`.
*
* @param rule Rule to check and convert.
*
* @returns Conversion result if path-in-domain syntax found, undefined otherwise.
*
* @throws RuleConversionError if conflicting $path modifier exists.
*/
function convertPathInDomainToModifier(rule) {
// Only process rules with domains
if (!rule.domains || rule.domains.children.length === 0) {
return undefined;
}
// Quick check: return early if no domain contains a path indicator.
// For non-regex domains, a path requires '/'.
// For regex domains, a path requires '\/' (escaped slash).
const hasAnyPath = rule.domains.children.some((domainItem) => {
const { value } = domainItem;
if (value.startsWith(constants/* .REGEX_MARKER */.Vb) && value.endsWith(constants/* .REGEX_MARKER */.Vb) && value.length > 1) {
return value.includes(constants/* .ESCAPE_CHARACTER */.Kx + constants/* .SLASH */.o);
}
return value.includes(constants/* .SLASH */.o);
});
if (!hasAnyPath) {
return undefined;
}
const domainsWithPaths = [];
const domainsWithoutPaths = [];
rule.domains.children.forEach((domainItem) => {
const domainValue = domainItem.value;
// Check if domain is a regex pattern (starts and ends with /)
if (domainValue.startsWith(constants/* .REGEX_MARKER */.Vb) && domainValue.endsWith(constants/* .REGEX_MARKER */.Vb) && domainValue.length > 1) {
const inner = domainValue.slice(1, -1);
const splitIndex = findFirstEscapedSlash(inner);
if (splitIndex !== -1) {
// splitIndex points to the backslash in `\/`
// Domain part: everything before the backslash, wrapped in /
// Path part: from the slash onward (keeping the slash), wrapped in /
const domain = `${constants/* .REGEX_MARKER */.Vb}${inner.substring(0, splitIndex)}${constants/* .REGEX_MARKER */.Vb}`;
const path = `${constants/* .REGEX_MARKER */.Vb}${inner.substring(splitIndex)}${constants/* .REGEX_MARKER */.Vb}`;
domainsWithPaths.push({
domain,
path,
exception: domainItem.exception,
});
}
else {
domainsWithoutPaths.push({
domain: domainValue,
exception: domainItem.exception,
});
}
}
else {
// Non-regex domain
const slashIndex = domainValue.indexOf(constants/* .SLASH */.o);
if (slashIndex !== -1) {
const domain = domainValue.substring(0, slashIndex);
const path = domainValue.substring(slashIndex); // includes leading /
// Skip empty paths
if (path === '/') {
domainsWithoutPaths.push({
domain,
exception: domainItem.exception,
});
}
else {
domainsWithPaths.push({
domain,
path,
exception: domainItem.exception,
});
}
}
else {
domainsWithoutPaths.push({
domain: domainValue,
exception: domainItem.exception,
});
}
}
});
if (domainsWithPaths.length === 0) {
return undefined;
}
/*
* Exception domains cannot be combined with path-in-domain syntax.
*
* For example example.org/foo1/bar2,~example.org/${WILDCARD}/bar2##h1
* This can’t be converted because [$path=/${WILDCARD}/bar2]example.org##h1
* may unblock unrelated rules like: "example.org/baz1/bar2##h1".
*/
const hasException = rule.domains.children.some((d) => d.exception);
if (hasException) {
// Single exception domain with path — just skip conversion
if (rule.domains.children.length === 1) {
return undefined;
}
// Domain list with both exception and path-in-domain — error
throw new RuleConversionError('Path-in-domain syntax cannot be used with exception domains');
}
// Check for conflicting $path modifier
if (rule.modifiers) {
const hasPathModifier = rule.modifiers.children.some((mod) => mod.name.value === constants/* .ADG_PATH_MODIFIER */.JD);
if (hasPathModifier) {
throw new RuleConversionError('Path specified both in domain and $path modifier');
}
}
// Group domains by path
const pathGroups = new Map();
domainsWithPaths.forEach(({ domain, path, exception }) => {
if (!pathGroups.has(path)) {
pathGroups.set(path, []);
}
pathGroups.get(path).push({ domain, exception });
});
// If all domains have the same path and there are no domains without paths,
// create a single rule with $path modifier
if (pathGroups.size === 1 && domainsWithoutPaths.length === 0) {
const [path, domains] = Array.from(pathGroups.entries())[0];
const convertedRule = clone(rule);
// Set syntax to Adg since we're adding AdGuard modifiers
convertedRule.syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
// Update domains to remove paths
convertedRule.domains = {
type: nodes/* .ListNodeType.DomainList */.h6.DomainList,
separator: rule.domains.separator,
children: domains.map((d) => ({
type: nodes/* .ListItemNodeType.Domain */.WR.Domain,
value: d.domain,
exception: d.exception,
})),
};
// Add $path modifier
const pathModifier = createModifierNode(constants/* .ADG_PATH_MODIFIER */.JD, path);
if (convertedRule.modifiers) {
convertedRule.modifiers = {
...convertedRule.modifiers,
children: [...convertedRule.modifiers.children, pathModifier],
};
}
else {
convertedRule.modifiers = {
type: 'ModifierList',
children: [pathModifier],
};
}
return (0,conversion_result/* .createNodeConversionResult */.k)([convertedRule], true);
}
// Multiple paths or mixed (with/without paths) - split into multiple rules
const convertedRules = [];
// Create rules for domains with paths
pathGroups.forEach((domains, path) => {
const convertedRule = clone(rule);
// Set syntax to Adg since we're adding AdGuard modifiers
convertedRule.syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
// Set domains for this path
convertedRule.domains = {
type: 'DomainList',
separator: rule.domains.separator,
children: domains.map((d) => ({
type: 'Domain',
value: d.domain,
exception: d.exception,
})),
};
// Add $path modifier
const pathModifier = createModifierNode(constants/* .ADG_PATH_MODIFIER */.JD, path);
if (convertedRule.modifiers) {
convertedRule.modifiers = {
...convertedRule.modifiers,
children: [...convertedRule.modifiers.children, pathModifier],
};
}
else {
convertedRule.modifiers = {
type: 'ModifierList',
children: [pathModifier],
};
}
convertedRules.push(convertedRule);
});
// Create rule for domains without paths (if any)
if (domainsWithoutPaths.length > 0) {
const convertedRule = clone(rule);
convertedRule.domains = {
type: 'DomainList',
separator: rule.domains.separator,
children: domainsWithoutPaths.map((d) => ({
type: 'Domain',
value: d.domain,
exception: d.exception,
})),
};
convertedRules.push(convertedRule);
}
return (0,conversion_result/* .createNodeConversionResult */.k)(convertedRules, true);
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/multi-value-map.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* A very simple map extension that allows to store multiple values for the same key
* by storing them in an array.
*
* @todo Add more methods if needed.
*/
class MultiValueMap extends Map {
/**
* Adds a value to the map. If the key already exists, the value will be appended to the existing array,
* otherwise a new array will be created for the key.
*
* @param key Key to add.
* @param values Value(s) to add.
*/
add(key, ...values) {
let currentValues = super.get(key);
if ((0,type_guards/* .isUndefined */.b0)(currentValues)) {
currentValues = [];
super.set(key, values);
}
currentValues.push(...values);
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/rule-modifiers/adg.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Cosmetic rule modifier converter from uBO to ADG.
*/
const UBO_MATCHES_PATH_OPERATOR = 'matches-path';
const ADG_PATH_MODIFIER = 'path';
/**
* Special characters in modifier regexps that should be escaped.
*/
const SPECIAL_MODIFIER_REGEX_CHARS = new Set([
constants/* .OPEN_SQUARE_BRACKET */.cU,
constants/* .CLOSE_SQUARE_BRACKET */.A1,
constants/* .COMMA */.KE,
constants/* .ESCAPE_CHARACTER */.Kx,
]);
/**
* Helper class for converting cosmetic rule modifiers from uBO to ADG.
*/
class AdgCosmeticRuleModifierConverter {
/**
* Converts a uBO cosmetic rule modifier list to ADG, if possible.
*
* @see {@link https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#cosmetic-filter-operators}
*
* @param modifierList Cosmetic rule modifier list node to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the modifier list cannot be converted.
*/
static convertFromUbo(modifierList) {
const conversionMap = new MultiValueMap();
modifierList.children.forEach((modifier, index) => {
// :matches-path
if (modifier.name.value === UBO_MATCHES_PATH_OPERATOR) {
if (!modifier.value) {
throw new RuleConversionError(`'${UBO_MATCHES_PATH_OPERATOR}' operator requires a value`);
}
const value = regexp/* .RegExpUtils.isRegexPattern */.Lp.isRegexPattern(modifier.value.value)
? string/* .StringUtils.escapeCharacters */.$x.escapeCharacters(modifier.value.value, SPECIAL_MODIFIER_REGEX_CHARS)
: modifier.value.value;
// Convert uBO's `:matches-path(...)` operator to ADG's `$path=...` modifier
conversionMap.add(index, createModifierNode(ADG_PATH_MODIFIER,
// We should negate the regexp if the modifier is an exception
modifier.exception
// eslint-disable-next-line max-len
? `${constants/* .REGEX_MARKER */.Vb}${regexp/* .RegExpUtils.negateRegexPattern */.Lp.negateRegexPattern(regexp/* .RegExpUtils.patternToRegexp */.Lp.patternToRegexp(value))}${constants/* .REGEX_MARKER */.Vb}`
: value));
}
});
// Check if we have any converted modifiers
if (conversionMap.size) {
const modifierListClone = clone(modifierList);
// Replace the original modifiers with the converted ones
modifierListClone.children = modifierListClone.children.map((modifier, index) => {
const convertedModifier = conversionMap.get(index);
return convertedModifier ?? modifier;
}).flat();
return (0,conversion_result/* .createConversionResult */.c)(modifierListClone, true);
}
// Otherwise, just return the original modifier list
return (0,conversion_result/* .createConversionResult */.c)(modifierList, false);
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/domain-list-parser.js + 1 modules
var domain_list_parser = __webpack_require__(70254);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/rule-modifiers/ubo.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Cosmetic rule modifier converter from ADG to uBO.
*/
/**
* Regular expression pattern for matching the main page
* https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#subjectmatches-patharg.
*/
const UBO_MAIN_PAGE_MATCHER = '/^/$/';
/**
* Special characters in modifier regexps that should be escaped.
*/
const ubo_SPECIAL_MODIFIER_REGEX_CHARS = new Set([
constants/* .OPEN_SQUARE_BRACKET */.cU,
constants/* .CLOSE_SQUARE_BRACKET */.A1,
constants/* .COMMA_DOMAIN_LIST_SEPARATOR */.oo,
constants/* .ESCAPE_CHARACTER */.Kx,
]);
/**
* Helper class for converting cosmetic rule modifiers from ADG to uBO.
*/
class UboCosmeticRuleModifierConverter {
/**
* Converts a ADG cosmetic rule modifier list to uBO, if possible.
*
* @see {@link https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#cosmetic-filter-operators}
*
* @param modifierList Cosmetic rule modifier list node to convert.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the modifier list cannot be converted.
*/
static convertFromAdg(modifierList) {
const conversionMap = new MultiValueMap();
let domainList = null;
let regexDomainValue;
modifierList.children.forEach((modifier, index) => {
let value;
let { exception } = modifier;
switch (modifier.name.value) {
// Special case: ADG's $app modifier
case constants/* .ADG_APP_MODIFIER */.Pe:
throw new Error('The $app modifier is not supported by uBO');
// Special case: ADG's $domains modifier
case constants/* .ADG_DOMAINS_MODIFIER */.NW:
if (!domainList) {
domainList = {
type: nodes/* .ListNodeType.DomainList */.h6.DomainList,
separator: constants/* .COMMA_DOMAIN_LIST_SEPARATOR */.oo,
children: [],
start: modifier.start,
end: modifier.end,
};
}
if (!modifier?.value?.value) {
return;
}
domainList = domain_list_parser/* .DomainListParser.parse */.y.parse(modifier.value.value, {}, modifier.start, constants/* .PIPE_MODIFIER_SEPARATOR */.fW);
conversionMap.add(index, null);
break;
// Special case: ADG's $url modifier
case constants/* .ADG_URL_MODIFIER */.Vw:
if (!domainList) {
domainList = {
type: nodes/* .ListNodeType.DomainList */.h6.DomainList,
separator: constants/* .COMMA_DOMAIN_LIST_SEPARATOR */.oo,
children: [],
start: modifier.start,
end: modifier.end,
};
}
if (!modifier?.value?.value) {
return;
}
regexDomainValue = regexp/* .RegExpUtils.patternToRegexp */.Lp.patternToRegexp(modifier.value.value);
domainList = {
type: nodes/* .ListNodeType.DomainList */.h6.DomainList,
separator: constants/* .COMMA_DOMAIN_LIST_SEPARATOR */.oo,
children: [
{
type: nodes/* .ListItemNodeType.Domain */.WR.Domain,
value: regexp/* .RegExpUtils.ensureSlashes */.Lp.ensureSlashes(regexDomainValue),
exception: modifier?.exception ?? false,
},
],
start: modifier.start,
end: modifier.end,
};
conversionMap.add(index, null);
break;
// Special case: ADG's $path modifier
case constants/* .ADG_PATH_MODIFIER */.JD:
if (!modifier.value) {
value = UBO_MAIN_PAGE_MATCHER;
}
else if (regexp/* .RegExpUtils.isNegatedRegexPattern */.Lp.isNegatedRegexPattern(modifier.value.value)) {
exception = true;
value = string/* .StringUtils.escapeCharacters */.$x.escapeCharacters(regexp/* .RegExpUtils.removeNegationFromRegexPattern */.Lp.removeNegationFromRegexPattern(modifier.value.value), ubo_SPECIAL_MODIFIER_REGEX_CHARS);
}
else {
value = regexp/* .RegExpUtils.isRegexPattern */.Lp.isRegexPattern(modifier.value.value)
? string/* .StringUtils.escapeCharacters */.$x.escapeCharacters(modifier.value.value, ubo_SPECIAL_MODIFIER_REGEX_CHARS)
: modifier.value.value;
}
conversionMap.add(index, createModifierNode(constants/* .UBO_MATCHES_PATH_OPERATOR */.I6, value, exception));
break;
}
});
// Check if we have any converted modifiers
if (conversionMap.size) {
const modifierListClone = clone(modifierList);
// Replace the original modifiers with the converted ones
modifierListClone.children = modifierListClone.children
.map((modifier, index) => {
const convertedModifier = conversionMap.get(index);
return convertedModifier ?? modifier;
})
.flat()
.filter((modifier) => modifier !== null);
return (0,conversion_result/* .createConversionResult */.c)({ modifierList: modifierListClone, domains: domainList || undefined }, true);
}
// Otherwise, just return the original modifier list without any changes
return (0,conversion_result/* .createConversionResult */.c)({ modifierList, domains: undefined }, false);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/ast-utils/scriptlets.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for working with scriptlet nodes.
*/
/**
* Get name of the scriptlet from the scriptlet node.
*
* @param scriptletNode Scriptlet node to get name of.
*
* @returns Name of the scriptlet.
*
* @throws If the scriptlet is empty.
*/
function getScriptletName(scriptletNode) {
if (scriptletNode.children.length === 0) {
throw new Error('Empty scriptlet');
}
return scriptletNode.children[0]?.value ?? constants/* .EMPTY */.wg;
}
/**
* Transform the nth argument of the scriptlet node.
*
* @param scriptletNode Scriptlet node to transform argument of.
* @param index Index of the argument to transform (index 0 is the scriptlet name).
* @param transform Function to transform the argument.
*/
function transformNthScriptletArgument(scriptletNode, index, transform) {
const child = scriptletNode.children[index];
if (!(0,type_guards/* .isUndefined */.b0)(child)) {
const transformed = transform(child?.value ?? null);
if ((0,type_guards/* .isNull */.kZ)(transformed)) {
// eslint-disable-next-line no-param-reassign
scriptletNode.children[index] = null;
return;
}
if ((0,type_guards/* .isNull */.kZ)(child)) {
// eslint-disable-next-line no-param-reassign
scriptletNode.children[index] = {
type: 'Value',
value: transformed,
};
return;
}
child.value = transformed;
}
}
/**
* Transform all arguments of the scriptlet node.
*
* @param scriptletNode Scriptlet node to transform arguments of.
* @param transform Function to transform the arguments.
*/
function transformAllScriptletArguments(scriptletNode, transform) {
for (let i = 0; i < scriptletNode.children.length; i += 1) {
transformNthScriptletArgument(scriptletNode, i, transform);
}
}
/**
* Set name of the scriptlet.
* Modifies input `scriptletNode` if needed.
*
* @param scriptletNode Scriptlet node to set name of.
* @param name Name to set.
*/
function setScriptletName(scriptletNode, name) {
transformNthScriptletArgument(scriptletNode, 0, () => name);
}
/**
* Set quote type of the scriptlet parameters.
*
* @param scriptletNode Scriptlet node to set quote type of.
* @param quoteType Preferred quote type.
*/
function setScriptletQuoteType(scriptletNode, quoteType) {
// null is a special value that means "no value", but we can't change its quote type,
// so we need to convert it to empty string
transformAllScriptletArguments(scriptletNode, (value) => quotes/* .QuoteUtils.setStringQuoteType */.Qj.setStringQuoteType(value ?? constants/* .EMPTY */.wg, quoteType));
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/deep-freeze.js
var deep_freeze = __webpack_require__(41666);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/base.js + 1 modules
var base = __webpack_require__(21565);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/compatibility-table-data.js
var compatibility_table_data = __webpack_require__(33017);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/scriptlets.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Compatibility tables for scriptlets.
*/
/**
* Compatibility table for scriptlets.
*/
class ScriptletsCompatibilityTable extends base/* .CompatibilityTableBase */.E {
}
/**
* Deep freeze the compatibility table data to avoid accidental modifications.
*/
(0,deep_freeze/* .deepFreeze */.o)(compatibility_table_data/* .scriptletsCompatibilityTableData */.YJ);
/**
* Compatibility table instance for scriptlets.
*/
const scriptletsCompatibilityTable = new ScriptletsCompatibilityTable(compatibility_table_data/* .scriptletsCompatibilityTableData */.YJ);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/platforms.js
var platforms = __webpack_require__(9257);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/scriptlet.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Scriptlet injection rule converter.
*/
const ABP_SCRIPTLET_PREFIX = 'abp-';
const UBO_SCRIPTLET_PREFIX = 'ubo-';
const UBO_SCRIPTLET_PREFIX_LENGTH = UBO_SCRIPTLET_PREFIX.length;
const UBO_SCRIPTLET_JS_SUFFIX = '.js';
const UBO_SCRIPTLET_JS_SUFFIX_LENGTH = UBO_SCRIPTLET_JS_SUFFIX.length;
const COMMA_SEPARATOR = ',';
const ADG_SET_CONSTANT_NAME = 'set-constant';
const ADG_SET_CONSTANT_EMPTY_STRING = '';
const ADG_SET_CONSTANT_EMPTY_ARRAY = 'emptyArr';
const ADG_SET_CONSTANT_EMPTY_OBJECT = 'emptyObj';
const UBO_SET_CONSTANT_EMPTY_STRING = '\'\'';
const UBO_SET_CONSTANT_EMPTY_ARRAY = '[]';
const UBO_SET_CONSTANT_EMPTY_OBJECT = '{}';
const ADG_PREVENT_FETCH_NAME = 'prevent-fetch';
const ADG_PREVENT_FETCH_EMPTY_STRING = '';
const ADG_PREVENT_FETCH_WILDCARD = '*';
const UBO_NO_FETCH_IF_WILDCARD = '/^/';
const UBO_REMOVE_CLASS_NAME = 'remove-class.js';
const UBO_REMOVE_ATTR_NAME = 'remove-attr.js';
const UBO_JSON_PRUNE_FETCH_RESPONSE_NAME = 'json-prune-fetch-response.js';
const UBO_JSON_PRUNE_XHR_RESPONSE_NAME = 'json-prune-xhr-response.js';
const UBO_PRUNE_RESPONSE_PROPS_TO_MATCH_KEY = 'propsToMatch';
const UBO_PRUNE_RESPONSE_STACK_TO_MATCH_KEY = 'stackToMatch';
const ADG_PRUNE_FETCH_RESPONSE_NAME = UBO_JSON_PRUNE_FETCH_RESPONSE_NAME.slice(0, -UBO_SCRIPTLET_JS_SUFFIX_LENGTH);
const ADG_PRUNE_XHR_RESPONSE_NAME = UBO_JSON_PRUNE_XHR_RESPONSE_NAME.slice(0, -UBO_SCRIPTLET_JS_SUFFIX_LENGTH);
const setConstantAdgToUboMap = {
[ADG_SET_CONSTANT_EMPTY_STRING]: UBO_SET_CONSTANT_EMPTY_STRING,
[ADG_SET_CONSTANT_EMPTY_ARRAY]: UBO_SET_CONSTANT_EMPTY_ARRAY,
[ADG_SET_CONSTANT_EMPTY_OBJECT]: UBO_SET_CONSTANT_EMPTY_OBJECT,
};
const REMOVE_ATTR_CLASS_APPLYING = new Set([
'asap',
'stay',
'complete',
]);
/**
* Scriptlet injection rule converter class.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class ScriptletRuleConverter extends RuleConverterBase {
/**
* Converts a scriptlet injection rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
// Ignore AdGuard rules
if (rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
const separator = rule.separator.value;
let convertedSeparator = separator;
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.AdgJsInjectionException */.p5.AdgJsInjectionException
: nodes/* .CosmeticRuleSeparator.AdgJsInjection */.p5.AdgJsInjection;
const convertedScriptlets = [];
for (const scriptlet of rule.body.children) {
// Clone the node to avoid any side effects
const scriptletClone = cloneScriptletRuleNode(scriptlet);
// Remove possible quotes just to make it easier to work with the scriptlet name
const scriptletName = quotes/* .QuoteUtils.setStringQuoteType */.Qj.setStringQuoteType(getScriptletName(scriptletClone), quotes/* .QuoteType.None */.XA.None);
// Add prefix if it's not already there
let prefix;
// In uBO / ABP syntax, if a parameter contains the separator character, it should be escaped,
// but during the conversion, we need to unescape them, because AdGuard syntax uses quotes to
// distinguish between parameters.
let charToUnescape;
switch (rule.syntax) {
case adblockers/* .AdblockSyntax.Abp */.YG.Abp:
prefix = ABP_SCRIPTLET_PREFIX;
charToUnescape = constants/* .SPACE */.t6;
break;
case adblockers/* .AdblockSyntax.Ubo */.YG.Ubo:
prefix = UBO_SCRIPTLET_PREFIX;
charToUnescape = COMMA_SEPARATOR;
break;
default:
prefix = constants/* .EMPTY */.wg;
}
if (!scriptletName.startsWith(prefix)) {
setScriptletName(scriptletClone, `${prefix}${scriptletName}`);
}
if (!(0,type_guards/* .isUndefined */.b0)(charToUnescape)) {
transformAllScriptletArguments(scriptletClone, (value) => {
if (!(0,type_guards/* .isNull */.kZ)(value)) {
return quotes/* .QuoteUtils.unescapeSingleEscapedOccurrences */.Qj.unescapeSingleEscapedOccurrences(value, charToUnescape);
}
return value;
});
}
if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
const scriptletData = scriptletsCompatibilityTable.getFirst(scriptletName, platforms/* .GenericPlatform.UboAny */.p.UboAny);
// Some scriptlets have special values that need to be converted
if (scriptletData
&& (scriptletData.name === UBO_REMOVE_CLASS_NAME
|| scriptletData.name === UBO_REMOVE_ATTR_NAME)
&& scriptletClone.children.length > 2) {
const selectors = [];
let applying = null;
let lastArg = scriptletClone.children.pop();
// The very last argument might be the 'applying' parameter
if (lastArg) {
if (REMOVE_ATTR_CLASS_APPLYING.has(lastArg.value)) {
applying = lastArg.value;
}
else {
selectors.push(lastArg.value);
}
}
while (scriptletClone.children.length > 2) {
lastArg = scriptletClone.children.pop();
if (lastArg) {
selectors.push(lastArg.value.trim());
}
}
// Set last arg to be the combined selectors (in reverse order, because we popped them)
if (selectors.length > 0) {
scriptletClone.children.push({
type: 'Value',
value: selectors.reverse().join(', '),
});
}
// Push back the 'applying' parameter if it was found previously
if (!(0,type_guards/* .isNull */.kZ)(applying)) {
// If we don't have any selectors,
// we need to add an empty parameter before the 'applying' one
if (selectors.length === 0) {
scriptletClone.children.push({
type: 'Value',
value: constants/* .EMPTY */.wg,
});
}
scriptletClone.children.push({
type: 'Value',
value: applying,
});
}
}
// Remap uBO prune-response scriptlet key/value args into ADG positional slots.
// https://github.com/AdguardTeam/FiltersCompiler/issues/250
if (scriptletData) {
ScriptletRuleConverter.remapUboPruneResponseArgs(scriptletClone, scriptletData);
}
}
// ADG scriptlet parameters should be quoted, and single quoted are preferred
setScriptletQuoteType(scriptletClone, quotes/* .QuoteType.Single */.XA.Single);
convertedScriptlets.push(scriptletClone);
}
if (rule.body.children.length === 0) {
const convertedScriptletNode = {
category: rule.category,
type: rule.type,
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
exception: rule.exception,
domains: cloneDomainListNode(rule.domains),
separator: {
type: 'Value',
value: convertedSeparator,
},
body: {
type: rule.body.type,
children: [],
},
};
if (rule.modifiers) {
convertedScriptletNode.modifiers = cloneModifierListNode(rule.modifiers);
}
return (0,conversion_result/* .createNodeConversionResult */.k)([convertedScriptletNode], true);
}
return (0,conversion_result/* .createNodeConversionResult */.k)(convertedScriptlets.map((scriptlet) => {
const res = {
category: rule.category,
type: rule.type,
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
exception: rule.exception,
domains: cloneDomainListNode(rule.domains),
separator: {
type: 'Value',
value: convertedSeparator,
},
body: {
type: rule.body.type,
children: [scriptlet],
},
};
if (rule.modifiers) {
res.modifiers = cloneModifierListNode(rule.modifiers);
}
return res;
}), true);
}
/**
* Converts a scriptlet injection rule to uBlock format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToUbo(rule) {
// Ignore uBlock rules
if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
let ruleDomainsList = cloneDomainListNode(rule.domains);
if (rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg && rule.modifiers?.children.length) {
const { modifiers } = rule;
// Validate modifiers structure
if (!modifiers || !modifiers.children || modifiers.children.length === 0) {
throw new RuleConversionError('Invalid modifiers in AdGuard rule.');
}
// Check for single domain modifier
const [domainModifier] = modifiers.children;
const hasSingleDomainModifier = (modifiers.children.length === 1
&& domainModifier.name?.value === constants/* .ADG_DOMAINS_MODIFIER */.NW
&& domainModifier.value?.value);
if (!hasSingleDomainModifier) {
throw new RuleConversionError('uBlock Origin scriptlet injection rules do not support cosmetic rule modifiers.');
}
// Validate domain modifier
if (!domainModifier.value?.value) {
throw new RuleConversionError('Invalid domain modifier in AdGuard rule.');
}
// Parse domain list
const parsedDomainList = domain_list_parser/* .DomainListParser.parse */.y.parse(domainModifier.value.value, {}, domainModifier.start, constants/* .PIPE_MODIFIER_SEPARATOR */.fW);
// Merge domain lists
if (ruleDomainsList) {
ruleDomainsList.children.push(...parsedDomainList.children);
}
else {
ruleDomainsList = parsedDomainList;
}
}
const separator = rule.separator.value;
let convertedSeparator = separator;
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.ElementHidingException */.p5.ElementHidingException
: nodes/* .CosmeticRuleSeparator.ElementHiding */.p5.ElementHiding;
const convertedScriptlets = [];
for (const scriptlet of rule.body.children) {
// Clone the node to avoid any side effects
const scriptletClone = cloneScriptletRuleNode(scriptlet);
// Remove possible quotes just to make it easier to work with the scriptlet name
const scriptletName = quotes/* .QuoteUtils.setStringQuoteType */.Qj.setStringQuoteType(getScriptletName(scriptletClone), quotes/* .QuoteType.None */.XA.None);
let uboScriptletName;
if (rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg && scriptletName.startsWith(UBO_SCRIPTLET_PREFIX)) {
// Special case: AdGuard syntax 'preserves' the original scriptlet name,
// so we need to convert it back by removing the uBO prefix
uboScriptletName = scriptletName.slice(UBO_SCRIPTLET_PREFIX_LENGTH);
}
else {
// Otherwise, try to find the corresponding uBO scriptlet name, or use the original one if not found
const uboScriptlet = scriptletsCompatibilityTable.getFirst(scriptletName, platforms/* .GenericPlatform.UboAny */.p.UboAny);
if (!uboScriptlet) {
throw new RuleConversionError(`Scriptlet "${scriptletName}" is not supported in uBlock Origin.`);
}
uboScriptletName = uboScriptlet.name;
}
// Remove the '.js' suffix if it's there - its presence is not mandatory
if (uboScriptletName.endsWith(UBO_SCRIPTLET_JS_SUFFIX)) {
uboScriptletName = uboScriptletName.slice(0, -UBO_SCRIPTLET_JS_SUFFIX_LENGTH);
}
setScriptletName(scriptletClone, uboScriptletName);
setScriptletQuoteType(scriptletClone, quotes/* .QuoteType.None */.XA.None);
// Escape unescaped commas in parameters, because uBlock Origin uses them as separators.
// For example, the following AdGuard rule:
//
// example.com#%#//scriptlet('spoof-css', '.adsbygoogle, #ads', 'visibility', 'visible')
//
// ↓↓ should be converted to ↓↓
//
// example.com##+js(spoof-css.js, .adsbygoogle\, #ads, visibility, visible)
// ------------ ------------------- ---------- -------
// arg 0 arg 1 arg 2 arg 3
//
// and we need to escape the comma in the second argument to prevent it from being treated
// as two separate arguments.
transformAllScriptletArguments(scriptletClone, (value) => {
if (!(0,type_guards/* .isNull */.kZ)(value)) {
return quotes/* .QuoteUtils.escapeUnescapedOccurrences */.Qj.escapeUnescapedOccurrences(value, COMMA_SEPARATOR);
}
return value;
});
// Unescape spaces in parameters, because uBlock Origin doesn't treat them as separators.
if (rule.syntax === adblockers/* .AdblockSyntax.Abp */.YG.Abp) {
transformAllScriptletArguments(scriptletClone, (value) => {
if (!(0,type_guards/* .isNull */.kZ)(value)) {
return quotes/* .QuoteUtils.unescapeSingleEscapedOccurrences */.Qj.unescapeSingleEscapedOccurrences(value, constants/* .SPACE */.t6);
}
return value;
});
}
// Some scriptlets have special values that need to be converted
switch (scriptletName) {
case ADG_SET_CONSTANT_NAME:
transformNthScriptletArgument(scriptletClone, 2, (value) => {
if (!(0,type_guards/* .isNull */.kZ)(value)) {
return setConstantAdgToUboMap[value] ?? value;
}
return value;
});
break;
case ADG_PREVENT_FETCH_NAME:
transformNthScriptletArgument(scriptletClone, 1, (value) => {
if (value === ADG_PREVENT_FETCH_EMPTY_STRING || value === ADG_PREVENT_FETCH_WILDCARD) {
return UBO_NO_FETCH_IF_WILDCARD;
}
return value;
});
break;
case ADG_PRUNE_FETCH_RESPONSE_NAME:
case ADG_PRUNE_XHR_RESPONSE_NAME:
ScriptletRuleConverter.remapAdgToUboPruneResponseArgs(scriptletClone);
break;
}
convertedScriptlets.push(scriptletClone);
}
// TODO: Refactor redundant code
if (rule.body.children.length === 0) {
const convertedScriptletNode = {
category: rule.category,
type: rule.type,
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
exception: rule.exception,
domains: cloneDomainListNode(rule.domains),
separator: {
type: 'Value',
value: convertedSeparator,
},
body: {
type: rule.body.type,
children: [],
},
};
if (rule.modifiers) {
convertedScriptletNode.modifiers = cloneModifierListNode(rule.modifiers);
}
return (0,conversion_result/* .createNodeConversionResult */.k)([convertedScriptletNode], true);
}
return (0,conversion_result/* .createNodeConversionResult */.k)(convertedScriptlets.map((scriptlet) => {
const res = {
category: rule.category,
type: rule.type,
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
exception: rule.exception,
domains: ruleDomainsList,
separator: {
type: 'Value',
value: convertedSeparator,
},
body: {
type: rule.body.type,
children: [scriptlet],
},
};
return res;
}), true);
}
/**
* Remaps uBO key/value args of `json-prune-fetch-response` and
* `json-prune-xhr-response` into AdGuard positional argument slots.
*
* These uBO variants accept only two positional args (`propsToRemove`,
* `obligatoryProps`); args 3+ are key/value pairs parsed by uBO's
* `getExtraArgs` (even index = key, odd index = value). Recognized keys:
* `propsToMatch`, `stackToMatch`. ADG's equivalents use positional
* `propsToMatch` (arg 3) and `stack` (arg 4), so the pairs are remapped into
* positional slots. Unknown keys are dropped, because uBO ignores keys it
* does not read and they cannot be mapped to an ADG positional slot. When a
* recognized key repeats, the last value wins.
*
* Besides remapping arguments, this method also sets the scriptlet node's
* name to the AdGuard native name (the uBO canonical name without the
* `.js` suffix). This overrides the `ubo-` prefix that `convertToAdg`
* adds earlier in its main flow for these two scriptlets, so the final
* output uses the native AdGuard name with positional argument semantics.
*
* @see https://github.com/AdguardTeam/FiltersCompiler/issues/250
*
* @param scriptletClone Cloned scriptlet node to remap in place.
* @param scriptletData Compatibility data for the matched uBO scriptlet.
*/
static remapUboPruneResponseArgs(scriptletClone, scriptletData) {
// Only the two prune-response scriptlets need key/value → positional remapping.
if (scriptletData.name !== UBO_JSON_PRUNE_FETCH_RESPONSE_NAME
&& scriptletData.name !== UBO_JSON_PRUNE_XHR_RESPONSE_NAME) {
return;
}
const propsToRemove = scriptletClone.children[1]?.value ?? constants/* .EMPTY */.wg;
const obligatoryProps = scriptletClone.children[2]?.value ?? constants/* .EMPTY */.wg;
// Whether the source had an explicit 2nd positional arg (children[2]).
const hadObligatoryProps = scriptletClone.children.length > 2;
let propsToMatch = constants/* .EMPTY */.wg;
let stack = constants/* .EMPTY */.wg;
const unknownKeys = [];
// Varargs start at index 3 (children[0] is the scriptlet name).
for (let i = 3; i < scriptletClone.children.length; i += 2) {
const key = scriptletClone.children[i]?.value ?? constants/* .EMPTY */.wg;
const val = scriptletClone.children[i + 1]?.value ?? constants/* .EMPTY */.wg;
if (key === UBO_PRUNE_RESPONSE_PROPS_TO_MATCH_KEY) {
propsToMatch = val;
}
else if (key === UBO_PRUNE_RESPONSE_STACK_TO_MATCH_KEY) {
stack = val;
}
else if (key !== constants/* .EMPTY */.wg) {
// Unknown keys are dropped: uBO ignores keys it does not read,
// and they cannot be mapped to an ADG positional slot.
unknownKeys.push(key);
}
}
if (unknownKeys.length > 0) {
// eslint-disable-next-line no-console
console.warn(`[agtree] Dropped unknown extra args for ${scriptletData.name}: ${unknownKeys.join(', ')}`);
}
// Translate to the ADG native name (uBO canonical name without the
// `.js` suffix): the arguments are now in ADG positional semantics.
const adgName = scriptletData.name.slice(0, -UBO_SCRIPTLET_JS_SUFFIX_LENGTH);
setScriptletName(scriptletClone, adgName);
// Rebuild children: name, propsToRemove, then the obligatoryProps,
// propsToMatch and stack slots. `obligatoryProps` is emitted only when
// it was present in the source or when a positional propsToMatch/stack
// slot follows, so the output never gains a trailing empty arg the
// source never had.
// eslint-disable-next-line no-param-reassign
scriptletClone.children = [
scriptletClone.children[0],
{ type: 'Value', value: propsToRemove },
];
if (hadObligatoryProps || propsToMatch !== constants/* .EMPTY */.wg || stack !== constants/* .EMPTY */.wg) {
scriptletClone.children.push({ type: 'Value', value: obligatoryProps });
}
if (propsToMatch !== constants/* .EMPTY */.wg || stack !== constants/* .EMPTY */.wg) {
scriptletClone.children.push({ type: 'Value', value: propsToMatch });
}
if (stack !== constants/* .EMPTY */.wg) {
scriptletClone.children.push({ type: 'Value', value: stack });
}
}
/**
* Inverse of {@link ScriptletRuleConverter.remapUboPruneResponseArgs}:
* remaps AdGuard positional `propsToMatch`/`stack` args of
* `json-prune-fetch-response` / `json-prune-xhr-response` back into uBO
* key/value pairs (`propsToMatch`, `stackToMatch`).
*
* `children` layout (AdGuard, before this method): `[name, propsToRemove,
* obligatoryProps, propsToMatch, stack]`. `propsToMatch` and `stack` are
* optional; empty values are not re-emitted, so the output never has
* trailing empty key/value pairs. ADG rules that already use the
* `ubo-`-prefixed name keep key/value args and are not handled here (they
* take the `ubo-` prefix branch in `convertToUbo`, not this `switch`).
*
* @param scriptletClone Cloned scriptlet node to remap in place.
*/
static remapAdgToUboPruneResponseArgs(scriptletClone) {
// Read the positional propsToMatch/stack before truncating children.
const propsToMatchVal = scriptletClone.children[3]?.value;
const stackVal = scriptletClone.children[4]?.value;
// Keep the name and the two positional args; drop the positional
// propsToMatch/stack slots — they are re-emitted as uBO key/value pairs.
// eslint-disable-next-line no-param-reassign
scriptletClone.children = scriptletClone.children.slice(0, Math.min(3, scriptletClone.children.length));
if (propsToMatchVal && propsToMatchVal !== constants/* .EMPTY */.wg) {
scriptletClone.children.push({ type: 'Value', value: UBO_PRUNE_RESPONSE_PROPS_TO_MATCH_KEY });
scriptletClone.children.push({ type: 'Value', value: propsToMatchVal });
}
if (stackVal && stackVal !== constants/* .EMPTY */.wg) {
scriptletClone.children.push({ type: 'Value', value: UBO_PRUNE_RESPONSE_STACK_TO_MATCH_KEY });
scriptletClone.children.push({ type: 'Value', value: stackVal });
}
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/cosmetic/index.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Cosmetic rule converter.
*/
/**
* Cosmetic rule converter class (also known as "non-basic rule converter").
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class CosmeticRuleConverter extends RuleConverterBase {
/**
* Converts a cosmetic rule to AdGuard syntax, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
let subconverterResult;
// Convert cosmetic rule based on its type
switch (rule.type) {
case nodes/* .CosmeticRuleType.ElementHidingRule */.k9.ElementHidingRule:
subconverterResult = ElementHidingRuleConverter.convertToAdg(rule);
break;
case nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule:
subconverterResult = ScriptletRuleConverter.convertToAdg(rule);
break;
case nodes/* .CosmeticRuleType.CssInjectionRule */.k9.CssInjectionRule:
subconverterResult = CssInjectionRuleConverter.convertToAdg(rule);
break;
case nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule:
// Handle special case: uBO response header filtering rule
// TODO: Optimize double CSS tokenization here
subconverterResult = HeaderRemovalRuleConverter.convertToAdg(rule);
if (subconverterResult.isConverted) {
break;
}
subconverterResult = HtmlRuleConverter.convertToAdg(rule);
break;
// Note: Currently, only ADG supports JS injection rules, so we don't need to convert them
case nodes/* .CosmeticRuleType.JsInjectionRule */.k9.JsInjectionRule:
subconverterResult = (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
break;
default:
throw new RuleConversionError('Unsupported cosmetic rule type');
}
let convertedModifiers;
// Convert cosmetic rule modifiers, if any
if (rule.modifiers) {
if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
// uBO doesn't support this rule:
// example.com##+js(set-constant.js, foo, bar):matches-path(/baz)
if (rule.type === nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule) {
throw new RuleConversionError('uBO scriptlet injection rules don\'t support cosmetic rule modifiers');
}
convertedModifiers = AdgCosmeticRuleModifierConverter.convertFromUbo(rule.modifiers);
}
else if (rule.syntax === adblockers/* .AdblockSyntax.Abp */.YG.Abp) {
// TODO: Implement once ABP starts supporting cosmetic rule modifiers
throw new RuleConversionError('ABP don\'t support cosmetic rule modifiers');
}
}
// Track if any conversion happened
const wasConverted = subconverterResult.result.length > 1
|| subconverterResult.isConverted
|| (convertedModifiers && convertedModifiers.isConverted);
if (wasConverted) {
// Add modifier list to the subconverter result rules
subconverterResult.result.forEach((subconverterRule) => {
if (convertedModifiers && subconverterRule.category === nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic) {
// eslint-disable-next-line no-param-reassign
subconverterRule.modifiers = convertedModifiers.result;
}
});
}
// Apply path-in-domain conversion to all rules
const rulesToProcess = wasConverted ? subconverterResult.result : [rule];
const finalRules = [];
let pathConversionHappened = false;
for (const ruleToProcess of rulesToProcess) {
if (ruleToProcess.category === nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic) {
const pathConversionResult = convertPathInDomainToModifier(ruleToProcess);
if (pathConversionResult) {
finalRules.push(...pathConversionResult.result);
pathConversionHappened = true;
}
else {
finalRules.push(ruleToProcess);
}
}
else {
finalRules.push(ruleToProcess);
}
}
// Return result with combined conversion status
if (wasConverted || pathConversionHappened) {
return (0,conversion_result/* .createNodeConversionResult */.k)(finalRules, true);
}
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
/**
* Converts a cosmetic rule to uBlock Origin syntax, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToUbo(rule) {
// Skip conversation if the rule is already in uBO format
if (rule.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
// TODO: Add support for other cosmetic rule types
switch (rule.type) {
case nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule:
return HtmlRuleConverter.convertToUbo(rule);
case nodes/* .CosmeticRuleType.ElementHidingRule */.k9.ElementHidingRule: {
// Check if the rule is a simple hiding rule
// TODO: Handle elemhide rules with extended CSS pseudos even if type is not marked explicitly
const isElementHidingRule = (rule.separator.value === nodes/* .CosmeticRuleSeparator.ElementHidingException */.p5.ElementHidingException
|| rule.separator.value === nodes/* .CosmeticRuleSeparator.ElementHiding */.p5.ElementHiding);
if (isElementHidingRule && !rule.modifiers) {
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
break;
}
case nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule:
return ScriptletRuleConverter.convertToUbo(rule);
case nodes/* .CosmeticRuleType.JsInjectionRule */.k9.JsInjectionRule:
throw new RuleConversionError('uBO does not support JS injection rules');
}
let convertedModifiers;
// Convert cosmetic rule modifiers, if any
if (rule.modifiers) {
if (rule.syntax === adblockers/* .AdblockSyntax.Abp */.YG.Abp) {
// TODO: Implement once ABP starts supporting cosmetic rule modifiers
throw new RuleConversionError('ABP does not support cosmetic rule modifiers');
}
else if (rule.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg) {
convertedModifiers = UboCosmeticRuleModifierConverter.convertFromAdg(rule.modifiers);
}
}
const result = clone(rule);
result.syntax = adblockers/* .AdblockSyntax.Ubo */.YG.Ubo;
if (convertedModifiers && convertedModifiers.isConverted) {
result.modifiers = convertedModifiers.result.modifierList;
if (convertedModifiers.result.domains) {
result.domains = convertedModifiers.result.domains;
result.domains.separator = constants/* .COMMA */.KE;
}
}
// Handle separator to uBO format
let convertedSeparator = result.separator.value;
convertedSeparator = rule.exception
? nodes/* .CosmeticRuleSeparator.ElementHidingException */.p5.ElementHidingException
: nodes/* .CosmeticRuleSeparator.ElementHiding */.p5.ElementHiding;
result.separator.value = convertedSeparator;
return (0,conversion_result/* .createNodeConversionResult */.k)([result], true);
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/modifiers.js + 1 modules
var compatibility_tables_modifiers = __webpack_require__(6674);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/redirects.js
var redirects = __webpack_require__(63780);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/compatibility-tables/utils/resource-type-helpers.js + 1 modules
var resource_type_helpers = __webpack_require__(95473);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/misc/network-rule-modifier.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Network rule modifier list converter.
*/
/**
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#csp-modifier}
*/
const CSP_MODIFIER = 'csp';
const CSP_SEPARATOR = constants/* .SEMICOLON */.I8 + constants/* .SPACE */.t6;
/**
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#csp-modifier}
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy}
*/
const COMMON_CSP_PARAMS = '\'self\' \'unsafe-eval\' http: https: data: blob: mediastream: filesystem:';
/**
* @see {@link https://help.adblockplus.org/hc/en-us/articles/360062733293#rewrite}
*/
const ABP_REWRITE_MODIFIER = 'rewrite';
/**
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#redirect-modifier}
*/
const REDIRECT_MODIFIER = 'redirect';
/**
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#redirect-rule-modifier}
*/
const REDIRECT_RULE_MODIFIER = 'redirect-rule';
/**
* @see {@link https://github.com/gorhill/uBlock/wiki/Resources-Library#empty-redirect-resources}
*/
const UBO_NOOP_TEXT_RESOURCE = 'noop.txt';
/**
* Redirect-related modifiers.
*/
const REDIRECT_MODIFIERS = new Set([
ABP_REWRITE_MODIFIER,
REDIRECT_MODIFIER,
REDIRECT_RULE_MODIFIER,
]);
/**
* Conversion map for ADG network rule modifiers.
*/
const ADG_CONVERSION_MAP = new Map([
['1p', [{ name: () => 'third-party', exception: (actual) => !actual }]],
['3p', [{ name: () => 'third-party' }]],
['css', [{ name: () => 'stylesheet' }]],
['doc', [{ name: () => 'document' }]],
['ehide', [{ name: () => 'elemhide' }]],
['empty', [{ name: () => 'redirect', value: () => 'nooptext' }]],
['first-party', [{ name: () => 'third-party', exception: (actual) => !actual }]],
['frame', [{ name: () => 'subdocument' }]],
['ghide', [{ name: () => 'generichide' }]],
['inline-font', [{ name: () => CSP_MODIFIER, value: () => `font-src ${COMMON_CSP_PARAMS}` }]],
['inline-script', [{ name: () => CSP_MODIFIER, value: () => `script-src ${COMMON_CSP_PARAMS}` }]],
['mp4', [{ name: () => 'redirect', value: () => 'noopmp4-1s' }, { name: () => 'media', value: () => undefined }]],
['queryprune', [{ name: () => 'removeparam' }]],
['shide', [{ name: () => 'specifichide' }]],
['xhr', [{ name: () => 'xmlhttprequest' }]],
]);
/**
* Helper class for converting network rule modifier lists.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class NetworkRuleModifierListConverter extends base_converter/* .BaseConverter */.I {
/**
* Converts a network rule modifier list to AdGuard format, if possible.
*
* @param modifierList Network rule modifier list node to convert.
* @param isException If `true`, the rule is an exception rule.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the conversion is not possible.
*/
static convertToAdg(modifierList, isException = false) {
const conversionMap = new MultiValueMap();
// Special case: $csp modifier
let cspCount = 0;
modifierList.children.forEach((modifierNode, index) => {
const modifierConversions = ADG_CONVERSION_MAP.get(modifierNode.name.value);
if (modifierConversions) {
for (const modifierConversion of modifierConversions) {
const name = modifierConversion.name(modifierNode.name.value);
const exception = modifierConversion.exception
// If the exception value is undefined in the original modifier, it
// means that the modifier isn't negated
? modifierConversion.exception(modifierNode.exception || false)
: modifierNode.exception;
const value = modifierConversion.value
? modifierConversion.value(modifierNode.value?.value)
: modifierNode.value?.value;
// Check if the name or the value is different from the original modifier
// If so, add the converted modifier to the list
if (name !== modifierNode.name.value || value !== modifierNode.value?.value) {
conversionMap.add(index, createModifierNode(name, value, exception));
}
// Special case: $csp modifier
if (name === CSP_MODIFIER) {
cspCount += 1;
}
}
return;
}
// Handle special case: resource redirection modifiers
if (REDIRECT_MODIFIERS.has(modifierNode.name.value)) {
// Redirect modifiers can't be negated
if (modifierNode.exception === true) {
throw new RuleConversionError(`Modifier '${modifierNode.name.value}' cannot be negated`);
}
// Convert the redirect resource name to ADG format
const redirectResource = modifierNode.value?.value;
// Special case: for exception rules, $redirect without value is allowed,
// and in this case it means an exception for all redirects
if (!redirectResource && !isException) {
throw new RuleConversionError(`No redirect resource specified for '${modifierNode.name.value}' modifier`);
}
// Leave $redirect and $redirect-rule modifiers as is, but convert $rewrite to $redirect
const modifierName = modifierNode.name.value === ABP_REWRITE_MODIFIER
? REDIRECT_MODIFIER
: modifierNode.name.value;
const convertedRedirectResource = redirectResource
? redirects/* .redirectsCompatibilityTable */.S.getFirst(redirectResource, platforms/* .GenericPlatform.AdgAny */.p.AdgAny)?.name
: undefined;
// Check if the modifier name or the redirect resource name is different from the original modifier.
// If so, add the converted modifier to the list
if (modifierName !== modifierNode.name.value
|| (convertedRedirectResource !== undefined && convertedRedirectResource !== redirectResource)) {
conversionMap.add(index, createModifierNode(modifierName,
// If the redirect resource name is unknown, fall back to the original one
// Later, the validator will throw an error if the resource name is invalid
convertedRedirectResource || redirectResource, modifierNode.exception));
}
}
});
// Prepare the result if there are any converted modifiers or $csp modifiers
if (conversionMap.size || cspCount) {
const modifierListClone = cloneModifierListNode(modifierList);
// Replace the original modifiers with the converted ones
// One modifier may be replaced with multiple modifiers, so we need to flatten the array
modifierListClone.children = modifierListClone.children.map((modifierNode, index) => {
const conversionRecord = conversionMap.get(index);
if (conversionRecord) {
return conversionRecord;
}
return modifierNode;
}).flat();
// Special case: $csp modifier: merge multiple $csp modifiers into one
// and put it at the end of the modifier list
if (cspCount) {
const cspValues = [];
modifierListClone.children = modifierListClone.children.filter((modifierNode) => {
if (modifierNode.name.value === CSP_MODIFIER) {
if (!modifierNode.value?.value) {
throw new RuleConversionError('$csp modifier value is missing');
}
cspValues.push(modifierNode.value?.value);
return false;
}
return true;
});
modifierListClone.children.push(createModifierNode(CSP_MODIFIER, cspValues.join(CSP_SEPARATOR)));
}
// Before returning the result, remove duplicated modifiers
modifierListClone.children = modifierListClone.children.filter((modifierNode, index, self) => self.findIndex((m) => m.name.value === modifierNode.name.value
&& m.exception === modifierNode.exception
&& m.value?.value === modifierNode.value?.value) === index);
return (0,conversion_result/* .createConversionResult */.c)(modifierListClone, true);
}
return (0,conversion_result/* .createConversionResult */.c)(modifierList, false);
}
/**
* Converts a network rule modifier list to uBlock format, if possible.
*
* @param modifierList Network rule modifier list node to convert.
* @param isException If `true`, the rule is an exception rule.
*
* @returns An object which follows the {@link ConversionResult} interface. Its `result` property contains
* the converted node, and its `isConverted` flag indicates whether the original node was converted.
* If the node was not converted, the result will contain the original node with the same object reference.
*
* @throws If the conversion is not possible.
*/
// TODO: Optimize
static convertToUbo(modifierList, isException = false) {
const conversionMap = new MultiValueMap();
const resourceTypeModifiersToAdd = new Set();
modifierList.children.forEach((modifierNode, index) => {
const originalModifierName = modifierNode.name.value;
const modifierData = compatibility_tables_modifiers/* .modifiersCompatibilityTable.getFirst */.Z.getFirst(originalModifierName, platforms/* .GenericPlatform.UboAny */.p.UboAny);
// Handle special case: resource redirection modifiers
if (REDIRECT_MODIFIERS.has(originalModifierName)) {
// Redirect modifiers cannot be negated
if (modifierNode.exception === true) {
throw new RuleConversionError(`Modifier '${modifierNode.name.value}' cannot be negated`);
}
// Convert the redirect resource name to uBO format
const redirectResourceName = modifierNode.value?.value;
// Special case: for exception rules, $redirect without value is allowed,
// and in this case it means an exception for all redirects
if (!redirectResourceName && !isException) {
throw new RuleConversionError(`No redirect resource specified for '${modifierNode.name.value}' modifier`);
}
if (!redirectResourceName) {
// Jump to the next modifier if the redirect resource is not specified
return;
}
// Leave $redirect and $redirect-rule modifiers as is, but convert $rewrite to $redirect
const modifierName = modifierNode.name.value === ABP_REWRITE_MODIFIER
? REDIRECT_MODIFIER
: modifierNode.name.value;
const convertedRedirectResourceData = redirects/* .redirectsCompatibilityTable.getFirst */.S.getFirst(redirectResourceName, platforms/* .GenericPlatform.UboAny */.p.UboAny);
const convertedRedirectResourceName = convertedRedirectResourceData?.name ?? redirectResourceName;
// uBlock requires the $redirect modifier to have a resource type
// https://github.com/AdguardTeam/Scriptlets/issues/101
if (convertedRedirectResourceData?.resourceTypes?.length) {
// Convert the resource types to uBO modifiers
const uboResourceTypeModifiers = redirects/* .redirectsCompatibilityTable.getResourceTypeModifiers */.S.getResourceTypeModifiers(convertedRedirectResourceData, platforms/* .GenericPlatform.UboAny */.p.UboAny);
// Special case: noop text resource
// If any of resource type is already present, we don't need to add other resource types,
// otherwise, add all resource types
// TODO: Optimize this logic
// Check if the current resource is the noop text resource
const isNoopTextResource = convertedRedirectResourceName === UBO_NOOP_TEXT_RESOURCE;
// Determine if there are any valid resource types already present
const hasValidResourceType = modifierList.children.some((modifier) => {
const name = modifier.name.value;
if (!(0,resource_type_helpers/* .isValidResourceType */.x)(name)) {
return false;
}
const convertedModifierData = compatibility_tables_modifiers/* .modifiersCompatibilityTable.getFirst */.Z.getFirst(name, platforms/* .GenericPlatform.UboAny */.p.UboAny);
return uboResourceTypeModifiers.has(convertedModifierData?.name ?? name);
});
// If it's not the noop text resource or if no valid resource types are present
if (!isNoopTextResource || !hasValidResourceType) {
uboResourceTypeModifiers.forEach((resourceType) => {
resourceTypeModifiersToAdd.add(resourceType);
});
}
}
// Check if the modifier name or the redirect resource name is different from the original modifier.
// If so, add the converted modifier to the list
if (modifierName !== originalModifierName
|| (!(0,type_guards/* .isUndefined */.b0)(convertedRedirectResourceName)
&& convertedRedirectResourceName !== redirectResourceName)) {
conversionMap.add(index, createModifierNode(modifierName,
// If the redirect resource name is unknown, fall back to the original one
// Later, the validator will throw an error if the resource name is invalid
convertedRedirectResourceName || redirectResourceName, modifierNode.exception));
}
return;
}
// Generic modifier conversion
if (modifierData && modifierData.name !== originalModifierName) {
conversionMap.add(index, createModifierNode(modifierData.name, modifierNode.value?.value, modifierNode.exception));
}
});
// Prepare the result if there are any converted modifiers or $csp modifiers
if (conversionMap.size || resourceTypeModifiersToAdd.size) {
const modifierListClone = cloneModifierListNode(modifierList);
// Replace the original modifiers with the converted ones
// One modifier may be replaced with multiple modifiers, so we need to flatten the array
modifierListClone.children = modifierListClone.children.map((modifierNode, index) => {
const conversionRecord = conversionMap.get(index);
if (conversionRecord) {
return conversionRecord;
}
return modifierNode;
}).flat();
// Before returning the result, remove duplicated modifiers
modifierListClone.children = modifierListClone.children.filter((modifierNode, index, self) => self.findIndex((m) => m.name.value === modifierNode.name.value
&& m.exception === modifierNode.exception
&& m.value?.value === modifierNode.value?.value) === index);
if (resourceTypeModifiersToAdd.size) {
const modifierNameSet = new Set(modifierList.children.map((m) => m.name.value));
resourceTypeModifiersToAdd.forEach((resourceType) => {
if (!modifierNameSet.has(resourceType)) {
modifierListClone.children.push(createModifierNode(resourceType));
}
});
}
return (0,conversion_result/* .createConversionResult */.c)(modifierListClone, true);
}
return (0,conversion_result/* .createConversionResult */.c)(modifierList, false);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/network/index.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Network rule converter.
*/
/**
* Network rule converter class (also known as "basic rule converter").
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class NetworkRuleConverter extends RuleConverterBase {
/**
* Converts a network rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
// TODO: add support for host rules
if (rule.type !== nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule) {
throw new Error(`Invalid rule type: ${rule.type}`);
}
if (rule.modifiers) {
const modifiers = NetworkRuleModifierListConverter.convertToAdg(rule.modifiers, rule.exception);
// If the object reference is different, it means that the modifiers were converted
// In this case, we should clone the entire rule and replace the modifiers with the converted ones
if (modifiers.isConverted) {
return {
result: [{
category: nodes/* .RuleCategory.Network */.$O.Network,
type: nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule,
syntax: rule.syntax,
exception: rule.exception,
pattern: {
type: 'Value',
value: rule.pattern.value,
},
modifiers: modifiers.result,
}],
isConverted: true,
};
}
}
// If the modifiers were not converted, return the original rule
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
/**
* Converts a network rule to uBlock format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToUbo(rule) {
// TODO: add support for host rules
if (rule.type !== nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule) {
throw new Error(`Invalid rule type: ${rule.type}`);
}
if (rule.modifiers) {
const modifiers = NetworkRuleModifierListConverter.convertToUbo(rule.modifiers, rule.exception);
// If the object reference is different, it means that the modifiers were converted
// In this case, we should clone the entire rule and replace the modifiers with the converted ones
if (modifiers.isConverted) {
return {
result: [{
category: nodes/* .RuleCategory.Network */.$O.Network,
type: nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule,
syntax: rule.syntax,
exception: rule.exception,
pattern: {
type: 'Value',
value: rule.pattern.value,
},
modifiers: modifiers.result,
}],
isConverted: true,
};
}
}
// If the modifiers were not converted, return the original rule
return (0,conversion_result/* .createNodeConversionResult */.k)([rule], false);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/rule.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Adblock rule converter.
*
* This file is the entry point for all rule converters
* which automatically detects the rule type and calls
* the corresponding "sub-converter".
*/
/**
* Adblock filtering rule converter class.
*
* @todo Implement `convertToUbo` and `convertToAbp`.
*/
class RuleConverter extends RuleConverterBase {
/**
* Converts an adblock filtering rule to AdGuard format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
static convertToAdg(rule) {
// Delegate conversion to the corresponding sub-converter
// based on the rule category
switch (rule.category) {
case nodes/* .RuleCategory.Comment */.$O.Comment:
return CommentRuleConverter.convertToAdg(rule);
case nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic:
return CosmeticRuleConverter.convertToAdg(rule);
case nodes/* .RuleCategory.Network */.$O.Network:
// TODO: Handle hosts rules later
if (rule.type === nodes/* .NetworkRuleType.HostRule */.vY.HostRule) {
return (0,conversion_result/* .createConversionResult */.c)([rule], false);
}
return NetworkRuleConverter.convertToAdg(rule);
case nodes/* .RuleCategory.Invalid */.$O.Invalid:
case nodes/* .RuleCategory.Empty */.$O.Empty:
// Just forward the rule as is
return (0,conversion_result/* .createConversionResult */.c)([rule], false);
default:
// Never happens during normal operation
throw new RuleConversionError('Unknown rule category');
}
}
/**
* Converts an adblock filtering rule to uBlock Origin format, if possible.
*
* @param rule Rule node to convert.
*
* @returns An object which follows the {@link NodeConversionResult} interface. Its `result` property contains
* the array of converted rule nodes, and its `isConverted` flag indicates whether the original rule was converted.
* If the rule was not converted, the result array will contain the original node with the same object reference.
*
* @throws If the rule is invalid or cannot be converted.
*/
// TODO: Add support for other rule types
static convertToUbo(rule) {
if (rule.category === nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic) {
return CosmeticRuleConverter.convertToUbo(rule);
}
if (rule.category === nodes/* .RuleCategory.Network */.$O.Network) {
return NetworkRuleConverter.convertToUbo(rule);
}
return (0,conversion_result/* .createConversionResult */.c)([rule], false);
}
}
},
10631(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
q: () => (AdblockSyntaxError)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Customized syntax error class for Adblock Filter Parser.
*/
const ERROR_NAME = 'AdblockSyntaxError';
/**
* Customized syntax error class for Adblock Filter Parser,
* which contains the location range of the error.
*/
class AdblockSyntaxError extends SyntaxError {
/**
* Start offset of the error.
*/
start;
/**
* End offset of the error.
*/
end;
/**
* Constructs a new `AdblockSyntaxError` instance.
*
* @param message Error message.
* @param start Start offset of the error.
* @param end End offset of the error.
*/
constructor(message, start, end) {
super(message);
this.name = ERROR_NAME;
this.start = start;
this.end = end;
}
}
},
82535(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
E: () => (NotImplementedError)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Customized error class for not implemented features.
*/
const ERROR_NAME = 'NotImplementedError';
const BASE_MESSAGE = 'Not implemented';
/**
* Customized error class for not implemented features.
*/
class NotImplementedError extends Error {
/**
* Constructs a new `NotImplementedError` instance.
*
* @param message Additional error message (optional).
*/
constructor(message = undefined) {
// Prepare the full error message
const fullMessage = message
? `${BASE_MESSAGE}: ${message}`
: BASE_MESSAGE;
super(fullMessage);
this.name = ERROR_NAME;
}
}
},
15987(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
t: () => (BaseGenerator)
});
/* import */ var _errors_not_implemented_error_js__rspack_import_0 = __webpack_require__(82535);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
/**
* @file Base generator class.
*/
/**
* Base class for generators. Each generator should extend this class.
*/
class BaseGenerator {
/**
* Generates a string from the AST node.
*
* @param node AST node to generate a string from.
*/
static generate(node) {
throw new _errors_not_implemented_error_js__rspack_import_0/* .NotImplementedError */.E();
}
}
},
82605(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
H: () => (/* binding */ CosmeticRuleBodyGenerator)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/ubo-selector-common.js
var ubo_selector_common = __webpack_require__(15862);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/base-generator.js
var base_generator = __webpack_require__(15987);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/css/adg-css-injection-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* AdGuard CSS injection generator.
*/
class AdgCssInjectionGenerator extends base_generator/* .BaseGenerator */.t {
/**
* CSS declaration for removing elements.
*/
static REMOVE_DECLARATION = 'remove: true;';
/**
* Serializes an AdGuard CSS injection node into a raw string.
*
* @param node Node to serialize.
*
* @returns Raw string.
*/
static generate(node) {
const result = [];
if (node.mediaQueryList) {
result.push(constants/* .CSS_MEDIA_MARKER */.Ae, constants/* .SPACE */.t6, node.mediaQueryList.value, constants/* .SPACE */.t6, constants/* .OPEN_CURLY_BRACKET */.sV, constants/* .SPACE */.t6);
}
result.push(node.selectorList.value, constants/* .SPACE */.t6, constants/* .OPEN_CURLY_BRACKET */.sV, constants/* .SPACE */.t6);
if (node.remove) {
result.push(AdgCssInjectionGenerator.REMOVE_DECLARATION);
}
else if (node.declarationList?.value) {
result.push(node.declarationList.value);
}
result.push(constants/* .SPACE */.t6, constants/* .CLOSE_CURLY_BRACKET */.wU);
if (node.mediaQueryList) {
result.push(constants/* .SPACE */.t6, constants/* .CLOSE_CURLY_BRACKET */.wU);
}
return result.join(constants/* .EMPTY */.wg);
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/html-filtering-body/adg-html-filtering-body-generator.js
var adg_html_filtering_body_generator = __webpack_require__(60646);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/html-filtering-body/ubo-html-filtering-body-generator.js
var ubo_html_filtering_body_generator = __webpack_require__(63836);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/abp-snippet-injection-body-common.js
var abp_snippet_injection_body_common = __webpack_require__(7596);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/parameter-list-generator.js
var parameter_list_generator = __webpack_require__(92835);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/scriptlet-body/abp-snippet-injection-body-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Adblock Plus snippet injection body generator.
*/
class AbpSnippetInjectionBodyGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the Adblock Plus-style snippet call body.
*
* @param node Scriptlet injection rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the scriptlet call is empty.
*/
static generate(node) {
const result = [];
if (node.children.length === 0) {
throw new Error(abp_snippet_injection_body_common/* .AbpSnippetInjectionBodyCommon.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL */.H.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL);
}
for (const scriptletCall of node.children) {
if (scriptletCall.children.length === 0) {
throw new Error(abp_snippet_injection_body_common/* .AbpSnippetInjectionBodyCommon.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL */.H.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL);
}
result.push(parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(scriptletCall, constants/* .SPACE */.t6));
}
return result.join(constants/* .SEMICOLON */.I8 + constants/* .SPACE */.t6);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/scriptlet-body/adg-scriptlet-injection-body-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* AdGuard scriptlet injection body generator.
*/
class AdgScriptletInjectionBodyGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Error messages used by the generator.
*/
static ERROR_MESSAGES = {
NO_MULTIPLE_SCRIPTLET_CALLS: 'ADG syntaxes does not support multiple scriptlet calls within one single rule',
};
/**
* Generates a string representation of the AdGuard scriptlet call body.
*
* @param node Scriptlet injection rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the scriptlet call has multiple parameters.
*/
static generate(node) {
const result = [];
if (node.children.length > 1) {
throw new Error(AdgScriptletInjectionBodyGenerator.ERROR_MESSAGES.NO_MULTIPLE_SCRIPTLET_CALLS);
}
result.push(constants/* .ADG_SCRIPTLET_MASK */.x$);
result.push(constants/* .OPEN_PARENTHESIS */.Cx);
if (node.children.length > 0) {
result.push(parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(node.children[0]));
}
result.push(constants/* .CLOSE_PARENTHESIS */.s1);
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/scriptlet-body/ubo-scriptlet-injection-body-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* UBlock scriptlet injection body generator.
*/
class UboScriptletInjectionBodyGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Error messages used by the generator.
*/
static ERROR_MESSAGES = {
NO_MULTIPLE_SCRIPTLET_CALLS: 'uBO syntaxes does not support multiple scriptlet calls within one single rule',
};
/**
* Generates a string representation of the uBlock scriptlet call body.
*
* @param node Scriptlet injection rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the scriptlet call has multiple parameters.
*/
static generate(node) {
const result = [];
if (node.children.length > 1) {
throw new Error(UboScriptletInjectionBodyGenerator.ERROR_MESSAGES.NO_MULTIPLE_SCRIPTLET_CALLS);
}
// During generation, we only support the modern scriptlet mask
result.push(constants/* .UBO_SCRIPTLET_MASK */.Rq);
result.push(constants/* .OPEN_PARENTHESIS */.Cx);
if (node.children.length > 0) {
const [parameterListNode] = node.children;
result.push(parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(parameterListNode));
}
result.push(constants/* .CLOSE_PARENTHESIS */.s1);
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/cosmetic-rule-body-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Cosmetic rule body generator.
*/
class CosmeticRuleBodyGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates the rule body from the node.
*
* @param node Cosmetic rule node.
*
* @returns Raw rule body.
*
* @throws Error if the rule type is unknown.
*
* @example
* - '##.foo' → '.foo'
* - 'example.com,example.org##.foo' → '.foo'
* - 'example.com#%#//scriptlet('foo')' → '//scriptlet('foo')'
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
switch (node.type) {
case nodes/* .CosmeticRuleType.ElementHidingRule */.k9.ElementHidingRule:
result = node.body.selectorList.value;
break;
case nodes/* .CosmeticRuleType.CssInjectionRule */.k9.CssInjectionRule:
if (node.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg || node.syntax === adblockers/* .AdblockSyntax.Abp */.YG.Abp) {
result = AdgCssInjectionGenerator.generate(node.body);
}
else if (node.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo) {
if (node.body.mediaQueryList) {
result += constants/* .COLON */.oH;
result += ubo_selector_common/* .UboPseudoName.MatchesMedia */.S.MatchesMedia;
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += node.body.mediaQueryList.value;
result += constants/* .CLOSE_PARENTHESIS */.s1;
result += constants/* .SPACE */.t6;
}
result += node.body.selectorList.value;
if (node.body.remove) {
result += constants/* .COLON */.oH;
result += ubo_selector_common/* .UboPseudoName.Remove */.S.Remove;
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
else if (node.body.declarationList) {
result += constants/* .COLON */.oH;
result += ubo_selector_common/* .UboPseudoName.Style */.S.Style;
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += node.body.declarationList.value;
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
}
break;
case nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule:
switch (node.syntax) {
case adblockers/* .AdblockSyntax.Adg */.YG.Adg:
result = adg_html_filtering_body_generator/* .AdgHtmlFilteringBodyGenerator.generate */.$.generate(node.body);
break;
case adblockers/* .AdblockSyntax.Ubo */.YG.Ubo:
result = constants/* .UBO_HTML_MASK */._h + ubo_html_filtering_body_generator/* .UboHtmlFilteringBodyGenerator.generate */.b.generate(node.body);
break;
case adblockers/* .AdblockSyntax.Abp */.YG.Abp:
throw new Error('ABP does not support HTML filtering rules');
default:
throw new Error('HTML filtering rule should have an explicit syntax');
}
break;
case nodes/* .CosmeticRuleType.JsInjectionRule */.k9.JsInjectionRule:
result = node.body.value;
break;
case nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule:
switch (node.syntax) {
case adblockers/* .AdblockSyntax.Adg */.YG.Adg:
result = AdgScriptletInjectionBodyGenerator.generate(node.body);
break;
case adblockers/* .AdblockSyntax.Abp */.YG.Abp:
result = AbpSnippetInjectionBodyGenerator.generate(node.body);
break;
case adblockers/* .AdblockSyntax.Ubo */.YG.Ubo:
result = UboScriptletInjectionBodyGenerator.generate(node.body);
break;
default:
throw new Error('Scriptlet rule should have an explicit syntax');
}
break;
default:
throw new Error('Unknown cosmetic rule type');
}
return result;
}
}
},
60646(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
$: () => (AdgHtmlFilteringBodyGenerator)
});
/* import */ var _base_generator_js__rspack_import_0 = __webpack_require__(15987);
/* import */ var _html_filtering_body_generator_js__rspack_import_1 = __webpack_require__(441);
/* import */ var _utils_quotes_js__rspack_import_2 = __webpack_require__(68999);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* AdGuard HTML Filtering body generator.
*/
class AdgHtmlFilteringBodyGenerator extends _base_generator_js__rspack_import_0/* .BaseGenerator */.t {
/**
* Generates a string representation of the AdGuard HTML filtering rule body.
*
* @param node HTML filtering rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the rule body is invalid.
*/
static generate(node) {
const raw = _html_filtering_body_generator_js__rspack_import_1/* .HtmlFilteringBodyGenerator.generate */.T.generate(node);
return _utils_quotes_js__rspack_import_2/* .QuoteUtils.unescapeAttributeDoubleQuotes */.Qj.unescapeAttributeDoubleQuotes(raw);
}
}
},
441(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
T: () => (/* binding */ HtmlFilteringBodyGenerator)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/base-generator.js
var base_generator = __webpack_require__(15987);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/value-generator.js
var value_generator = __webpack_require__(47924);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/quotes.js
var quotes = __webpack_require__(68999);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/attribute-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Attribute selector generator.
*/
class AttributeSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the attribute selector.
*
* @param node Attribute selector node.
*
* @returns String representation of the attribute selector.
*/
static generate(node) {
const result = [];
result.push(constants/* .OPEN_SQUARE_BRACKET */.cU);
result.push(value_generator/* .ValueGenerator.generate */.R.generate(node.name));
if ('value' in node) {
result.push(value_generator/* .ValueGenerator.generate */.R.generate(node.operator));
const generatedValue = value_generator/* .ValueGenerator.generate */.R.generate(node.value);
const quotedValue = quotes/* .QuoteUtils.setStringQuoteType */.Qj.setStringQuoteType(generatedValue, quotes/* .QuoteType.Double */.XA.Double);
result.push(quotedValue);
if (node.flag) {
result.push(constants/* .SPACE */.t6);
result.push(value_generator/* .ValueGenerator.generate */.R.generate(node.flag));
}
}
result.push(constants/* .CLOSE_SQUARE_BRACKET */.A1);
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/class-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Class selector generator.
*/
class ClassSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the class selector.
*
* @param node Class selector node.
*
* @returns String representation of the class selector.
*/
static generate(node) {
return constants/* .DOT */.y0 + node.value;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/id-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* ID selector generator.
*/
class IdSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the ID selector.
*
* @param node ID selector node.
*
* @returns String representation of the ID selector.
*/
static generate(node) {
return constants/* .HASHMARK */.C + node.value;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/pseudo-class-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Pseudo-class selector generator.
*/
class PseudoClassSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the pseudo-class selector.
*
* @param node Pseudo-class selector node.
*
* @returns String representation of the pseudo-class selector.
*/
static generate(node) {
const result = [];
result.push(constants/* .COLON */.oH);
result.push(value_generator/* .ValueGenerator.generate */.R.generate(node.name));
if (node.argument) {
result.push(constants/* .OPEN_PARENTHESIS */.Cx);
result.push(value_generator/* .ValueGenerator.generate */.R.generate(node.argument));
result.push(constants/* .CLOSE_PARENTHESIS */.s1);
}
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/selector-combinator-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Selector combinator generator.
*/
class SelectorCombinatorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the selector combinator.
*
* @param node Selector combinator node.
*
* @returns String representation of the selector combinator.
*/
static generate(node) {
// For descendant combinator, we don't need to add spaces around it
if (node.value === ' ') {
return node.value;
}
return constants/* .SPACE */.t6 + node.value + constants/* .SPACE */.t6;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/type-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Type selector generator.
*/
class TypeSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the type selector.
*
* @param node Type selector node.
*
* @returns String representation of the type selector.
*/
static generate(node) {
return node.value;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/complex-selector-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Complex selector generator.
*/
class ComplexSelectorGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the complex selector.
*
* @param node Complex selector node.
*
* @returns String representation of the complex selector.
*
* @throws Error if the `node` is invalid.
*/
static generate(node) {
if (node.children.length === 0) {
throw new Error('Complex selector cannot be empty');
}
const result = [];
for (let i = 0; i < node.children.length; i += 1) {
const selector = node.children[i];
const { type } = selector;
// Validate that compound selectors are not empty
if ((i === 0 || node.children[i - 1].type === 'SelectorCombinator')
&& type === 'SelectorCombinator') {
throw new Error('Empty compound selector found');
}
let selectorResult;
switch (type) {
case 'TypeSelector':
selectorResult = TypeSelectorGenerator.generate(selector);
break;
case 'IdSelector':
selectorResult = IdSelectorGenerator.generate(selector);
break;
case 'ClassSelector':
selectorResult = ClassSelectorGenerator.generate(selector);
break;
case 'AttributeSelector':
selectorResult = AttributeSelectorGenerator.generate(selector);
break;
case 'PseudoClassSelector':
selectorResult = PseudoClassSelectorGenerator.generate(selector);
break;
case 'SelectorCombinator':
selectorResult = SelectorCombinatorGenerator.generate(selector);
break;
default:
throw new Error(`Unknown selector type: ${type}`);
}
result.push(selectorResult);
}
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/selector/selector-list-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Selector list generator.
*/
class SelectorListGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the selector list.
*
* @param node Selector list node.
*
* @returns String representation of the selector list.
*
* @throws Error if the `node` is invalid.
*/
static generate(node) {
if (node.children.length === 0) {
throw new Error('Selector list cannot be empty');
}
const result = [];
for (let i = 0; i < node.children.length; i += 1) {
const complexSelector = node.children[i];
if (i > 0) {
result.push(constants/* .COMMA */.KE);
result.push(constants/* .SPACE */.t6);
}
result.push(ComplexSelectorGenerator.generate(complexSelector));
}
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/html-filtering-body/html-filtering-body-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* HTML Filtering body generator.
*/
class HtmlFilteringBodyGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the HTML filtering rule body.
*
* @param node HTML filtering rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the rule body is invalid.
*/
static generate(node) {
if (node.type === 'Value') {
return value_generator/* .ValueGenerator.generate */.R.generate(node);
}
return SelectorListGenerator.generate(node.selectorList);
}
}
},
63836(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
b: () => (UboHtmlFilteringBodyGenerator)
});
/* import */ var _common_ubo_html_filtering_body_common_js__rspack_import_2 = __webpack_require__(76466);
/* import */ var _utils_constants_js__rspack_import_4 = __webpack_require__(53097);
/* import */ var _base_generator_js__rspack_import_0 = __webpack_require__(15987);
/* import */ var _misc_value_generator_js__rspack_import_3 = __webpack_require__(47924);
/* import */ var _html_filtering_body_generator_js__rspack_import_1 = __webpack_require__(441);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* UBlock HTML Filtering body generator.
*/
class UboHtmlFilteringBodyGenerator extends _base_generator_js__rspack_import_0/* .BaseGenerator */.t {
/**
* Generates a string representation of the uBlock HTML filtering rule body
* and also uBlock-style response header removal rules.
*
* @param node HTML filtering rule body.
*
* @returns String representation of the rule body.
*
* @throws Error if the rule body is invalid.
*/
static generate(node) {
// First, check if it's a response header removal rule and return if so
const responseHeaderBody = UboHtmlFilteringBodyGenerator.generateResponseHeaderRule(node);
if (responseHeaderBody !== null) {
return responseHeaderBody;
}
return _html_filtering_body_generator_js__rspack_import_1/* .HtmlFilteringBodyGenerator.generate */.T.generate(node);
}
/**
* Generates a string representation of the uBlock-style response header removal rule.
*
* @param node Potential response header removal rule node.
*
* @returns String representation of the response header removal rule,
* or `null` if the node is not a response header removal rule.
*
* @note This method accepts `HtmlFilteringRuleBody` as `node` because,
* response header removal rule syntax is same as uBlock-style HTML filtering rule syntax.
*/
static generateResponseHeaderRule(node) {
if (node.type !== 'HtmlFilteringRuleBody' || !(0,_common_ubo_html_filtering_body_common_js__rspack_import_2/* .isUboResponseHeaderRemovalRuleBody */.l)(node)) {
return null;
}
// Length of AST nodes, types of nodes, non-null argument
// check are already done in `isUboResponseHeaderRemovalRuleBody()`
const { selectorList } = node;
const complexSelector = selectorList.children[0];
const pseudoClass = complexSelector.children[0];
const headerName = _misc_value_generator_js__rspack_import_3/* .ValueGenerator.generate */.R.generate(pseudoClass.argument);
const result = [];
result.push(_utils_constants_js__rspack_import_4/* .UBO_RESPONSEHEADER_FN */.Bt);
result.push(_utils_constants_js__rspack_import_4/* .OPEN_PARENTHESIS */.Cx);
result.push(headerName);
result.push(_utils_constants_js__rspack_import_4/* .CLOSE_PARENTHESIS */.s1);
return result.join(_utils_constants_js__rspack_import_4/* .EMPTY */.wg);
}
}
},
92835(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
H: () => (ParameterListGenerator)
});
/* import */ var _utils_constants_js__rspack_import_1 = __webpack_require__(53097);
/* import */ var _base_generator_js__rspack_import_0 = __webpack_require__(15987);
/* import */ var _value_generator_js__rspack_import_2 = __webpack_require__(47924);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for parameter list nodes.
*/
class ParameterListGenerator extends _base_generator_js__rspack_import_0/* .BaseGenerator */.t {
/**
* Converts a parameter list AST to a string.
*
* @param params Parameter list AST.
* @param separator Separator character (default: comma).
* @param allowSpace Allow space between parameters (default: true).
*
* @returns String representation of the parameter list.
*/
static generate(params, separator = _utils_constants_js__rspack_import_1/* .COMMA */.KE, allowSpace = true) {
const collection = [];
let i = 0;
for (; i < params.children.length; i += 1) {
const param = params.children[i];
if (param === null) {
collection.push(_utils_constants_js__rspack_import_1/* .EMPTY */.wg);
}
else {
collection.push(_value_generator_js__rspack_import_2/* .ValueGenerator.generate */.R.generate(param));
}
}
let result = _utils_constants_js__rspack_import_1/* .EMPTY */.wg;
// if allowSpace is true, join with a single separator
// without space
if (!allowSpace && separator !== _utils_constants_js__rspack_import_1/* .SPACE */.t6) {
result = collection.join(separator);
}
else {
// join parameters with separator
// if the separator is a space, join with a single space
result = collection.join(separator === _utils_constants_js__rspack_import_1/* .SPACE */.t6 ? separator : `${separator}${_utils_constants_js__rspack_import_1/* .SPACE */.t6}`);
}
return result;
}
}
},
47924(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
R: () => (ValueGenerator)
});
/* import */ var _base_generator_js__rspack_import_0 = __webpack_require__(15987);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for value nodes.
*/
class ValueGenerator extends _base_generator_js__rspack_import_0/* .BaseGenerator */.t {
/**
* Converts a value node to a string.
*
* @param node Value node.
*
* @returns Raw string.
*/
static generate(node) {
return node.value;
}
}
},
11598(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
u: () => (/* binding */ RuleGenerator)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/base-generator.js
var base_generator = __webpack_require__(15987);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/agent-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for adblock agent nodes.
* This class is responsible for converting adblock agent nodes into their string representation.
*/
class AgentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts an adblock agent node to a string.
*
* @param value Agent node.
*
* @returns Raw string.
*/
static generate(value) {
let result = constants/* .EMPTY */.wg;
// Agent adblock name
result += value.adblock.value;
// Agent adblock version (if present)
if (!(0,type_guards/* .isUndefined */.b0)(value.version)) {
// Add a space between the name and the version
result += constants/* .SPACE */.t6;
result += value.version.value;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/agent-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for agent comment rules.
*/
class AgentCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts an adblock agent AST to a string.
*
* @param ast Agent rule AST.
*
* @returns Raw string.
*/
static generate(ast) {
let result = constants/* .OPEN_SQUARE_BRACKET */.cU;
result += ast.children
.map(AgentGenerator.generate)
.join(constants/* .SEMICOLON */.I8 + constants/* .SPACE */.t6);
result += constants/* .CLOSE_SQUARE_BRACKET */.A1;
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/parameter-list-generator.js
var parameter_list_generator = __webpack_require__(92835);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/config-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Converts inline configuration comment nodes to their string format.
*/
class ConfigCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts an inline configuration comment node to a string.
*
* @param node Inline configuration comment node.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
result += node.marker.value;
result += constants/* .SPACE */.t6;
result += node.command.value;
if (node.params) {
result += constants/* .SPACE */.t6;
if (node.params.type === 'ParameterList') {
result += parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(node.params, constants/* .COMMA */.KE);
}
else {
// Trim JSON boundaries
result += JSON.stringify(node.params.value).slice(1, -1).trim();
}
}
// Add comment within the config comment
if (node.comment) {
result += constants/* .SPACE */.t6;
result += node.comment.value;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/hint-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Hint generator.
*/
class HintGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of a hint.
*
* @param hint Hint AST node.
*
* @returns String representation of the hint.
*/
static generate(hint) {
let result = constants/* .EMPTY */.wg;
result += hint.name.value;
if (hint.params && hint.params.children.length > 0) {
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(hint.params, constants/* .COMMA */.KE);
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/hint-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Hint comment generator.
*/
class HintCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a hint rule node to a raw string.
*
* @param node Hint rule node.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .HINT_MARKER */.j6 + constants/* .SPACE */.t6;
result += node.children.map(HintGenerator.generate).join(constants/* .SPACE */.t6);
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/value-generator.js
var value_generator = __webpack_require__(47924);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/metadata-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Metadata comment generator.
*/
class MetadataCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a metadata comment rule node to a string.
*
* @param node Metadata comment rule node.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
result += value_generator/* .ValueGenerator.generate */.R.generate(node.marker);
result += constants/* .SPACE */.t6;
result += value_generator/* .ValueGenerator.generate */.R.generate(node.header);
result += constants/* .COLON */.oH;
result += constants/* .SPACE */.t6;
result += value_generator/* .ValueGenerator.generate */.R.generate(node.value);
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/logical-expression-parser.js
var logical_expression_parser = __webpack_require__(48609);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/logical-expression-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for logical expression nodes.
*/
class LogicalExpressionGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string representation of the logical expression (serialization).
*
* @param node Expression node.
*
* @returns String representation of the logical expression.
*/
static generate(node) {
if (node.type === logical_expression_parser/* .NodeType.Variable */.Z.Variable) {
return node.name;
}
if (node.type === logical_expression_parser/* .NodeType.Operator */.Z.Operator) {
const left = LogicalExpressionGenerator.generate(node.left);
const right = node.right ? LogicalExpressionGenerator.generate(node.right) : undefined;
const { operator } = node;
// Special case for NOT operator
if (operator === nodes/* .OperatorValue.Not */.oC.Not) {
return `${operator}${left}`;
}
// Right operand is required for AND and OR operators
if (!right) {
throw new Error('Expected right operand');
}
return `${left} ${operator} ${right}`;
}
if (node.type === logical_expression_parser/* .NodeType.Parenthesis */.Z.Parenthesis) {
const expressionString = LogicalExpressionGenerator.generate(node.expression);
return `(${expressionString})`;
}
// Theoretically, this shouldn't happen if the library is used correctly
throw new Error('Unexpected node type');
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/pre-processor-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Pre-processor comment generator.
*/
class PreProcessorCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a pre-processor comment node to a string.
*
* @param node Pre-processor comment node.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
result += constants/* .PREPROCESSOR_MARKER */.PD;
result += node.name.value;
if (node.params) {
let allowSpaceBetweenParams = true;
// Space between cb is not allowed for "safari_cb_affinity" directive.
if (node.name.value === constants/* .SAFARI_CB_AFFINITY */.us) {
allowSpaceBetweenParams = false;
}
// Space is not allowed after "safari_cb_affinity" directive, so we need to handle it separately.
if (node.name.value !== constants/* .SAFARI_CB_AFFINITY */.us) {
result += constants/* .SPACE */.t6;
}
if (node.params.type === 'Value') {
result += value_generator/* .ValueGenerator.generate */.R.generate(node.params);
}
else if (node.params.type === 'ParameterList') {
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += parameter_list_generator/* .ParameterListGenerator.generate */.H.generate(node.params, constants/* .COMMA */.KE, allowSpaceBetweenParams);
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
else {
result += LogicalExpressionGenerator.generate(node.params);
}
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/simple-comment-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Simple comment generator.
*/
class SimpleCommentGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a comment rule node to a string.
*
* @param node Comment rule node.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
result += value_generator/* .ValueGenerator.generate */.R.generate(node.marker);
result += value_generator/* .ValueGenerator.generate */.R.generate(node.text);
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/comment/comment-rule-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-param-reassign */
/**
* `CommentRuleGenerator` is responsible for generating any comment-like adblock rules.
*/
class CommentRuleGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a comment rule node to a string.
*
* @param node Comment rule node.
*
* @returns Raw string.
*/
static generate(node) {
switch (node.type) {
case nodes/* .CommentRuleType.AgentCommentRule */.gV.AgentCommentRule:
return AgentCommentGenerator.generate(node);
case nodes/* .CommentRuleType.HintCommentRule */.gV.HintCommentRule:
return HintCommentGenerator.generate(node);
case nodes/* .CommentRuleType.PreProcessorCommentRule */.gV.PreProcessorCommentRule:
return PreProcessorCommentGenerator.generate(node);
case nodes/* .CommentRuleType.MetadataCommentRule */.gV.MetadataCommentRule:
return MetadataCommentGenerator.generate(node);
case nodes/* .CommentRuleType.ConfigCommentRule */.gV.ConfigCommentRule:
return ConfigCommentGenerator.generate(node);
case nodes/* .CommentRuleType.CommentRule */.gV.CommentRule:
return SimpleCommentGenerator.generate(node);
default:
throw new Error('Unknown comment rule type');
}
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/cosmetic-rule-body-generator.js + 4 modules
var cosmetic_rule_body_generator = __webpack_require__(82605);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/list-items-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Utility class for generating string representations of list items.
*/
class ListItemsGenerator {
/**
* Generates a string representation of a list item.
*
* @template T Type of the list item.
*
* @param item List item to generate.
*
* @returns String representation of the list item.
*/
static generateListItem = (item) => {
return `${item.exception ? constants/* .NEGATION_MARKER */.bP : constants/* .EMPTY */.wg}${item.value}`;
};
/**
* Generates a string representation of a list of items.
*
* @template T Type of the list items.
*
* @param items List of items to generate.
* @param separator Separator character.
*
* @returns String representation of the list of items.
*/
static generate = (items, separator) => {
return items.map(ListItemsGenerator.generateListItem)
.join(separator);
};
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/domain-list-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Domain list generator.
*/
class DomainListGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a domain list node to a string.
*
* @param node Domain list node.
*
* @returns Raw string.
*/
static generate(node) {
return ListItemsGenerator.generate(node.children, node.separator);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/modifier-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for modifier nodes.
*/
class ModifierGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a modifier AST node to a string.
*
* @param modifier Modifier AST node to convert.
*
* @returns String representation of the modifier.
*/
static generate(modifier) {
let result = constants/* .EMPTY */.wg;
if (modifier.exception) {
result += constants/* .NEGATION_MARKER */.bP;
}
result += modifier.name.value;
if (modifier.value !== undefined) {
result += constants/* .MODIFIER_ASSIGN_OPERATOR */.li;
result += modifier.value.value;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/misc/modifier-list-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for modifier list nodes.
*/
class ModifierListGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a modifier list AST to a string.
*
* @param ast Modifier list AST.
*
* @returns Raw string.
*/
static generate(ast) {
const result = ast.children
.map(ModifierGenerator.generate)
.join(constants/* .MODIFIERS_SEPARATOR */.b9);
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/cosmetic-rule-pattern-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Cosmetic rule pattern generator.
*/
class CosmeticRulePatternGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates the rule pattern from the AST.
*
* @param node Cosmetic rule node.
*
* @returns Raw rule pattern.
*
* @example
* - '##.foo' → ''
* - 'example.com,example.org##.foo' → 'example.com,example.org'
* - '[$path=/foo/bar]example.com##.foo' → '[$path=/foo/bar]example.com'
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
// AdGuard modifiers (if any)
if (node.syntax === adblockers/* .AdblockSyntax.Adg */.YG.Adg && node.modifiers && node.modifiers.children.length > 0) {
result += constants/* .OPEN_SQUARE_BRACKET */.cU;
result += constants/* .DOLLAR_SIGN */.nj;
result += ModifierListGenerator.generate(node.modifiers);
result += constants/* .CLOSE_SQUARE_BRACKET */.A1;
}
// Domain list (if any)
result += DomainListGenerator.generate(node.domains);
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/cosmetic/cosmetic-rule-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `CosmeticRuleGenerator` is responsible for generating cosmetic rules from their AST representation.
*
* This class takes a parsed cosmetic rule Abstract Syntax Tree (AST) and converts it back into a raw string format.
* It handles the generation of the pattern, separator, uBO rule modifiers, and the rule body.
*/
class CosmeticRuleGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a cosmetic rule AST into a string.
*
* @param node Cosmetic rule AST.
*
* @returns Raw string.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
// Pattern
result += CosmeticRulePatternGenerator.generate(node);
// Separator
result += node.separator.value;
// uBO rule modifiers
if (node.syntax === adblockers/* .AdblockSyntax.Ubo */.YG.Ubo && node.modifiers) {
node.modifiers.children.forEach((modifier) => {
if (modifier.exception) {
result += constants/* .COLON */.oH;
result += constants/* .CSS_NOT_PSEUDO */.vr;
result += constants/* .OPEN_PARENTHESIS */.Cx;
}
result += constants/* .COLON */.oH;
result += modifier.name.value;
if (modifier.value) {
result += constants/* .OPEN_PARENTHESIS */.Cx;
result += modifier.value.value;
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
if (modifier.exception) {
result += constants/* .CLOSE_PARENTHESIS */.s1;
}
});
// If there are at least one modifier, add a space
if (node.modifiers.children.some((modifier) => modifier?.name.value)) {
result += constants/* .SPACE */.t6;
}
}
// Body
result += cosmetic_rule_body_generator/* .CosmeticRuleBodyGenerator.generate */.H.generate(node);
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/network/host-rule-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for host rule nodes.
*/
class HostRuleGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a host rule node to a raw string.
*
* @param node Host rule node.
*
* @returns Raw string.
*/
static generate(node) {
const result = [];
if (node.ip) {
result.push(node.ip.value);
}
if (node.hostnames) {
result.push(constants/* .SPACE */.t6);
result.push(node.hostnames.children.map(({ value }) => value).join(constants/* .SPACE */.t6));
}
if (node.comment) {
result.push(constants/* .SPACE */.t6);
result.push(constants/* .HASHMARK */.C);
result.push(constants/* .SPACE */.t6);
result.push(node.comment.value);
}
return result.join(constants/* .EMPTY */.wg);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/network/network-rule-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Generator for network rule nodes.
*/
class NetworkRuleGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Generates a string from a network rule AST node.
*
* @param node Network rule node to generate a string from.
*
* @returns Generated string representation of the network rule.
*/
static generate(node) {
let result = constants/* .EMPTY */.wg;
// If the rule is an exception, add the exception marker: `@@||example.org`
if (node.exception) {
result += constants/* .NETWORK_RULE_EXCEPTION_MARKER */.rF;
}
// Add the pattern: `||example.org`
result += node.pattern.value;
// If there are modifiers, add a separator and the modifiers: `||example.org$important`
if (node.modifiers && node.modifiers.children.length > 0) {
result += constants/* .NETWORK_RULE_SEPARATOR */.Xj;
result += ModifierListGenerator.generate(node.modifiers);
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/generator/rule-generator.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* RuleGenerator is responsible for converting adblock rule ASTs to their string representation.
*/
class RuleGenerator extends base_generator/* .BaseGenerator */.t {
/**
* Converts a rule AST to a string.
*
* @param ast Adblock rule AST.
*
* @returns Raw string.
*
* @example
* Take a look at the following example:
* ```js
* // Parse the rule to the AST
* const ast = RuleParser.parse("example.org##.banner");
* // Generate the rule from the AST
* const raw = RuleParser.generate(ast);
* // Print the generated rule
* console.log(raw); // "example.org##.banner"
* ```
*/
static generate(ast) {
switch (ast.category) {
// Empty lines
case nodes/* .RuleCategory.Empty */.$O.Empty:
return constants/* .EMPTY */.wg;
// Invalid rules
case nodes/* .RuleCategory.Invalid */.$O.Invalid:
return ast.raw;
// Comment rules
case nodes/* .RuleCategory.Comment */.$O.Comment:
return CommentRuleGenerator.generate(ast);
// Cosmetic / non-basic rules
case nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic:
return CosmeticRuleGenerator.generate(ast);
// Network / basic rules
case nodes/* .RuleCategory.Network */.$O.Network:
switch (ast.type) {
case nodes/* .NetworkRuleType.HostRule */.vY.HostRule:
return HostRuleGenerator.generate(ast);
case nodes/* .NetworkRuleType.NetworkRule */.vY.NetworkRule:
return NetworkRuleGenerator.generate(ast);
default:
throw new Error('Unknown network rule type');
}
default:
throw new Error('Unknown rule category');
}
}
}
},
6730() {
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
},
79864(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
$O: () => (RuleCategory),
WR: () => (ListItemNodeType),
gV: () => (CommentRuleType),
h6: () => (ListNodeType),
k9: () => (CosmeticRuleType),
oC: () => (OperatorValue),
p5: () => (CosmeticRuleSeparator),
vY: () => (NetworkRuleType),
yg: () => (CommentMarker)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
const OperatorValue = {
Not: '!',
And: '&&',
Or: '||',
};
/**
* Represents the different comment markers that can be used in an adblock rule.
*
* @example
* - If the rule is `! This is just a comment`, then the marker will be `!`.
* - If the rule is `# This is just a comment`, then the marker will be `#`.
*/
const CommentMarker = {
/**
* Regular comment marker. It is supported by all ad blockers.
*/
Regular: '!',
/**
* Hashmark comment marker. It is supported by uBlock Origin and AdGuard,
* and also used in hosts files.
*/
Hashmark: '#',
};
/**
* Represents the main categories that an adblock rule can belong to.
* Of course, these include additional subcategories.
*/
const RuleCategory = {
/**
* Empty "rules" that are only containing whitespaces. These rules are handled just for convenience.
*/
Empty: 'Empty',
/**
* Syntactically invalid rules (tolerant mode only).
*/
Invalid: 'Invalid',
/**
* Comment rules, such as comment rules, metadata rules, preprocessor rules, etc.
*/
Comment: 'Comment',
/**
* Cosmetic rules, such as element hiding rules, CSS rules, scriptlet rules, HTML rules, and JS rules.
*/
Cosmetic: 'Cosmetic',
/**
* Network rules, such as basic network rules, header remover network rules, redirect network rules,
* response header filtering rules, etc.
*/
Network: 'Network',
};
/**
* Represents similar types of modifiers values
* which may be separated by a comma `,` (only for DomainList) or a pipe `|`.
*/
const ListNodeType = {
AppList: 'AppList',
DomainList: 'DomainList',
MethodList: 'MethodList',
StealthOptionList: 'StealthOptionList',
};
/**
* Represents child items for {@link ListNodeType}.
*/
const ListItemNodeType = {
Unknown: 'Unknown',
App: 'App',
Domain: 'Domain',
Method: 'Method',
StealthOption: 'StealthOption',
};
/**
* Represents possible comment types.
*/
const CommentRuleType = {
AgentCommentRule: 'AgentCommentRule',
CommentRule: 'CommentRule',
ConfigCommentRule: 'ConfigCommentRule',
HintCommentRule: 'HintCommentRule',
MetadataCommentRule: 'MetadataCommentRule',
PreProcessorCommentRule: 'PreProcessorCommentRule',
};
/**
* Represents possible cosmetic rule types.
*/
const CosmeticRuleType = {
ElementHidingRule: 'ElementHidingRule',
CssInjectionRule: 'CssInjectionRule',
ScriptletInjectionRule: 'ScriptletInjectionRule',
HtmlFilteringRule: 'HtmlFilteringRule',
JsInjectionRule: 'JsInjectionRule',
};
/**
* Represents possible cosmetic rule separators.
*/
const CosmeticRuleSeparator = {
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
ElementHiding: '##',
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
ElementHidingException: '#@#',
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
ExtendedElementHiding: '#?#',
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
ExtendedElementHidingException: '#@?#',
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
AbpSnippet: '#$#',
/**
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_basic}
*/
AbpSnippetException: '#@$#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-css-rules}
*/
AdgCssInjection: '#$#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-css-rules}
*/
AdgCssInjectionException: '#@$#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-css-rules}
*/
AdgExtendedCssInjection: '#$?#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#cosmetic-css-rules}
*/
AdgExtendedCssInjectionException: '#@$?#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#scriptlets}
*/
AdgJsInjection: '#%#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#scriptlets}
*/
AdgJsInjectionException: '#@%#',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#html-filtering-rules}
*/
AdgHtmlFiltering: '$$',
/**
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#html-filtering-rules}
*/
AdgHtmlFilteringException: '$@$',
};
/**
* Represents the different types of network rules.
*/
const NetworkRuleType = {
NetworkRule: 'NetworkRule',
HostRule: 'HostRule',
};
},
79963(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
V: () => (BaseParser)
});
/* import */ var _errors_not_implemented_error_js__rspack_import_0 = __webpack_require__(82535);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Base parser class.
*/
/**
* Base class for parsers. Each parser should extend this class.
*/
class BaseParser {
/**
* Parses the input string and returns the AST node.
*
* @param input Input string to parse.
* @param options Parser options, see {@link ParserOptions}.
* @param baseOffset Base offset. Locations in the AST node will be relative to this offset.
* @param args Additional, parser-specific arguments, if needed.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
static parse(input, options, baseOffset, ...args) {
throw new _errors_not_implemented_error_js__rspack_import_0/* .NotImplementedError */.E();
}
}
},
83102(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
B: () => (/* binding */ CommentParser)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/cosmetic-rule-separator.js
var cosmetic_rule_separator = __webpack_require__(77342);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/agent-common.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Possible AdGuard agent markers.
*/
const ADG_NAME_MARKERS = new Set([
'adguard',
'adg',
]);
/**
* Possible uBlock Origin agent markers.
*/
const UBO_NAME_MARKERS = new Set([
'ublock',
'ublock origin',
'ubo',
]);
/**
* Possible Adblock Plus agent markers.
*/
const ABP_NAME_MARKERS = new Set([
'adblock',
'adblock plus',
'adblockplus',
'abp',
]);
/**
* Returns the adblock syntax based on the adblock name parsed from the agent type comment.
* Needed for modifiers validation of network rules by AGLint.
*
* @param name Adblock name.
*
* @returns Adblock syntax.
*/
const getAdblockSyntax = (name) => {
let syntax = adblockers/* .AdblockSyntax.Common */.YG.Common;
const lowerCaseName = name.toLowerCase();
if (ADG_NAME_MARKERS.has(lowerCaseName)) {
syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
}
else if (UBO_NAME_MARKERS.has(lowerCaseName)) {
syntax = adblockers/* .AdblockSyntax.Ubo */.YG.Ubo;
}
else if (ABP_NAME_MARKERS.has(lowerCaseName)) {
syntax = adblockers/* .AdblockSyntax.Abp */.YG.Abp;
}
return syntax;
};
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/value-parser.js
var value_parser = __webpack_require__(29090);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/agent-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `AgentParser` is responsible for parsing single adblock agent elements.
*
* @example
* If the adblock agent rule is
* ```adblock
* [Adblock Plus 2.0; AdGuard]
* ```
* then the adblock agents are `Adblock Plus 2.0` and `AdGuard`, and this
* class is responsible for parsing them. The rule itself is parsed by
* `AgentCommentParser`, which uses this class to parse single agents.
*/
class AgentParser extends base_parser/* .BaseParser */.V {
/**
* Regex to match a version inside a string.
*/
static VERSION_REGEX = /\b\d+\.\d+(\.\d+)?\b/;
/**
* Checks if the string is a valid version.
*
* The string can have a version in formats like
* [Adblock Plus 2.0], or [Adblock Plus 3.1; AdGuard].
*
* @param str String to check.
*
* @returns `true` if the string is a valid version, `false` otherwise.
*/
static isValidVersion(str) {
// Check if the string contains a valid version pattern
return AgentParser.VERSION_REGEX.test(str);
}
/**
* Parses a raw rule as an adblock agent comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Agent rule AST.
*
* @throws {AdblockSyntaxError} If the raw rule cannot be parsed as an adblock agent.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Save name start position
const nameStartIndex = offset;
let nameEndIndex = offset;
// Prepare variables for name and version
let name;
let version;
// default value for the syntax
let syntax = adblockers/* .AdblockSyntax.Common */.YG.Common;
// Get agent parts by splitting it by spaces. The last part may be a version.
// Example: "Adblock Plus 2.0"
while (offset < raw.length) {
// Skip whitespace before the part
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
const partEnd = string/* .StringUtils.findNextWhitespaceCharacter */.$x.findNextWhitespaceCharacter(raw, offset);
const part = raw.slice(offset, partEnd);
if (AgentParser.isValidVersion(part)) {
if (!(0,type_guards/* .isUndefined */.b0)(version)) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Duplicated versions are not allowed', baseOffset + offset, baseOffset + partEnd);
}
const parsedNamePart = raw.slice(nameStartIndex, nameEndIndex);
name = value_parser/* .ValueParser.parse */.J.parse(parsedNamePart, options, baseOffset + nameStartIndex);
version = value_parser/* .ValueParser.parse */.J.parse(part, options, baseOffset + offset);
syntax = getAdblockSyntax(parsedNamePart);
}
else {
nameEndIndex = partEnd;
}
// Skip whitespace after the part
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, partEnd);
}
// If we didn't find a version, the whole string is the name
if ((0,type_guards/* .isUndefined */.b0)(name)) {
const parsedNamePart = raw.slice(nameStartIndex, nameEndIndex);
name = value_parser/* .ValueParser.parse */.J.parse(parsedNamePart, options, baseOffset + nameStartIndex);
syntax = getAdblockSyntax(parsedNamePart);
}
// Agent name cannot be empty
if (name.value.length === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Agent name cannot be empty', baseOffset, baseOffset + raw.length);
}
const result = {
type: 'Agent',
adblock: name,
syntax,
};
// only add version if it's present
if (version) {
result.version = version;
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/agent-comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `AgentParser` is responsible for parsing an Adblock agent rules.
* Adblock agent comment marks that the filter list is supposed to
* be used by the specified ad blockers.
*
* @example
* - ```adblock
* [AdGuard]
* ```
* - ```adblock
* [Adblock Plus 2.0]
* ```
* - ```adblock
* [uBlock Origin]
* ```
* - ```adblock
* [uBlock Origin 1.45.3]
* ```
* - ```adblock
* [Adblock Plus 2.0; AdGuard]
* ```
*/
class AgentCommentParser extends base_parser/* .BaseParser */.V {
/**
* Checks if the raw rule is an adblock agent comment.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is an adblock agent, `false` otherwise.
*/
static isAgentRule(raw) {
const rawTrimmed = raw.trim();
if (rawTrimmed.startsWith(constants/* .OPEN_SQUARE_BRACKET */.cU) && rawTrimmed.endsWith(constants/* .CLOSE_SQUARE_BRACKET */.A1)) {
// Avoid this case: [$adg-modifier]##[class^="adg-"]
return (0,type_guards/* .isNull */.kZ)(cosmetic_rule_separator/* .CosmeticRuleSeparatorUtils.find */.m.find(rawTrimmed));
}
return false;
}
/**
* Parses a raw rule as an adblock agent comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Agent rule AST or null (if the raw rule cannot be parsed as an adblock agent comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Ignore non-agent rules
if (!AgentCommentParser.isAgentRule(raw)) {
return null;
}
let offset = 0;
// Skip whitespace characters before the rule
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Skip opening bracket
offset += 1;
// last character should be a closing bracket
const closingBracketIndex = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, raw.length - 1);
if (closingBracketIndex === -1 || raw[closingBracketIndex] !== constants/* .CLOSE_SQUARE_BRACKET */.A1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Missing closing bracket', offset, offset + raw.length);
}
// Initialize the agent list
const result = {
type: nodes/* .CommentRuleType.AgentCommentRule */.gV.AgentCommentRule,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
children: [],
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
while (offset < closingBracketIndex) {
// Skip whitespace characters before the agent
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Find the separator or the closing bracket
let separatorIndex = raw.indexOf(constants/* .SEMICOLON */.I8, offset);
if (separatorIndex === -1) {
separatorIndex = closingBracketIndex;
}
// Find the last non-whitespace character of the agent
// [AdGuard ; Adblock Plus 2.0]
// ^
// (if we have spaces between the agent name and the separator)
const agentEndIndex = string/* .StringUtils.findLastNonWhitespaceCharacter */.$x.findLastNonWhitespaceCharacter(raw.slice(offset, separatorIndex)) + offset + 1;
// Collect the agent
result.children.push(AgentParser.parse(raw.slice(offset, agentEndIndex), options, baseOffset + offset));
// Set the offset to the next agent or the end of the rule
offset = separatorIndex + 1;
}
if (result.children.length === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Empty agent list', baseOffset, baseOffset + raw.length);
}
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/json5@2.2.3/node_modules/json5/dist/index.js
var dist = __webpack_require__(57917);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/parameter-list-parser.js
var parameter_list_parser = __webpack_require__(43939);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/config-comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file AGLint configuration comments. Inspired by ESLint inline configuration comments.
*
* @see {@link https://eslint.org/docs/latest/user-guide/configuring/rules#using-configuration-comments}
*/
/**
* `ConfigCommentParser` is responsible for parsing inline AGLint configuration rules.
* Generally, the idea is inspired by ESLint inline configuration comments.
*
* @see {@link https://eslint.org/docs/latest/user-guide/configuring/rules#using-configuration-comments}
*/
class ConfigCommentParser extends base_parser/* .BaseParser */.V {
/**
* Checks if the raw rule is an inline configuration comment rule.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is an inline configuration comment rule, otherwise `false`.
*/
static isConfigComment(raw) {
const trimmed = raw.trim();
if (trimmed[0] === nodes/* .CommentMarker.Regular */.yg.Regular || trimmed[0] === nodes/* .CommentMarker.Hashmark */.yg.Hashmark) {
// Skip comment marker and trim comment text (it is necessary because of "! something")
const text = raw.slice(1).trim();
// The code below is "not pretty", but it runs fast, which is necessary, since it will run on EVERY comment
// The essence of the indicator is that the control comment always starts with the "aglint" prefix
return ((text[0] === 'a' || text[0] === 'A')
&& (text[1] === 'g' || text[1] === 'G')
&& (text[2] === 'l' || text[2] === 'L')
&& (text[3] === 'i' || text[3] === 'I')
&& (text[4] === 'n' || text[4] === 'N')
&& (text[5] === 't' || text[5] === 'T'));
}
return false;
}
/**
* Parses a raw rule as an inline configuration comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns
* Inline configuration comment AST or null (if the raw rule cannot be parsed as configuration comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
if (!ConfigCommentParser.isConfigComment(raw)) {
return null;
}
let offset = 0;
// Skip leading whitespace (if any)
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Get comment marker
const marker = value_parser/* .ValueParser.parse */.J.parse(raw[offset], options, baseOffset + offset);
// Skip marker
offset += 1;
// Skip whitespace (if any)
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save the command start position
const commandStart = offset;
// Get comment text, for example: "aglint-disable-next-line"
offset = string/* .StringUtils.findNextWhitespaceCharacter */.$x.findNextWhitespaceCharacter(raw, offset);
const command = value_parser/* .ValueParser.parse */.J.parse(raw.slice(commandStart, offset), options, baseOffset + commandStart);
// Skip whitespace after command
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Get comment (if any)
const commentStart = raw.indexOf(constants/* .AGLINT_CONFIG_COMMENT_MARKER */.Ez, offset);
const commentEnd = commentStart !== -1 ? string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1 : -1;
let comment;
// Check if there is a comment
if (commentStart !== -1) {
comment = value_parser/* .ValueParser.parse */.J.parse(raw.slice(commentStart, commentEnd), options, baseOffset + commentStart);
}
// Get parameter
const paramsStart = offset;
const paramsEnd = commentStart !== -1
? string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, commentStart - 1) + 1
: string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1;
let params;
// `! aglint ...` config comment
if (command.value === constants/* .AGLINT_COMMAND_PREFIX */.BH) {
params = {
type: 'ConfigNode',
// It is necessary to use JSON5.parse instead of JSON.parse because JSON5 allows unquoted keys.
// But don't forget to add { } to the beginning and end of the string,
// otherwise JSON5 will not be able to parse it.
// TODO: Better solution? ESLint uses "levn" package for parsing these comments.
value: dist.parse(`{${raw.slice(paramsStart, paramsEnd)}}`),
};
if (options.isLocIncluded) {
params.start = paramsStart;
params.end = paramsEnd;
}
// Throw error for empty config
if (Object.keys(params.value).length === 0) {
throw new Error('Empty AGLint config');
}
}
else if (paramsStart < paramsEnd) {
params = parameter_list_parser/* .ParameterListParser.parse */.D.parse(raw.slice(paramsStart, paramsEnd), options, baseOffset + paramsStart, constants/* .COMMA */.KE);
}
const result = {
type: nodes/* .CommentRuleType.ConfigCommentRule */.gV.ConfigCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
marker,
command,
params,
comment,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/hint-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-param-reassign */
/**
* @file AdGuard Hints.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#hints}
*/
/**
* `HintParser` is responsible for parsing AdGuard hints.
*
* @example
* If the hint rule is
* ```adblock
* !+ NOT_OPTIMIZED PLATFORM(windows)
* ```
* then the hints are `NOT_OPTIMIZED` and `PLATFORM(windows)`, and this
* class is responsible for parsing them. The rule itself is parsed by
* the `HintRuleParser`, which uses this class to parse single hints.
*/
class HintParser extends base_parser/* .BaseParser */.V {
/**
* Parses a raw rule as a hint.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Hint rule AST or null.
*
* @throws If the syntax is invalid.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Skip whitespace characters before the hint
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw);
// Hint should start with the hint name in every case
// Save the start offset of the hint name
const nameStartIndex = offset;
// Parse the hint name
for (; offset < raw.length; offset += 1) {
const char = raw[offset];
// Abort consuming the hint name if we encounter a whitespace character
// or an opening parenthesis, which means 'HIT_NAME(' case
if (char === constants/* .OPEN_PARENTHESIS */.Cx || char === constants/* .SPACE */.t6) {
break;
}
// Hint name should only contain letters, digits, and underscores
if (!string/* .StringUtils.isAlphaNumeric */.$x.isAlphaNumeric(char) && char !== constants/* .UNDERSCORE */.fB) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Invalid character "${char}" in hint name: "${char}"`, baseOffset + nameStartIndex, baseOffset + offset);
}
}
// Save the end offset of the hint name
const nameEndIndex = offset;
// Save the hint name token
const name = raw.slice(nameStartIndex, nameEndIndex);
// Hint name cannot be empty
if (name === constants/* .EMPTY */.wg) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Empty hint name', baseOffset, baseOffset + nameEndIndex);
}
// Now we have two case:
// 1. We have HINT_NAME and should return it
// 2. We have HINT_NAME(PARAMS) and should continue parsing
// Skip whitespace characters after the hint name
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Throw error for 'HINT_NAME (' case
if (offset > nameEndIndex && raw[offset] === constants/* .OPEN_PARENTHESIS */.Cx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Unexpected whitespace(s) between hint name and opening parenthesis', baseOffset + nameEndIndex, baseOffset + offset);
}
// Create the hint name node (we can reuse it in the 'HINT_NAME' case, if needed)
const nameNode = value_parser/* .ValueParser.parse */.J.parse(name, options, baseOffset + nameStartIndex);
// Just return the hint name if we have 'HINT_NAME' case (no params)
if (raw[offset] !== constants/* .OPEN_PARENTHESIS */.Cx) {
const result = {
type: 'Hint',
name: nameNode,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + offset;
}
return result;
}
// Skip the opening parenthesis
offset += 1;
// Find closing parenthesis
const closeParenthesisIndex = raw.lastIndexOf(constants/* .CLOSE_PARENTHESIS */.s1);
// Throw error if we don't have closing parenthesis
if (closeParenthesisIndex === -1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Missing closing parenthesis for hint "${name}"`, baseOffset + nameStartIndex, baseOffset + raw.length);
}
// Save the start and end index of the params
const paramsStartIndex = offset;
const paramsEndIndex = closeParenthesisIndex;
// Parse the params
const params = parameter_list_parser/* .ParameterListParser.parse */.D.parse(raw.slice(paramsStartIndex, paramsEndIndex), options, baseOffset + paramsStartIndex, constants/* .COMMA */.KE);
offset = closeParenthesisIndex + 1;
// Skip whitespace characters after the closing parenthesis
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Throw error if we don't reach the end of the input
if (offset !== raw.length) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(
// eslint-disable-next-line max-len
`Unexpected input after closing parenthesis for hint "${name}": "${raw.slice(closeParenthesisIndex + 1, offset + 1)}"`, baseOffset + closeParenthesisIndex + 1, baseOffset + offset + 1);
}
// Return the HINT_NAME(PARAMS) case AST
const result = {
type: 'Hint',
name: nameNode,
params,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + offset;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/hint-comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `HintRuleParser` is responsible for parsing AdGuard hint rules.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#hints}
*
* @example
* The following hint rule
* ```adblock
* !+ NOT_OPTIMIZED PLATFORM(windows)
* ```
* contains two hints: `NOT_OPTIMIZED` and `PLATFORM`.
*/
class HintCommentParser extends base_parser/* .BaseParser */.V {
/**
* Checks if the raw rule is a hint rule.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is a hint rule, `false` otherwise.
*/
static isHintRule(raw) {
return raw.trim().startsWith(constants/* .HINT_MARKER */.j6);
}
/**
* Parses a raw rule as a hint comment.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#hints-1}
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Hint AST or null (if the raw rule cannot be parsed as a hint comment).
*
* @throws If the input matches the HINT pattern but syntactically invalid.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Ignore non-hint rules
if (!HintCommentParser.isHintRule(raw)) {
return null;
}
let offset = 0;
// Skip whitespace characters before the rule
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw);
// Skip hint marker
offset += constants/* .HINT_MARKER_LEN */.BR;
const hints = [];
// Collect hints. Each hint is a string, optionally followed by a parameter list,
// enclosed in parentheses. One rule can contain multiple hints.
while (offset < raw.length) {
// Split rule into raw hints (e.g. 'HINT_NAME' or 'HINT_NAME(PARAMS)')
// Hints are separated by whitespace characters, but we should ignore
// whitespace characters inside the parameter list
// Ignore whitespace characters before the hint
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save the start index of the hint
const hintStartIndex = offset;
// Find the end of the hint
let hintEndIndex = offset;
let balance = 0;
while (hintEndIndex < raw.length) {
if (raw[hintEndIndex] === constants/* .OPEN_PARENTHESIS */.Cx && raw[hintEndIndex - 1] !== constants/* .BACKSLASH */.r_) {
balance += 1;
// Throw error for nesting
if (balance > 1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Invalid hint: nested parentheses are not allowed', baseOffset + hintStartIndex, baseOffset + hintEndIndex);
}
}
else if (raw[hintEndIndex] === constants/* .CLOSE_PARENTHESIS */.s1 && raw[hintEndIndex - 1] !== constants/* .BACKSLASH */.r_) {
balance -= 1;
}
else if (string/* .StringUtils.isWhitespace */.$x.isWhitespace(raw[hintEndIndex]) && balance === 0) {
break;
}
hintEndIndex += 1;
}
offset = hintEndIndex;
// Skip whitespace characters after the hint
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Parse the hint
const hint = HintParser.parse(raw.slice(hintStartIndex, hintEndIndex), options, baseOffset + hintStartIndex);
hints.push(hint);
}
// Throw error if no hints were found
if (hints.length === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Empty hint rule', baseOffset, baseOffset + offset);
}
const result = {
type: nodes/* .CommentRuleType.HintCommentRule */.gV.HintCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
children: hints,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + offset;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/metadata-comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Metadata comments.
*/
/**
* Set of known metadata headers. This helps to quickly identify and validate
* metadata headers in the comments.
*/
const KNOWN_METADATA_HEADERS = new Set([
'Checksum',
'Description',
'Expires',
'Homepage',
'Last Modified',
'LastModified',
'Licence',
'License',
'Time Updated',
'TimeUpdated',
'Version',
'Title',
]);
/**
* `MetadataParser` is responsible for parsing metadata comments.
* Metadata comments are special comments that specify some properties of the list.
*
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#special-comments}
*
* @example
* For example, in the case of
* ```adblock
* ! Title: My List
* ```
* the name of the header is `Title`, and the value is `My List`, which means that
* the list title is `My List`, and it can be used in the adblocker UI.
*/
class MetadataCommentParser extends base_parser/* .BaseParser */.V {
/**
* Parses a raw rule as a metadata comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Metadata comment AST or null (if the raw rule cannot be parsed as a metadata comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Fast check to avoid unnecessary work
if (raw.indexOf(constants/* .COLON */.oH) === -1) {
return null;
}
let offset = 0;
// Skip leading spaces before the comment marker
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Check if the rule starts with a comment marker (first non-space sequence)
if (raw[offset] !== nodes/* .CommentMarker.Regular */.yg.Regular && raw[offset] !== nodes/* .CommentMarker.Hashmark */.yg.Hashmark) {
return null;
}
// Consume the comment marker
const marker = value_parser/* .ValueParser.parse */.J.parse(raw[offset], options, baseOffset + offset);
offset += 1;
// Skip spaces
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save header start position
const headerStart = offset;
// Check if the comment text starts with a known header
const text = raw.slice(offset);
for (const knownHeader of KNOWN_METADATA_HEADERS) {
// Check if the comment text starts with the header (case-insensitive)
if (text.toLocaleLowerCase().startsWith(knownHeader.toLocaleLowerCase())) {
// Skip the header
offset += knownHeader.length;
// Save header
const header = value_parser/* .ValueParser.parse */.J.parse(raw.slice(headerStart, offset), options, baseOffset + headerStart);
// Skip spaces after the header
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Check if the rule contains a separator after the header
if (raw[offset] !== constants/* .COLON */.oH) {
return null;
}
// Skip the separator
offset += 1;
// Skip spaces after the separator
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save the value start position
const valueStart = offset;
// Check if the rule contains a value
if (offset >= raw.length) {
return null;
}
const valueEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, raw.length - 1) + 1;
// Save the value
const value = value_parser/* .ValueParser.parse */.J.parse(raw.slice(valueStart, valueEnd), options, baseOffset + valueStart);
const result = {
type: nodes/* .CommentRuleType.MetadataCommentRule */.gV.MetadataCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
marker,
header,
value,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
return null;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/logical-expression-parser.js
var logical_expression_parser = __webpack_require__(48609);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/preprocessor-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Pre-processor directives.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#pre-processor-directives}
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#pre-parsing-directives}
*/
/**
* `PreProcessorParser` is responsible for parsing preprocessor rules.
* Pre-processor comments are special comments that are used to control the behavior of the filter list processor.
* Please note that this parser only handles general syntax for now, and does not validate the parameters at
* the parsing stage.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#pre-processor-directives}
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#pre-parsing-directives}
*
* @example
* If your rule is
* ```adblock
* !#if (adguard)
* ```
* then the directive's name is `if` and its value is `(adguard)`, but the parameter list
* is not parsed / validated further.
*/
class PreProcessorCommentParser extends base_parser/* .BaseParser */.V {
/**
* Determines whether the rule is a pre-processor rule.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is a pre-processor rule, `false` otherwise.
*/
static isPreProcessorRule(raw) {
const trimmed = raw.trim();
// Avoid this case: !##... (commonly used in AdGuard filters)
return trimmed.startsWith(constants/* .PREPROCESSOR_MARKER */.PD) && trimmed[constants/* .PREPROCESSOR_MARKER_LEN */.nx] !== constants/* .HASHMARK */.C;
}
/**
* Parses a raw rule as a pre-processor comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns
* Pre-processor comment AST or null (if the raw rule cannot be parsed as a pre-processor comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Ignore non-pre-processor rules
if (!PreProcessorCommentParser.isPreProcessorRule(raw)) {
return null;
}
let offset = 0;
// Ignore whitespace characters before the rule (if any)
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Ignore the pre-processor marker
offset += constants/* .PREPROCESSOR_MARKER_LEN */.nx;
// Ignore whitespace characters after the pre-processor marker (if any)
// Note: this is incorrect according to the spec, but we do it for tolerance
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Directive name should start at this offset, so we save this offset now
const nameStart = offset;
// Consume directive name, so parse the sequence until the first
// whitespace / opening parenthesis / end of string
while (offset < raw.length) {
const ch = raw[offset];
if (ch === constants/* .PREPROCESSOR_SEPARATOR */.sA || ch === constants/* .OPEN_PARENTHESIS */.Cx) {
break;
}
offset += 1;
}
// Save name end offset
const nameEnd = offset;
// Create name node
const name = value_parser/* .ValueParser.parse */.J.parse(raw.slice(nameStart, nameEnd), options, baseOffset + nameStart);
// Ignore whitespace characters after the directive name (if any)
// Note: this may incorrect according to the spec, but we do it for tolerance
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// If the directive name is "safari_cb_affinity", then we have a special case
if (name.value === constants/* .SAFARI_CB_AFFINITY */.us) {
// Throw error if there are spaces after the directive name
if (offset > nameEnd) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Unexpected whitespace after "${constants/* .SAFARI_CB_AFFINITY */.us}" directive name`, baseOffset + nameEnd, baseOffset + offset);
}
// safari_cb_affinity directive optionally accepts a parameter list
// So at this point we should check if there are parameters or not
// (cb_affinity directive followed by an opening parenthesis or if we
// skip the whitespace we reach the end of the string)
if (string/* .StringUtils.skipWS */.$x.skipWS(raw, offset) !== raw.length) {
if (raw[offset] !== constants/* .OPEN_PARENTHESIS */.Cx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Unexpected character '${raw[offset]}' after '${constants/* .SAFARI_CB_AFFINITY */.us}' directive name`, baseOffset + offset, baseOffset + offset + 1);
}
// If we have parameters, then we should parse them
// Note: we don't validate the parameters at this stage
// Ignore opening parenthesis
offset += 1;
// Save parameter list start offset
const parameterListStart = offset;
// Check for closing parenthesis
const closingParenthesesIndex = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw);
if (closingParenthesesIndex === -1 || raw[closingParenthesesIndex] !== constants/* .CLOSE_PARENTHESIS */.s1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Missing closing parenthesis for '${constants/* .SAFARI_CB_AFFINITY */.us}' directive`, baseOffset + offset, baseOffset + raw.length);
}
// Save parameter list end offset
const parameterListEnd = closingParenthesesIndex;
// Parse parameters between the opening and closing parentheses
const result = {
type: nodes/* .CommentRuleType.PreProcessorCommentRule */.gV.PreProcessorCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
name,
// comma separated list of parameters
params: parameter_list_parser/* .ParameterListParser.parse */.D.parse(raw.slice(parameterListStart, parameterListEnd), options, baseOffset + parameterListStart, constants/* .COMMA */.KE),
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
// If we reached the end of the string, then we have a directive without parameters
// (e.g. "!#safari_cb_affinity" or "!#endif")
// No need to continue parsing in this case.
if (offset === raw.length) {
// Throw error if the directive name is "if" or "include", because these directives
// should have parameters
if (name.value === constants.IF || name.value === constants/* .INCLUDE */.rM) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Directive "${name.value}" requires parameters`, baseOffset, baseOffset + raw.length);
}
const result = {
type: nodes/* .CommentRuleType.PreProcessorCommentRule */.gV.PreProcessorCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
name,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
// Get start and end offsets of the directive parameters
const paramsStart = offset;
const paramsEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1;
// Prepare parameters node
let params;
// Parse parameters. Handle "if" and "safari_cb_affinity" directives
// separately.
if (name.value === constants.IF) {
params = logical_expression_parser/* .LogicalExpressionParser.parse */.f.parse(raw.slice(paramsStart, paramsEnd), options, baseOffset + paramsStart);
}
else {
params = value_parser/* .ValueParser.parse */.J.parse(raw.slice(paramsStart, paramsEnd), options, baseOffset + paramsStart);
}
const result = {
type: nodes/* .CommentRuleType.PreProcessorCommentRule */.gV.PreProcessorCommentRule,
category: nodes/* .RuleCategory.Comment */.$O.Comment,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
name,
params,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/simple-comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `SimpleCommentParser` is responsible for parsing simple comments.
* Some comments have a special meaning in adblock syntax, like agent comments or hints,
* but this parser is only responsible for parsing regular comments,
* whose only purpose is to provide some human-readable information.
*
* @example
* ```adblock
* ! This is a simple comment
* # This is a simple comment, but in host-like syntax
* ```
*/
class SimpleCommentParser extends base_parser/* .BaseParser */.V {
/**
* Checks if the raw rule is a simple comment.
*
* @param raw Raw input to check.
*
* @returns `true` if the input is a simple comment, `false` otherwise.
*
* @note This method does not check for adblock agent comments.
*/
static isSimpleComment(raw) {
const trimmed = raw.trim();
// Exclamation mark based comments
if (trimmed.startsWith(nodes/* .CommentMarker.Regular */.yg.Regular)) {
return true;
}
// Hashmark based comments
// Note: in this case, we must be sure that we do not mistakenly parse a cosmetic rule as a #-like comment,
// since most cosmetic rule separators also start with #
if (trimmed.startsWith(nodes/* .CommentMarker.Hashmark */.yg.Hashmark)) {
const result = cosmetic_rule_separator/* .CosmeticRuleSeparatorUtils.find */.m.find(trimmed);
// If we cannot find a separator, it means that the rule is definitely a comment
if (result === null) {
return true;
}
// Otherwise, we must check if the separator is followed by a valid selector
const { end } = result;
// No valid selector
if (!trimmed[end]
|| string/* .StringUtils.isWhitespace */.$x.isWhitespace(trimmed[end])
|| (trimmed[end] === nodes/* .CommentMarker.Hashmark */.yg.Hashmark
&& trimmed[end + 1] === nodes/* .CommentMarker.Hashmark */.yg.Hashmark)) {
return true;
}
}
return false;
}
/**
* Parses a raw rule as a simple comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Comment rule node or null (if the raw rule cannot be parsed as a simple comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Ignore non-comment rules
if (!this.isSimpleComment(raw)) {
return null;
}
// If we are here, it means that the rule is a regular comment
let offset = 0;
// Skip leading whitespace (if any)
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Get comment marker
const marker = value_parser/* .ValueParser.parse */.J.parse(raw[offset], options, baseOffset + offset);
// Skip marker
offset += 1;
// Get comment text
const text = value_parser/* .ValueParser.parse */.J.parse(raw.slice(offset), options, baseOffset + offset);
// Regular comment rule
const result = {
category: nodes/* .RuleCategory.Comment */.$O.Comment,
type: nodes/* .CommentRuleType.CommentRule */.gV.CommentRule,
// TODO: Change syntax when hashmark is used
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
marker,
text,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/comment-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `CommentParser` is responsible for parsing any comment-like adblock rules.
*
* @example
* Example rules:
* - Adblock agent rules:
* - ```adblock
* [AdGuard]
* ```
* - ```adblock
* [Adblock Plus 2.0]
* ```
* - etc.
* - AdGuard hint rules:
* - ```adblock
* !+ NOT_OPTIMIZED
* ```
* - ```adblock
* !+ NOT_OPTIMIZED PLATFORM(windows)
* ```
* - etc.
* - Pre-processor rules:
* - ```adblock
* !#if (adguard)
* ```
* - ```adblock
* !#endif
* ```
* - etc.
* - Metadata rules:
* - ```adblock
* ! Title: My List
* ```
* - ```adblock
* ! Version: 2.0.150
* ```
* - etc.
* - AGLint inline config rules:
* - ```adblock
* ! aglint-enable some-rule
* ```
* - ```adblock
* ! aglint-disable some-rule
* ```
* - etc.
* - Simple comments:
* - Regular version:
* ```adblock
* ! This is just a comment
* ```
* - uBlock Origin / "hostlist" version:
* ```adblock
* # This is just a comment
* ```
* - etc.
*/
class CommentParser extends base_parser/* .BaseParser */.V {
/**
* Checks whether a rule is a comment.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is a comment, `false` otherwise.
*/
static isCommentRule(raw) {
const trimmed = raw.trim();
return SimpleCommentParser.isSimpleComment(trimmed) || AgentCommentParser.isAgentRule(trimmed);
}
/**
* Parses a raw rule as comment.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Comment AST or null (if the raw rule cannot be parsed as comment).
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Ignore non-comment rules
if (!CommentParser.isCommentRule(raw)) {
return null;
}
// Note: we parse non-functional comments at the end,
// if the input does not match any of the previous, more specific comment patterns
return AgentCommentParser.parse(raw, options, baseOffset)
|| HintCommentParser.parse(raw, options, baseOffset)
|| PreProcessorCommentParser.parse(raw, options, baseOffset)
|| MetadataCommentParser.parse(raw, options, baseOffset)
|| ConfigCommentParser.parse(raw, options, baseOffset)
|| SimpleCommentParser.parse(raw, options, baseOffset);
}
}
},
36573(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
R: () => (/* binding */ CosmeticRuleParser)
});
// UNUSED EXPORTS: ERROR_MESSAGES
// EXTERNAL MODULE: ./node_modules/.pnpm/sprintf-js@1.1.3/node_modules/sprintf-js/src/sprintf.js
var sprintf = __webpack_require__(37155);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+css-tokenizer@1.2.0/node_modules/@adguard/css-tokenizer/dist/csstokenizer.mjs
var csstokenizer = __webpack_require__(83747);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/ubo-selector-common.js
var ubo_selector_common = __webpack_require__(15862);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/cosmetic-rule-separator.js
var cosmetic_rule_separator = __webpack_require__(77342);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/comment-parser.js + 9 modules
var comment_parser = __webpack_require__(83102);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/converter/data/css.js
var css = __webpack_require__(63829);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/css-token-stream.js
var css_token_stream = __webpack_require__(44148);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/adg-css-injection-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Parser for AdGuard CSS injections.
*/
const ERROR_MESSAGES = {
MEDIA_QUERY_LIST_IS_EMPTY: 'Media query list is empty',
SELECTOR_LIST_IS_EMPTY: 'Selector list is empty',
DECLARATION_LIST_IS_EMPTY: 'Declaration list is empty',
};
/**
* Parser for AdGuard CSS injection.
*/
class AdgCssInjectionParser extends base_parser/* .BaseParser */.V {
/**
* Parses an AdGuard CSS injection.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Parsed AdGuard CSS injection {@link CssInjectionRuleBody}.
*
* @throws An {@link AdblockSyntaxError} if the selector list is syntactically invalid.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let mediaQueryList;
const selectorList = { type: 'Value', value: constants/* .EMPTY */.wg };
const declarationList = { type: 'Value', value: constants/* .EMPTY */.wg };
const stream = new css_token_stream/* .CssTokenStream */.d(raw, baseOffset);
// Skip leading whitespace characters
stream.skipWhitespace();
// We have two possible CSS injection formats:
// 1. @media (media-query-list) { selector list { declarations separated by semicolons } }
// 2. selector list { declarations separated by semicolons }
// Handle '@media' case:
let balanceShift = 0;
if (stream.getOrFail().type === csstokenizer/* .TokenType.AtKeyword */.ks.AtKeyword) {
// Currently only '@media' is supported, we should throw an error if we encounter anything else,
// like '@supports' or '@charset', etc.
stream.expect(csstokenizer/* .TokenType.AtKeyword */.ks.AtKeyword, { value: constants/* .CSS_MEDIA_MARKER */.Ae, balance: 0 });
stream.advance();
// Skip whitespace characters after @media keyword, if any
// @media (media-query-list) { ...
// ↑
// └ this one (if any)
stream.skipWhitespace();
const mediaQueryListStart = stream.getOrFail().start;
// Skip everything until we found the opening curly bracket of the declaration block
// @media media-query-list { ...
// ↑
// └ this one
let lastNonWsIndex = -1;
while (!stream.isEof()) {
const token = stream.getOrFail();
if (token.type === csstokenizer/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket && token.balance === 1) {
break;
}
if (token.type !== csstokenizer/* .TokenType.Whitespace */.ks.Whitespace) {
lastNonWsIndex = token.end;
}
stream.advance();
}
// If the skipped tokens count is 0 without leading and trailing whitespace characters, then the media query
// list is empty
if (lastNonWsIndex === -1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(ERROR_MESSAGES.MEDIA_QUERY_LIST_IS_EMPTY, baseOffset + mediaQueryListStart, baseOffset + raw.length);
}
// It is safe to use non-null assertion here, because we have already checked previous tokens.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const mediaQueryListEnd = lastNonWsIndex;
mediaQueryList = {
type: 'Value',
value: raw.slice(mediaQueryListStart, mediaQueryListEnd),
};
if (options.isLocIncluded) {
mediaQueryList.start = baseOffset + mediaQueryListStart;
mediaQueryList.end = baseOffset + mediaQueryListEnd;
}
// Next token should be an open curly bracket
// @media (media-query-list) { ...
// ↑
// └ this one
stream.expect(csstokenizer/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket);
stream.advance();
// '@media' at-rule wrap increases the balance level by 1 for the rule within the at-rule, because it
// has its own { ... } block
balanceShift = 1;
}
// Skip leading whitespace before the rule, if any
// Note: rule = selector list { declarations separated by semicolons }
stream.skipWhitespace();
const selectorStart = stream.getOrFail().start;
// Jump to the opening curly bracket of the declaration block, based on the balance level
// .selector { padding-top: 10px; padding-bottom: 10px; }
// ↑
// └ this one
const { skippedTrimmed: selectorTokensLength } = stream.skipUntilExt(csstokenizer/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket, balanceShift + 1);
stream.expect(csstokenizer/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket);
// If the skipped tokens count is 0 without leading and trailing whitespace characters, then the selector list
// is empty
if (selectorTokensLength === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(ERROR_MESSAGES.SELECTOR_LIST_IS_EMPTY, baseOffset + selectorStart, baseOffset + raw.length);
}
// It is safe to use non-null assertion here, because we have already checked previous tokens.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const selectorEnd = stream.lookbehindForNonWs().end;
selectorList.value = raw.slice(selectorStart, selectorEnd);
if (options.isLocIncluded) {
selectorList.start = baseOffset + selectorStart;
selectorList.end = baseOffset + selectorEnd;
}
// Jump to the next token after the opening curly bracket of the declaration block
// .selector { padding-top: 10px; padding-bottom: 10px; }
// ↑
// └ this one
stream.advance();
// Skip whitespace characters after the opening curly bracket of the declaration block, if any
stream.skipWhitespace();
// Jump to the closing curly bracket of the declaration block, based on the balance level
// .selector { padding-top: 10px; padding-bottom: 10px; }
// ↑
// └ this one
const declarationsStart = stream.getOrFail().start;
const declarations = new Set();
let declarationsEnd = -1;
let remove = false;
let lastNonWsIndex = -1;
while (!stream.isEof()) {
const token = stream.getOrFail();
if (token.type === csstokenizer/* .TokenType.CloseCurlyBracket */.ks.CloseCurlyBracket && stream.getBalance() === balanceShift) {
declarationsEnd = lastNonWsIndex;
break;
}
if (token.type !== csstokenizer/* .TokenType.Whitespace */.ks.Whitespace) {
lastNonWsIndex = token.end;
}
if (token.type === csstokenizer/* .TokenType.Ident */.ks.Ident && stream.lookahead()?.type === csstokenizer/* .TokenType.Colon */.ks.Colon) {
const ident = raw.slice(token.start, token.end);
declarations.add(ident);
// Consume ident and colon
stream.advance();
stream.advance();
// only 'remove: true' is allowed
if (ident === css/* .REMOVE_PROPERTY */.JX) {
// Skip whitespace after colon, if any
stream.skipWhitespace();
// Next token should be an ident, with value 'true'
stream.expect(csstokenizer/* .TokenType.Ident */.ks.Ident, { value: css/* .REMOVE_VALUE */.FH });
stream.advance();
remove = true;
}
}
else {
stream.advance();
}
}
if (declarationsEnd === -1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(ERROR_MESSAGES.DECLARATION_LIST_IS_EMPTY, baseOffset + declarationsStart, baseOffset + raw.length);
}
declarationList.value = raw.slice(declarationsStart, declarationsEnd);
if (options.isLocIncluded) {
declarationList.start = baseOffset + declarationsStart;
declarationList.end = baseOffset + declarationsEnd;
}
// Eat the close curly bracket of the declaration block
// .selector { padding-top: 10px; padding-bottom: 10px; }
// ↑
// └ this one
stream.expect(csstokenizer/* .TokenType.CloseCurlyBracket */.ks.CloseCurlyBracket);
stream.advance();
// Skip whitespace after the rule, if any
stream.skipWhitespace();
// If we have a media query, we should have an extra close curly bracket
if (balanceShift === 1) {
stream.expect(csstokenizer/* .TokenType.CloseCurlyBracket */.ks.CloseCurlyBracket);
stream.advance();
}
const result = {
type: 'CssInjectionRuleBody',
selectorList,
declarationList,
remove,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
if (mediaQueryList) {
result.mediaQueryList = mediaQueryList;
}
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/balancing.js
var balancing = __webpack_require__(51175);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/ubo-selector-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Parser for special uBO selectors.
*/
/**
* Possible error messages for uBO selectors. Formatted with {@link sprintf}.
*/
const ubo_selector_parser_ERROR_MESSAGES = {
DUPLICATED_UBO_MODIFIER: "uBO modifier '%s' cannot be used more than once",
EXPECTED_BUT_GOT_BEFORE: "Expected '%s' but got '%s' before '%s'",
// eslint-disable-next-line max-len
NEGATED_UBO_MODIFIER_CANNOT_BE_FOLLOWED_BY: "Negated uBO modifier '%s' cannot be followed by anything else than a closing parenthesis or a whitespace",
NEGATED_UBO_MODIFIER_CANNOT_BE_PRECEDED_BY: "Negated uBO modifier '%s' cannot be preceded by '%s'",
PSEUDO_CANNOT_BE_NESTED: "uBO modifier '%s' cannot be nested inside '%s', only '%s' is allowed as a wrapper",
UBO_MODIFIER_CANNOT_BE_NESTED: "uBO modifier '%s' cannot be nested",
UBO_STYLE_CANNOT_BE_FOLLOWED: 'uBO style injection cannot be followed by anything else than a whitespace',
};
/**
* Dummy parameter for uBO modifiers in error messages.
*/
const DUMMY_PARAM = '...';
/**
* Set of known uBO modifiers.
*
* @note We use `string` instead of `UboPseudoName` because we use this set for checking if a modifier is a known uBO,
* and an unknown sequence is just a string.
*/
const KNOWN_UBO_MODIFIERS = new Set([
ubo_selector_common/* .UboPseudoName.MatchesMedia */.S.MatchesMedia,
ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath,
ubo_selector_common/* .UboPseudoName.Remove */.S.Remove,
ubo_selector_common/* .UboPseudoName.Style */.S.Style,
]);
/**
* Helper function to check if the given selector has any uBO modifier. This function should be fast, because it's used
* in the hot path of the parser.
*
* @param raw Raw selector string.
*
* @returns `true` if the selector has any uBO modifier, `false` otherwise.
*/
const hasAnyUboModifier = (raw) => {
// Find the first colon
let colonIndex = raw.indexOf(constants/* .COLON */.oH);
while (colonIndex !== -1) {
// Find next opening parenthesis
const openingParenthesisIndex = raw.indexOf(constants/* .OPEN_PARENTHESIS */.Cx, colonIndex + 1);
// If there is no opening parenthesis, then the selector doesn't contain any uBO modifier
if (openingParenthesisIndex === -1) {
return false;
}
// Check if the modifier is a known uBO modifier
if (KNOWN_UBO_MODIFIERS.has(raw.slice(colonIndex + 1, openingParenthesisIndex))) {
return true;
}
// Find next colon
colonIndex = raw.indexOf(constants/* .COLON */.oH, colonIndex + 1);
}
return false;
};
/**
* A simple helper function to format a pseudo name for error messages.
*
* @param name Pseudo name.
* @param wrapper Wrapper pseudo name (eg. `not`) (optional, defaults to `undefined`).
*
* @returns Formatted pseudo name.
*
* @example
* ```ts
* formatPseudoName('matches-path', 'not'); // => ':not(:matches-path(...))'
* formatPseudoName('matches-media'); // => ':matches-media(...)'
* ```
*/
const formatPseudoName = (name, wrapper) => {
const result = [];
if (wrapper) {
result.push(constants/* .COLON */.oH, wrapper, constants/* .OPEN_PARENTHESIS */.Cx);
}
result.push(constants/* .COLON */.oH, name, constants/* .OPEN_PARENTHESIS */.Cx, DUMMY_PARAM, constants/* .CLOSE_PARENTHESIS */.s1);
if (wrapper) {
result.push(constants/* .CLOSE_PARENTHESIS */.s1);
}
return result.join(constants/* .EMPTY */.wg);
};
/**
* Parser for uBO selectors.
*/
class UboSelectorParser extends base_parser/* .BaseParser */.V {
/**
* Parses a uBO selector list, eg. `div:matches-path(/path)`.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Parsed uBO selector {@link UboSelectorParser}.
*
* @throws An {@link AdblockSyntaxError} if the selector list is syntactically invalid.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Prepare helper variables
const modifiers = {
type: 'ModifierList',
children: [],
};
if (options.isLocIncluded) {
modifiers.start = baseOffset;
modifiers.end = baseOffset + raw.length;
}
// Do not perform any parsing if the selector doesn't contain any uBO modifier
// Parsing is a relatively expensive operation, but this check is cheap, so we can avoid unnecessary work
// TODO: Move this check to the cosmetic parser (adjustable syntaxes - if uBO syntax is disabled, then we don't
// need to check for uBO modifiers)
if (!hasAnyUboModifier(raw)) {
const selector = {
type: 'Value',
value: raw,
};
if (options.isLocIncluded) {
selector.start = baseOffset;
selector.end = baseOffset + raw.length;
}
const result = {
type: 'UboSelector',
selector,
modifiers,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
// Simple way to check if a modifier is already processed to avoid duplicate modifiers
const processedModifiers = new Set();
// We need to keep track of the tokens for handling negations properly
const tokens = [];
// This array is used to mark the character slots in the selector string that are occupied by uBO modifiers
const uboIndexes = new Array(raw.length);
const uboModifierStack = [];
let i = 0;
// Helper function to stack a uBO modifier
const stackModifier = (modifier) => {
if (processedModifiers.has(modifier.name)) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.DUPLICATED_UBO_MODIFIER, formatPseudoName(modifier.name)), baseOffset + modifier.modifierStart, baseOffset + raw.length);
}
uboModifierStack.push(modifier);
};
// Tokenize the selector, calculate the balance
(0,balancing/* .tokenizeFnBalanced */.g)(raw, (type, start, end, _, balance) => {
// Special case: style injection (`:style(...)` and `:remove()`) can only be used at the end of the
// selector, like
// - `div:style(...)`,
// - `div:matches-media(...):style(...)`,
// - `div:remove()`,
// etc.
//
// But not like
// - `:style(...) div`,
// - `:matches-media(...):style(...) div`,
// - `:remove() div`,
// etc.
//
// The one exception is whitespace, which is allowed after style injection, like
// - `div:style(...) `,
// - `div:matches-media(...):style(...) `,
// - `div:remove() `,
// etc.
if ((processedModifiers.has(ubo_selector_common/* .UboPseudoName.Style */.S.Style)
|| processedModifiers.has(ubo_selector_common/* .UboPseudoName.Remove */.S.Remove))
&& type !== csstokenizer/* .TokenType.Whitespace */.ks.Whitespace) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(ubo_selector_parser_ERROR_MESSAGES.UBO_STYLE_CANNOT_BE_FOLLOWED, baseOffset + start, baseOffset + raw.length);
}
// Check for pseudo classes (colon followed by a function)
if (tokens[i - 1]?.type === csstokenizer/* .TokenType.Colon */.ks.Colon && type === csstokenizer/* .TokenType.Function */.ks.Function) {
// Since closing parenthesis is always included in the function token, but we only need the function
// name, we need to cut off the last character, this is why we use `end - 1` here
const fn = raw.slice(start, end - 1);
// Check if the pseudo class is a known uBO modifier
if (KNOWN_UBO_MODIFIERS.has(fn)) {
// Generally, uBO modifiers cannot be nested, like
// - `:any(:matches-media(...))`,
// - `:matches-media(:matches-media(...))`,
// - `:not(style(...))`,
// etc.
if (balance > 1) {
// However, we have one exception: `:matches-path()` can be nested inside `:not()`s, like:
// - `:not(:matches-path(...))`,
// - `:not(:not(:matches-path(...)))`,
// etc.
//
// But it can't be nested inside any other pseudo class, like:
// - `:anything(:matches-path(...))`,
// etc.
//
// Moreover, :not() can't contain any other data, like
// - `:not(div:matches-path(...))`,
// - `:not(:matches-path(...):matches-path(...))`,
// - `:not(:matches-path(...) div)`,
// etc.
if (fn === ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath) {
if (uboModifierStack.length > 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.PSEUDO_CANNOT_BE_NESTED, formatPseudoName(ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath), formatPseudoName(uboModifierStack[uboModifierStack.length - 1].name), formatPseudoName(constants/* .CSS_NOT_PSEUDO */.vr)), baseOffset + start - 1, baseOffset + raw.length);
}
let isException = false;
let modifierBalance = balance;
let modifierStart = start;
for (let j = i - 1; j >= 0; j -= 1) {
// If we have reached the root level, then we should check if the `not` function is
// preceded by a colon (which means that it's a pseudo class)
if (tokens[j].balance === 0) {
modifierStart = tokens[j].start;
modifierBalance = tokens[j].balance;
break;
}
else if (tokens[j].type === csstokenizer/* .TokenType.Colon */.ks.Colon
|| tokens[j].type === csstokenizer/* .TokenType.Whitespace */.ks.Whitespace) {
continue;
}
else if (tokens[j].type === csstokenizer/* .TokenType.Function */.ks.Function) {
const wrapperFnName = raw.slice(tokens[j].start, tokens[j].end - 1);
if (wrapperFnName !== constants/* .CSS_NOT_PSEUDO */.vr) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.PSEUDO_CANNOT_BE_NESTED, formatPseudoName(ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath), formatPseudoName(wrapperFnName), formatPseudoName(constants/* .CSS_NOT_PSEUDO */.vr)), baseOffset + tokens[j].start - 1, baseOffset + raw.length);
}
if (tokens[j - 1]?.type !== csstokenizer/* .TokenType.Colon */.ks.Colon) {
const got = tokens[j - 1]?.type
? (0,csstokenizer/* .getFormattedTokenName */.bZ)(tokens[j - 1]?.type)
: 'nothing';
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.EXPECTED_BUT_GOT_BEFORE, (0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.Colon */.ks.Colon), got, formatPseudoName(ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath, constants/* .CSS_NOT_PSEUDO */.vr)),
// eslint-disable-next-line no-unsafe-optional-chaining
baseOffset + tokens[j - 1]?.start || 0, baseOffset + raw.length);
}
isException = !isException;
continue;
}
else {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.NEGATED_UBO_MODIFIER_CANNOT_BE_PRECEDED_BY, formatPseudoName(ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath), (0,csstokenizer/* .getFormattedTokenName */.bZ)(tokens[j].type)), baseOffset + tokens[j].start, baseOffset + raw.length);
}
}
stackModifier({
name: fn,
modifierStart,
modifierBalance,
nameStart: start,
nameEnd: end - 1, // ignore opening parenthesis
valueStart: end,
valueBalance: balance,
isException,
});
}
else {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.UBO_MODIFIER_CANNOT_BE_NESTED, formatPseudoName(fn)), baseOffset + start - 1, baseOffset + raw.length);
}
}
else {
stackModifier({
name: fn,
modifierStart: start - 1, // Include the colon
modifierBalance: balance,
nameStart: start,
nameEnd: end - 1, // ignore opening parenthesis
valueStart: end,
valueBalance: balance,
isException: false,
});
}
}
}
else {
// Get the last stacked modifier
const lastStackedModifier = uboModifierStack[uboModifierStack.length - 1];
// Do not allow any other token after `:matches-path(...)` inside `:not(...)`
if (lastStackedModifier?.name === ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath && lastStackedModifier?.isException) {
if (!(type === csstokenizer/* .TokenType.CloseParenthesis */.ks.CloseParenthesis || type === csstokenizer/* .TokenType.Whitespace */.ks.Whitespace)
&& balance < lastStackedModifier.valueBalance) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(ubo_selector_parser_ERROR_MESSAGES.NEGATED_UBO_MODIFIER_CANNOT_BE_FOLLOWED_BY, formatPseudoName(ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath), (0,csstokenizer/* .getFormattedTokenName */.bZ)(type)), baseOffset + start, baseOffset + raw.length);
}
}
// If we have reached a closing parenthesis, then we should check if it closes the last stacked modifier
// and if so, pop it from the stack
if (type === csstokenizer/* .TokenType.CloseParenthesis */.ks.CloseParenthesis && lastStackedModifier) {
if (balance === Math.max(0, lastStackedModifier.valueBalance - 1)) {
lastStackedModifier.valueEnd = start;
}
if (balance === Math.max(0, lastStackedModifier.modifierBalance - 1)) {
const modifierName = {
type: 'Value',
value: lastStackedModifier.name,
};
if (options.isLocIncluded) {
// TODO: Refactor
modifierName.start = baseOffset + lastStackedModifier.nameStart;
modifierName.end = baseOffset + lastStackedModifier.nameEnd;
}
const value = {
type: 'Value',
value: raw.slice(lastStackedModifier.valueStart, lastStackedModifier.valueEnd),
};
if (options.isLocIncluded) {
value.start = baseOffset + lastStackedModifier.valueStart;
// It's safe to use `!` here, because we determined the value end index in the
// previous `if` statement
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
value.end = baseOffset + lastStackedModifier.valueEnd;
}
const modifier = {
type: 'Modifier',
name: modifierName,
value,
exception: lastStackedModifier.isException,
};
if (options.isLocIncluded) {
modifier.start = baseOffset + lastStackedModifier.modifierStart;
modifier.end = baseOffset + end;
}
modifiers.children.push(modifier);
processedModifiers.add(lastStackedModifier.name);
uboModifierStack.pop();
// Mark the character slots in the selector string that are occupied by uBO modifiers
uboIndexes.fill(true, lastStackedModifier.modifierStart, end);
}
}
}
// Save the token to the history and increase the index
tokens.push({
type,
start,
end,
balance,
});
i += 1;
});
const selector = {
type: 'Value',
value: raw
.split(constants/* .EMPTY */.wg)
.map((char, p) => (uboIndexes[p] ? constants/* .EMPTY */.wg : char))
.join(constants/* .EMPTY */.wg)
.trim(),
};
if (options.isLocIncluded) {
selector.start = baseOffset;
selector.end = baseOffset + raw.length;
}
const result = {
type: 'UboSelector',
selector,
modifiers,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/domain-list-parser.js + 1 modules
var domain_list_parser = __webpack_require__(70254);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/modifier-list.js + 1 modules
var modifier_list = __webpack_require__(24704);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/html-filtering-body/adg-html-filtering-body-parser.js
var adg_html_filtering_body_parser = __webpack_require__(55576);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/html-filtering-body/ubo-html-filtering-body-parser.js
var ubo_html_filtering_body_parser = __webpack_require__(91090);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/common/abp-snippet-injection-body-common.js
var abp_snippet_injection_body_common = __webpack_require__(7596);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/parameter-list-parser.js
var parameter_list_parser = __webpack_require__(43939);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/scriptlet-body/abp-snippet-injection-body-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file UBlock scriptlet injection body parser.
*/
/**
* `AbpSnippetInjectionBodyParser` is responsible for parsing the body of an Adblock Plus-style snippet rule.
*
* Please note that the parser will parse any scriptlet rule if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* example.com#$#snippet0 arg0
* ```
*
* But it didn't check if the scriptlet `snippet0` actually supported by any adblocker..
*
* @see {@link https://help.eyeo.com/adblockplus/snippet-filters-tutorial}
*/
class AbpSnippetInjectionBodyParser extends base_parser/* .BaseParser */.V {
/**
* Parses the body of an Adblock Plus-style snippet rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed scriptlet call body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* #$#snippet0 arg0
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
const result = {
type: 'ScriptletInjectionRuleBody',
children: [],
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
let offset = 0;
// Skip leading spaces
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
while (offset < raw.length) {
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
const scriptletCallStart = offset;
// Find the next semicolon or the end of the string
let semicolonIndex = string/* .StringUtils.findUnescapedNonStringNonRegexChar */.$x.findUnescapedNonStringNonRegexChar(raw, constants/* .SEMICOLON */.I8, offset);
if (semicolonIndex === -1) {
semicolonIndex = raw.length;
}
const scriptletCallEnd = Math.max(string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, semicolonIndex - 1) + 1, scriptletCallStart);
const params = parameter_list_parser/* .ParameterListParser.parse */.D.parse(raw.slice(scriptletCallStart, scriptletCallEnd), options, baseOffset + scriptletCallStart, constants/* .SPACE */.t6);
// Parse the scriptlet call
result.children.push(params);
// Skip the semicolon
offset = semicolonIndex + 1;
}
if (result.children.length === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(abp_snippet_injection_body_common/* .AbpSnippetInjectionBodyCommon.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL */.H.ERROR_MESSAGES.EMPTY_SCRIPTLET_CALL, baseOffset, baseOffset + raw.length);
}
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/type-guards.js
var type_guards = __webpack_require__(64505);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/value-parser.js
var value_parser = __webpack_require__(29090);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/scriptlet-body/adg-scriptlet-injection-body-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file AdGuard scriptlet injection body parser.
*/
/**
* `AdgScriptletInjectionBodyParser` is responsible for parsing the body of an AdGuard-style scriptlet rule.
*
* Please note that the parser will parse any scriptlet rule if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* example.com#%#//scriptlet('scriptlet0', 'arg0')
* ```
*
* But it didn't check if the scriptlet `scriptlet0` actually supported by any adblocker..
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#scriptlets}
*/
class AdgScriptletInjectionBodyParser extends base_parser/* .BaseParser */.V {
/**
* Error messages used by the parser.
*/
static ERROR_MESSAGES = {
NO_SCRIPTLET_MASK: `Invalid ADG scriptlet call, no scriptlet call mask '${constants/* .ADG_SCRIPTLET_MASK */.x$}' found`,
NO_OPENING_PARENTHESIS: `Invalid ADG scriptlet call, no opening parentheses '${constants/* .OPEN_PARENTHESIS */.Cx}' found`,
NO_CLOSING_PARENTHESIS: `Invalid ADG scriptlet call, no closing parentheses '${constants/* .CLOSE_PARENTHESIS */.s1}' found`,
WHITESPACE_AFTER_MASK: 'Invalid ADG scriptlet call, whitespace is not allowed after the scriptlet call mask',
NO_INCONSISTENT_QUOTES: 'Invalid ADG scriptlet call, inconsistent quotes',
NO_UNCLOSED_PARAMETER: 'Invalid ADG scriptlet call, unclosed parameter',
EXPECTED_QUOTE: "Invalid ADG scriptlet call, expected quote, got '%s'",
EXPECTED_COMMA: "Invalid ADG scriptlet call, expected comma, got '%s'",
};
/**
* Parses the body of an AdGuard-style scriptlet rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed scriptlet call body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* //scriptlet('scriptlet0', 'arg0')
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Skip leading spaces
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Scriptlet call should start with "//scriptlet"
if (!raw.startsWith(constants/* .ADG_SCRIPTLET_MASK */.x$, offset)) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_SCRIPTLET_MASK, baseOffset + offset, baseOffset + raw.length);
}
offset += constants/* .ADG_SCRIPTLET_MASK.length */.x$.length;
// Whitespace is not allowed after the mask
if (raw[offset] === constants/* .SPACE */.t6) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.WHITESPACE_AFTER_MASK, baseOffset + offset, baseOffset + raw.length);
}
// Parameter list should be wrapped in parentheses
if (raw[offset] !== constants/* .OPEN_PARENTHESIS */.Cx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_OPENING_PARENTHESIS, baseOffset + offset, baseOffset + raw.length);
}
// Save the offset of the opening parentheses
const openingParenthesesIndex = offset;
// Skip whitespace from the end
const closingParenthesesIndex = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, raw.length - 1);
// Closing parentheses should be present
if (raw[closingParenthesesIndex] !== constants/* .CLOSE_PARENTHESIS */.s1
|| raw[closingParenthesesIndex - 1] === constants/* .ESCAPE_CHARACTER */.Kx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_CLOSING_PARENTHESIS, baseOffset + offset, baseOffset + raw.length);
}
// Skip space, if any
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset + 1);
const result = {
type: 'ScriptletInjectionRuleBody',
children: [],
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
// Special case: empty scriptlet call, like `//scriptlet()`, `//scriptlet( )` etc.
if (string/* .StringUtils.skipWS */.$x.skipWS(raw, openingParenthesesIndex + 1) === closingParenthesesIndex) {
return result;
}
let detectedQuote = null;
const parameterList = {
type: 'ParameterList',
children: [],
};
if (options.isLocIncluded) {
parameterList.start = baseOffset + openingParenthesesIndex + 1;
parameterList.end = baseOffset + closingParenthesesIndex;
}
while (offset < closingParenthesesIndex) {
// Skip whitespace
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Expect comma if not first parameter
if (parameterList.children.length > 0) {
if (raw[offset] !== constants/* .COMMA */.KE) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(AdgScriptletInjectionBodyParser.ERROR_MESSAGES.EXPECTED_COMMA, raw[offset]), baseOffset + offset, baseOffset + raw.length);
}
// Eat the comma
offset += 1;
// Skip whitespace
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
}
// Next character should be a quote
if (raw[offset] === constants/* .SINGLE_QUOTE */.ur || raw[offset] === constants/* .DOUBLE_QUOTE */.fi) {
if ((0,type_guards/* .isNull */.kZ)(detectedQuote)) {
detectedQuote = raw[offset];
}
else if (detectedQuote !== raw[offset]) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(AdgScriptletInjectionBodyParser.ERROR_MESSAGES.NO_INCONSISTENT_QUOTES, baseOffset + offset, baseOffset + raw.length);
}
// Find next unescaped same quote
const closingQuoteIndex = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, detectedQuote, offset + 1);
if (closingQuoteIndex === -1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(AdgScriptletInjectionBodyParser.ERROR_MESSAGES.NO_UNCLOSED_PARAMETER, baseOffset + offset, baseOffset + raw.length);
}
// Save the parameter
const parameter = value_parser/* .ValueParser.parse */.J.parse(raw.slice(offset, closingQuoteIndex + 1), options, baseOffset + offset);
parameterList.children.push(parameter);
// Move after the closing quote
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, closingQuoteIndex + 1);
}
else {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(AdgScriptletInjectionBodyParser.ERROR_MESSAGES.EXPECTED_QUOTE, raw[offset]), baseOffset + offset, baseOffset + raw.length);
}
}
result.children.push(parameterList);
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/quotes.js
var quotes = __webpack_require__(68999);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/ubo-parameter-list-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Parser for uBO-specific parameter lists.
*/
class UboParameterListParser extends parameter_list_parser/* .ParameterListParser */.D {
/**
* Parses an "uBO-specific parameter list".
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
* @param separator Separator character (default: comma).
* @param requireQuotes Whether to require quotes around the parameter values (default: false).
* @param supportedQuotes Set of accepted quotes (default: {@link QUOTE_SET}).
*
* @returns Parameter list node.
*
* @note Based on {@link https://github.com/gorhill/uBlock/blob/f9ab4b75041815e6e5690d80851189ae3dc660d0/src/js/static-filtering-parser.js#L607-L699} to provide consistency.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0, separator = constants/* .COMMA */.KE, requireQuotes = false, supportedQuotes = quotes/* .QUOTE_SET */.iO) {
// Prepare the parameter list node
const params = {
type: 'ParameterList',
children: [],
};
const { length } = raw;
if (options.isLocIncluded) {
params.start = baseOffset;
params.end = baseOffset + length;
}
let offset = 0;
// TODO: Eliminate the need for extraNull
let extraNull = false;
while (offset < length) {
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
const paramStart = offset;
let paramEnd = offset;
if (supportedQuotes.has(raw[offset])) {
// Find the closing quote
const possibleClosingQuoteIndex = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, raw[offset], offset + 1);
if (possibleClosingQuoteIndex !== -1) {
// Next non-whitespace character after the closing quote should be the separator
const nextSeparatorIndex = string/* .StringUtils.skipWS */.$x.skipWS(raw, possibleClosingQuoteIndex + 1);
if (nextSeparatorIndex === length) {
// If the separator is not found, the param end is the end of the string
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, length - 1) + 1;
offset = length;
}
else if (raw[nextSeparatorIndex] === separator) {
// If the quote is followed by a separator, we can use it as a closing quote
paramEnd = possibleClosingQuoteIndex + 1;
offset = nextSeparatorIndex + 1;
}
else {
if (requireQuotes) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Expected separator, got: '${raw[nextSeparatorIndex]}'`, baseOffset + nextSeparatorIndex, baseOffset + length);
}
/**
* At that point found `possibleClosingQuoteIndex` is wrong
* | is `offset`
* ~ is `possibleClosingQuoteIndex`
* ^ is `nextSeparatorIndex`.
*
* Example 1: "abc, ').cba='1'"
* | ~^.
* Example 2: "abc, ').cba, '1'"
* | ~^
* Example 3: "abc, ').cba='1', cba"
* | ~^.
*
* Search for separator before `possibleClosingQuoteIndex`.
*/
const separatorIndexBeforeQuote = string/* .StringUtils.findNextUnescapedCharacterBackwards */.$x.findNextUnescapedCharacterBackwards(raw, separator, possibleClosingQuoteIndex, constants/* .ESCAPE_CHARACTER */.Kx, offset + 1);
if (separatorIndexBeforeQuote !== -1) {
// Found separator before (Example 2)
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorIndexBeforeQuote - 1) + 1;
offset = separatorIndexBeforeQuote + 1;
}
else {
// Didn't found separator before, search after
const separatorIndexAfterQuote = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, separator, possibleClosingQuoteIndex);
if (separatorIndexAfterQuote !== -1) {
// We found separator after (Example 3)
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorIndexAfterQuote - 1) + 1;
offset = separatorIndexAfterQuote + 1;
}
else {
// If the separator is not found, the param end is the end of the string (Example 1)
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, length - 1) + 1;
offset = length;
}
}
}
}
else {
if (requireQuotes) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Expected closing quote, got end of string', baseOffset + offset, baseOffset + length);
}
// If the closing quote is not found, the param end is the end of the string
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, length - 1) + 1;
offset = length;
}
}
else {
if (requireQuotes) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(`Expected quote, got: '${raw[offset]}'`, baseOffset + offset, baseOffset + length);
}
const nextSeparator = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, separator, offset);
if (nextSeparator === -1) {
// If the separator is not found, the param end is the end of the string
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, length - 1) + 1;
offset = length;
}
else {
// Param end should be the last non-whitespace character before the separator
paramEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, nextSeparator - 1) + 1;
offset = nextSeparator + 1;
if (string/* .StringUtils.skipWS */.$x.skipWS(raw, length - 1) === nextSeparator) {
extraNull = true;
}
}
}
if (paramStart < paramEnd) {
params.children.push(value_parser/* .ValueParser.parse */.J.parse(raw.slice(paramStart, paramEnd), options, baseOffset + paramStart));
}
else {
params.children.push(null);
}
}
if (extraNull) {
params.children.push(null);
}
return params;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/scriptlet-body/ubo-scriptlet-injection-body-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file UBlock scriptlet injection body parser.
*/
/**
* `UboScriptletInjectionBodyParser` is responsible for parsing the body of a uBlock-style scriptlet rule.
*
* Please note that the parser will parse any scriptlet rule if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* example.com##+js(scriptlet0, arg0)
* ```
*
* But it didn't check if the scriptlet `scriptlet0` actually supported by any adblocker..
*
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#scriptlet-injection}
*/
class UboScriptletInjectionBodyParser extends base_parser/* .BaseParser */.V {
/**
* Error messages used by the parser.
*/
static ERROR_MESSAGES = {
NO_SCRIPTLET_MASK: `Invalid uBO scriptlet call, no scriptlet call mask '${constants/* .UBO_SCRIPTLET_MASK */.Rq}' found`,
NO_OPENING_PARENTHESIS: `Invalid uBO scriptlet call, no opening parentheses '${constants/* .OPEN_PARENTHESIS */.Cx}' found`,
NO_CLOSING_PARENTHESIS: `Invalid uBO scriptlet call, no closing parentheses '${constants/* .CLOSE_PARENTHESIS */.s1}' found`,
NO_SCRIPTLET_NAME: 'Invalid uBO scriptlet call, no scriptlet name specified',
WHITESPACE_AFTER_MASK: 'Invalid uBO scriptlet call, whitespace is not allowed after the scriptlet call mask',
};
/**
* Parses the body of a uBlock-style scriptlet rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed scriptlet call body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* ##+js(scriptlet0, arg0)
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Skip leading spaces
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
let scriptletMaskLength = 0;
if (raw.startsWith(constants/* .UBO_SCRIPTLET_MASK */.Rq, offset)) {
scriptletMaskLength = constants/* .UBO_SCRIPTLET_MASK.length */.Rq.length;
}
else if (raw.startsWith(constants/* .UBO_SCRIPTLET_MASK_LEGACY */.Vs, offset)) {
scriptletMaskLength = constants/* .UBO_SCRIPTLET_MASK_LEGACY.length */.Vs.length;
}
// Scriptlet call should start with "+js"
if (!scriptletMaskLength) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_SCRIPTLET_MASK, baseOffset + offset, baseOffset + raw.length);
}
offset += scriptletMaskLength;
// Whitespace is not allowed after the mask
if (raw[offset] === constants/* .SPACE */.t6) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.WHITESPACE_AFTER_MASK, baseOffset + offset, baseOffset + raw.length);
}
// Parameter list should be wrapped in parentheses
if (raw[offset] !== constants/* .OPEN_PARENTHESIS */.Cx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_OPENING_PARENTHESIS, baseOffset + offset, baseOffset + raw.length);
}
// Save the offset of the opening parentheses
const openingParenthesesIndex = offset;
// Skip whitespace from the end
const closingParenthesesIndex = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, raw.length - 1);
// Closing parentheses should be present
if (raw[closingParenthesesIndex] !== constants/* .CLOSE_PARENTHESIS */.s1
|| raw[closingParenthesesIndex - 1] === constants/* .ESCAPE_CHARACTER */.Kx) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_CLOSING_PARENTHESIS, baseOffset + offset, baseOffset + raw.length);
}
const result = {
type: 'ScriptletInjectionRuleBody',
children: [],
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
// Special case: empty scriptlet call, like +js(), +js( ), etc.
if (string/* .StringUtils.skipWS */.$x.skipWS(raw, openingParenthesesIndex + 1) === closingParenthesesIndex) {
return result;
}
// Parse parameter list
const params = UboParameterListParser.parse(raw.slice(openingParenthesesIndex + 1, closingParenthesesIndex), options, baseOffset + openingParenthesesIndex + 1, constants/* .COMMA */.KE);
// Do not allow parameters without scriptlet: +js(, arg0, arg1)
if (params.children.length > 0 && params.children[0] === null) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(this.ERROR_MESSAGES.NO_SCRIPTLET_NAME, baseOffset + offset, baseOffset + raw.length);
}
result.children.push(params);
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/cosmetic-rule-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Possible error messages for uBO selectors. Formatted with {@link sprintf}.
*/
const cosmetic_rule_parser_ERROR_MESSAGES = {
EMPTY_RULE_BODY: 'Empty rule body',
INVALID_BODY_FOR_SEPARATOR: "Body '%s' is not valid for the '%s' cosmetic rule separator",
MISSING_ADGUARD_MODIFIER_LIST_END: "Missing '%s' at the end of the AdGuard modifier list in pattern '%s'",
MISSING_ADGUARD_MODIFIER_LIST_MARKER: "Missing '%s' at the beginning of the AdGuard modifier list in pattern '%s'",
SYNTAXES_CANNOT_BE_MIXED: "'%s' syntax cannot be mixed with '%s' syntax",
SYNTAX_DISABLED: "Parsing '%s' syntax is disabled, but the rule uses it",
};
const ADG_CSS_INJECTION_PATTERN = /^(?:.+){(?:.+)}$/;
/**
* `CosmeticRuleParser` is responsible for parsing cosmetic rules.
*
* Where possible, it automatically detects the difference between supported syntaxes:
* - AdGuard
* - uBlock Origin
* - Adblock Plus.
*
* If the syntax is common / cannot be determined, the parser gives `Common` syntax.
*
* Please note that syntactically correct rules are parsed even if they are not actually
* compatible with the given adblocker. This is a completely natural behavior, meaningful
* checking of compatibility is not done at the parser level.
*/
// TODO: Make raw body parsing optional
// TODO: Split into smaller sections
class CosmeticRuleParser extends base_parser/* .BaseParser */.V {
/**
* Determines whether a rule is a cosmetic rule. The rule is considered cosmetic if it
* contains a cosmetic rule separator.
*
* @param raw Raw rule.
*
* @returns `true` if the rule is a cosmetic rule, `false` otherwise.
*/
static isCosmeticRule(raw) {
const trimmed = raw.trim();
if (comment_parser/* .CommentParser.isCommentRule */.B.isCommentRule(trimmed)) {
return false;
}
return cosmetic_rule_separator/* .CosmeticRuleSeparatorUtils.find */.m.find(trimmed) !== null;
}
/**
* Parses a cosmetic rule. The structure of the cosmetic rules:
* - pattern (AdGuard pattern can have modifiers, other syntaxes don't)
* - separator
* - body.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns
* Parsed cosmetic rule AST or null if it failed to parse based on the known cosmetic rules.
*
* @throws If the input matches the cosmetic rule pattern but syntactically invalid.
*/
// TODO: Split to smaller functions
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Find cosmetic rule separator - each cosmetic rule must have it, otherwise it is not a cosmetic rule
const separatorResult = cosmetic_rule_separator/* .CosmeticRuleSeparatorUtils.find */.m.find(raw);
if (!separatorResult) {
return null;
}
let syntax = adblockers/* .AdblockSyntax.Common */.YG.Common;
let modifiers;
const patternStart = string/* .StringUtils.skipWS */.$x.skipWS(raw);
const patternEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorResult.start - 1) + 1;
const bodyStart = string/* .StringUtils.skipWS */.$x.skipWS(raw, separatorResult.end);
const bodyEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1;
// Note we use '<=' instead of '===' because we have bidirectional trim
if (bodyEnd <= bodyStart) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(cosmetic_rule_parser_ERROR_MESSAGES.EMPTY_RULE_BODY, baseOffset, baseOffset + raw.length);
}
// Step 1. Parse the pattern: it can be a domain list or a domain list with modifiers (AdGuard)
const rawPattern = raw.slice(patternStart, patternEnd);
let patternOffset = patternStart;
if (rawPattern[patternOffset] === constants/* .OPEN_SQUARE_BRACKET */.cU) {
// Save offset to the beginning of the modifier list for later
const modifierListStart = patternOffset;
// Consume opening square bracket
patternOffset += 1;
// Skip whitespace after opening square bracket
patternOffset = string/* .StringUtils.skipWS */.$x.skipWS(rawPattern, patternOffset);
// Open square bracket should be followed by a modifier separator: [$
if (rawPattern[patternOffset] !== constants/* .DOLLAR_SIGN */.nj) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.MISSING_ADGUARD_MODIFIER_LIST_MARKER, constants/* .DOLLAR_SIGN */.nj, rawPattern), baseOffset + patternOffset, baseOffset + rawPattern.length);
}
// Consume modifier separator
patternOffset += 1;
// Skip whitespace after modifier separator
patternOffset = string/* .StringUtils.skipWS */.$x.skipWS(rawPattern, patternOffset);
// Modifier list ends with the last unescaped square bracket
// that is not inside a regex or string
// We search for the last such square bracket,
// because some modifiers can contain square brackets,
// e.g. [$domain=/example[0-9]\.(com|org)/]##.ad
const modifierListEnd = string/* .StringUtils.findLastUnescapedNonStringNonRegexChar */.$x.findLastUnescapedNonStringNonRegexChar(rawPattern, constants/* .CLOSE_SQUARE_BRACKET */.A1);
if (modifierListEnd === -1) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.MISSING_ADGUARD_MODIFIER_LIST_END, constants/* .CLOSE_SQUARE_BRACKET */.A1, rawPattern), baseOffset + patternOffset, baseOffset + rawPattern.length);
}
// Parse modifier list
modifiers = modifier_list/* .ModifierListParser.parse */.l.parse(raw.slice(patternOffset, modifierListEnd), options, baseOffset + patternOffset);
// Expand modifier list location to include the opening and closing square brackets
if (options.isLocIncluded) {
modifiers.start = baseOffset + modifierListStart;
modifiers.end = baseOffset + modifierListEnd + 1;
}
// Consume modifier list
patternOffset = modifierListEnd + 1;
// Change the syntax to ADG
syntax = adblockers/* .AdblockSyntax.Adg */.YG.Adg;
}
// Skip whitespace after modifier list
patternOffset = string/* .StringUtils.skipWS */.$x.skipWS(rawPattern, patternOffset);
// Parse domains
const domains = domain_list_parser/* .DomainListParser.parse */.y.parse(rawPattern.slice(patternOffset), options, baseOffset + patternOffset);
// Step 2. Parse the separator
const separator = {
type: 'Value',
value: separatorResult.separator,
};
if (options.isLocIncluded) {
separator.start = baseOffset + separatorResult.start;
separator.end = baseOffset + separatorResult.end;
}
const exception = cosmetic_rule_separator/* .CosmeticRuleSeparatorUtils.isException */.m.isException(separatorResult.separator);
// Step 3. Parse the rule body
let rawBody = raw.slice(bodyStart, bodyEnd);
/**
* Ensures that the rule syntax is common or the expected one. This function is used to prevent mixing
* different syntaxes in the same rule.
*
* @param expectedSyntax Expected syntax.
*
* @throws If the rule syntax is not common or the expected one.
*
* @example
* The following rule mixes AdGuard and uBO syntaxes, because it uses AdGuard modifier list and uBO
* CSS injection:
* ```adblock
* [$path=/something]example.com##.foo:style(color: red)
* ```
* In this case, parser sets syntax to AdGuard, because it detects the AdGuard modifier list, but
* when parsing the rule body, it detects uBO CSS injection, which is not compatible with AdGuard.
*/
const expectCommonOrSpecificSyntax = (expectedSyntax) => {
if (syntax !== adblockers/* .AdblockSyntax.Common */.YG.Common && syntax !== expectedSyntax) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.SYNTAXES_CANNOT_BE_MIXED, expectedSyntax, syntax), baseOffset + patternStart, baseOffset + bodyEnd);
}
};
let uboSelector;
// Parse UBO rule modifiers
if (options.parseUboSpecificRules) {
uboSelector = UboSelectorParser.parse(rawBody, options, baseOffset + bodyStart);
rawBody = uboSelector.selector.value;
// Do not allow ADG modifiers and UBO modifiers in the same rule
if (uboSelector.modifiers && uboSelector.modifiers.children.length > 0) {
// If modifiers are present, that means that the ADG modifier list was parsed
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Ubo */.YG.Ubo);
// Change the syntax to uBO
syntax = adblockers/* .AdblockSyntax.Ubo */.YG.Ubo;
// Store the rule modifiers
// Please note that not each special uBO modifier is a rule modifier, some of them are
// used for CSS injection, for example `:style()` and `:remove()`
for (const modifier of uboSelector.modifiers.children) {
// TODO: Add support for matches-media and element hiding rules
// TODO: Improve this condition if new uBO modifiers are added
if (modifier.name.value === ubo_selector_common/* .UboPseudoName.MatchesPath */.S.MatchesPath) {
// Prepare the modifier list if it does not exist yet
if (!modifiers) {
modifiers = {
type: 'ModifierList',
children: [],
};
if (options.isLocIncluded) {
modifiers.start = baseOffset + bodyStart;
modifiers.end = baseOffset + bodyEnd;
}
}
modifiers.children.push(modifier);
}
}
}
}
const raws = {
text: raw,
};
const baseRule = {
category: nodes/* .RuleCategory.Cosmetic */.$O.Cosmetic,
exception,
modifiers,
domains,
separator,
};
if (options.includeRaws) {
baseRule.raws = raws;
}
if (options.isLocIncluded) {
baseRule.start = baseOffset;
baseRule.end = baseOffset + raw.length;
}
const parseUboCssInjection = () => {
if (!uboSelector || !uboSelector.modifiers || uboSelector.modifiers.children?.length < 1) {
return null;
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Ubo */.YG.Ubo);
const selectorList = uboSelector.selector;
let declarationList;
let mediaQueryList;
let remove = false;
for (const modifier of uboSelector.modifiers.children) {
switch (modifier.name.value) {
case ubo_selector_common/* .UboPseudoName.Style */.S.Style:
declarationList = modifier.value;
break;
case ubo_selector_common/* .UboPseudoName.Remove */.S.Remove:
declarationList = {
type: 'Value',
value: '',
};
remove = true;
break;
case ubo_selector_common/* .UboPseudoName.MatchesMedia */.S.MatchesMedia:
mediaQueryList = modifier.value;
break;
}
}
// If neither `:style()` nor `:remove()` is present
if (!declarationList) {
return null;
}
const body = {
type: 'CssInjectionRuleBody',
selectorList,
declarationList,
mediaQueryList,
remove,
};
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
type: nodes/* .CosmeticRuleType.CssInjectionRule */.k9.CssInjectionRule,
body,
};
};
const parseElementHiding = () => {
const selectorList = {
type: 'Value',
value: rawBody,
};
if (options.isLocIncluded) {
selectorList.start = baseOffset + bodyStart;
selectorList.end = baseOffset + bodyEnd;
}
const body = {
type: 'ElementHidingRuleBody',
selectorList,
};
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax,
type: nodes/* .CosmeticRuleType.ElementHidingRule */.k9.ElementHidingRule,
body,
};
};
const parseAdgCssInjection = () => {
// TODO: Improve this detection. Need to cover the following cases:
// #$#body { color: red;
// #$#@media (min-width: 100px) { body { color: red; }
// ADG CSS injection
if (!ADG_CSS_INJECTION_PATTERN.test(rawBody)) {
return null;
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Adg */.YG.Adg);
return {
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
type: nodes/* .CosmeticRuleType.CssInjectionRule */.k9.CssInjectionRule,
body: AdgCssInjectionParser.parse(rawBody, options, baseOffset + bodyStart),
};
};
/**
* Parses Adb CSS injection rules
* eg: example.com##.foo { display: none; }.
*
* @returns Parsed rule.
*/
const parseAbpCssInjection = () => {
if (!options.parseAbpSpecificRules) {
return null;
}
// check if the rule contains both CSS block open and close characters
// if none of them is present we can stop parsing
if (rawBody.indexOf(constants/* .CSS_BLOCK_OPEN */.zW) === -1 && rawBody.indexOf(constants/* .CSS_BLOCK_CLOSE */.pi) === -1) {
return null;
}
if (!(0,csstokenizer/* .hasToken */.y0)(rawBody, new Set([csstokenizer/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket, csstokenizer/* .TokenType.CloseCurlyBracket */.ks.CloseCurlyBracket]))) {
return null;
}
// try to parse the raw body as an AdGuard CSS injection rule
const body = AdgCssInjectionParser.parse(rawBody, options, baseOffset + bodyStart);
// if the parsed rule type is a 'CssInjectionRuleBody', return the parsed rule
return {
syntax: adblockers/* .AdblockSyntax.Abp */.YG.Abp,
type: nodes/* .CosmeticRuleType.CssInjectionRule */.k9.CssInjectionRule,
body,
};
};
const parseAbpSnippetInjection = () => {
if (!options.parseAbpSpecificRules) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.SYNTAX_DISABLED, adblockers/* .AdblockSyntax.Abp */.YG.Abp), baseOffset + bodyStart, baseOffset + bodyEnd);
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Abp */.YG.Abp);
const body = AbpSnippetInjectionBodyParser.parse(rawBody, options, baseOffset + bodyStart);
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax: adblockers/* .AdblockSyntax.Abp */.YG.Abp,
type: nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule,
body,
};
};
const parseUboScriptletInjection = () => {
if (!rawBody.startsWith(constants/* .UBO_SCRIPTLET_MASK */.Rq) && !rawBody.startsWith(constants/* .UBO_SCRIPTLET_MASK_LEGACY */.Vs)) {
return null;
}
if (!options.parseUboSpecificRules) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.SYNTAX_DISABLED, adblockers/* .AdblockSyntax.Ubo */.YG.Ubo), baseOffset + bodyStart, baseOffset + bodyEnd);
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Ubo */.YG.Ubo);
const body = UboScriptletInjectionBodyParser.parse(rawBody, options, baseOffset + bodyStart);
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
type: nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule,
body,
};
};
const parseAdgScriptletInjection = () => {
// ADG scriptlet injection
if (!rawBody.startsWith(constants/* .ADG_SCRIPTLET_MASK */.x$)) {
return null;
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Adg */.YG.Adg);
const body = AdgScriptletInjectionBodyParser.parse(rawBody, options, baseOffset + bodyStart);
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
type: nodes/* .CosmeticRuleType.ScriptletInjectionRule */.k9.ScriptletInjectionRule,
body,
};
};
const parseAdgJsInjection = () => {
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Adg */.YG.Adg);
const body = {
type: 'Value',
value: rawBody,
};
if (options.isLocIncluded) {
body.start = baseOffset + bodyStart;
body.end = baseOffset + bodyEnd;
}
return {
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
type: nodes/* .CosmeticRuleType.JsInjectionRule */.k9.JsInjectionRule,
body,
};
};
const parseUboHtmlFiltering = () => {
if (!rawBody.startsWith(constants/* .UBO_HTML_MASK */._h)) {
return null;
}
if (!options.parseUboSpecificRules) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.SYNTAX_DISABLED, adblockers/* .AdblockSyntax.Ubo */.YG.Ubo), baseOffset + bodyStart, baseOffset + bodyEnd);
}
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Ubo */.YG.Ubo);
const rawBodyWithoutMask = rawBody.slice(constants/* .UBO_HTML_MASK.length */._h.length);
const body = ubo_html_filtering_body_parser/* .UboHtmlFilteringBodyParser.parse */.V.parse(rawBodyWithoutMask, options, baseOffset + bodyStart + constants/* .UBO_HTML_MASK.length */._h.length);
return {
syntax: adblockers/* .AdblockSyntax.Ubo */.YG.Ubo,
type: nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule,
body,
};
};
const parseAdgHtmlFiltering = () => {
expectCommonOrSpecificSyntax(adblockers/* .AdblockSyntax.Adg */.YG.Adg);
const body = adg_html_filtering_body_parser/* .AdgHtmlFilteringBodyParser.parse */.h.parse(rawBody, options, baseOffset + bodyStart);
return {
syntax: adblockers/* .AdblockSyntax.Adg */.YG.Adg,
type: nodes/* .CosmeticRuleType.HtmlFilteringRule */.k9.HtmlFilteringRule,
body,
};
};
// Create a fast lookup table for cosmetic rule separators and their parsing functions.
// One separator can have multiple parsing functions. If the first function returns null,
// the next function is called, and so on.
// If all functions return null, an error should be thrown.
const separatorMap = {
'##': [
parseUboHtmlFiltering,
parseUboScriptletInjection,
parseUboCssInjection,
parseAbpCssInjection,
parseElementHiding,
],
'#@#': [
parseUboHtmlFiltering,
parseUboScriptletInjection,
parseUboCssInjection,
parseAbpCssInjection,
parseElementHiding,
],
'#?#': [parseUboCssInjection, parseAbpCssInjection, parseElementHiding],
'#@?#': [parseUboCssInjection, parseAbpCssInjection, parseElementHiding],
'#$#': [parseAdgCssInjection, parseAbpSnippetInjection],
'#@$#': [parseAdgCssInjection, parseAbpSnippetInjection],
'#$?#': [parseAdgCssInjection],
'#@$?#': [parseAdgCssInjection],
'#%#': [parseAdgScriptletInjection, parseAdgJsInjection],
'#@%#': [parseAdgScriptletInjection, parseAdgJsInjection],
$$: [parseAdgHtmlFiltering],
'$@$': [parseAdgHtmlFiltering],
};
const parseFunctions = separatorMap[separatorResult.separator];
let restProps;
for (const parseFunction of parseFunctions) {
restProps = parseFunction();
if (restProps) {
break;
}
}
// If none of the parsing functions returned a result, it means that the rule is unknown / invalid.
if (!restProps) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(cosmetic_rule_parser_ERROR_MESSAGES.INVALID_BODY_FOR_SEPARATOR, rawBody, separatorResult.separator), baseOffset + bodyStart, baseOffset + bodyEnd);
}
// Combine the base rule with the rest of the properties.
return {
...baseRule,
...restProps,
};
}
}
},
55576(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
h: () => (AdgHtmlFilteringBodyParser)
});
/* import */ var _utils_quotes_js__rspack_import_2 = __webpack_require__(68999);
/* import */ var _base_parser_js__rspack_import_0 = __webpack_require__(79963);
/* import */ var _options_js__rspack_import_1 = __webpack_require__(64626);
/* import */ var _html_filtering_body_parser_js__rspack_import_3 = __webpack_require__(15683);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `AdgHtmlFilteringBodyParser` is responsible for parsing the body of an AdGuard-style HTML filtering rule.
*
* Please note that the parser will parse any HTML filtering rule if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* example.com$$div[special-attr="value"]
* ```
*
* But it didn't check if the attribute `special-attr` actually supported by any adblocker..
*
* @see {@link https://www.w3.org/TR/selectors-4}
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#html-filtering-rules}
*/
class AdgHtmlFilteringBodyParser extends _base_parser_js__rspack_import_0/* .BaseParser */.V {
/**
* Parses the body of an AdGuard-style HTML filtering rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed HTML filtering rule body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* div[some_attribute="some_value"]
* ```
*/
static parse(raw, options = _options_js__rspack_import_1/* .defaultParserOptions */.n, baseOffset = 0) {
// Only escape AdGuard's `""` → `\"` when the body will actually be
// CSS-parsed. When `parseHtmlFilteringRuleBodies` is false the raw
// string is stored as-is in a Value node; escaping here would cause
// double-escaping when the converter later re-parses it.
//
// Needed for proper `[tag-content]` conversion (to `:contains()`)
// where `""` must be used to escape `"`:
// https://adguard.com/kb/general/ad-filtering/create-own-filters/#tag-content
const input = options.parseHtmlFilteringRuleBodies
? _utils_quotes_js__rspack_import_2/* .QuoteUtils.escapeAttributeDoubleQuotes */.Qj.escapeAttributeDoubleQuotes(raw)
: raw;
return _html_filtering_body_parser_js__rspack_import_3/* .HtmlFilteringBodyParser.parse */.F.parse(input, options, baseOffset);
}
}
},
15683(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
F: () => (/* binding */ HtmlFilteringBodyParser)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
// EXTERNAL MODULE: ./node_modules/.pnpm/sprintf-js@1.1.3/node_modules/sprintf-js/src/sprintf.js
var sprintf = __webpack_require__(37155);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+css-tokenizer@1.2.0/node_modules/@adguard/css-tokenizer/dist/csstokenizer.mjs
var csstokenizer = __webpack_require__(83747);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/css/css-token-stream.js
var css_token_stream = __webpack_require__(44148);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/quotes.js
var quotes = __webpack_require__(68999);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/value-parser.js
var value_parser = __webpack_require__(29090);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/attribute-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles attribute selector parsing in selector list.
*/
class AttributeSelectorHandler {
/**
* Set of attribute equality prefixes.
*
* @see {@link AttributeSelectorOperatorValue}
*/
static ATTR_EQUALITY_PREFIXES = new Set([
// [attr~="value"]
constants/* .TILDE */.wR,
// [attr^="value"]
constants/* .CARET */.cP,
// [attr$="value"]
constants/* .DOLLAR_SIGN */.nj,
// [attr*="value"]
constants/* .ASTERISK */.Ln,
// [attr|="value"]
constants/* .PIPE */.L5,
]);
/**
* Set of valid flags for attribute selector values.
*
* @see {@link AttributeSelectorFlagValue}
*/
static ALLOWED_ATTRIBUTE_FLAGS = new Set([
'i',
's',
]);
/**
* Handles attribute selector parsing by creating an attribute selector node
* and appending it to the current complex selector node.
*
* @param context Selector list parser context.
*
* @throws If the attribute selector is syntactically incorrect.
*/
static handle(context) {
const { options, baseOffset, stream, complexSelector, } = context;
// Get open square bracket token
let token = stream.getOrFail();
// Save attribute selector node start position
const { start } = token;
// Advance open square bracket token
stream.advance();
// Skip whitespaces after open square bracket
stream.skipWhitespace();
// Expect next token to be an identifier (attribute selector name)
stream.expect(csstokenizer/* .TokenType.Ident */.ks.Ident);
// Get attribute selector name token
token = stream.getOrFail();
// Extract attribute selector name raw value
const nameRaw = stream.fragment();
// Construct attribute selector node and attribute selector name node
const result = {
type: 'AttributeSelector',
name: value_parser/* .ValueParser.parse */.J.parse(nameRaw, options, baseOffset + token.start),
};
// Include attribute selector node start location if needed
if (options.isLocIncluded) {
result.start = baseOffset + start;
}
// Advance attribute selector name token
stream.advance();
// Skip whitespaces after attribute selector name
stream.skipWhitespace();
// Get closing square bracket or equality sign/prefix token
token = stream.getOrFail();
// Check if there is an any value
if (token.type !== csstokenizer/* .TokenType.CloseSquareBracket */.ks.CloseSquareBracket) {
// Expect next token to be a delimiter (equality sign/prefix)
stream.expect(csstokenizer/* .TokenType.Delim */.ks.Delim);
// Extract operator raw value
let operatorRaw = stream.fragment();
// Check if it's prefix operator
if (AttributeSelectorHandler.ATTR_EQUALITY_PREFIXES.has(operatorRaw)) {
// Advance prefix operator token
stream.advance();
// Expect equal sign token
stream.expect(csstokenizer/* .TokenType.Delim */.ks.Delim, { value: constants/* .EQUALS */.UT });
// Append equal sign to prefix value
operatorRaw += constants/* .EQUALS */.UT;
}
else if (operatorRaw !== constants/* .EQUALS */.UT) {
// Throw error if it's not equal sign either
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)("Invalid attribute selector operator '%s'", operatorRaw), baseOffset + token.start, baseOffset + token.end);
}
// Save operator node start position
const operatorStart = token.start;
// Advance equal sign token
stream.advance();
// Skip whitespaces after equal sign
stream.skipWhitespace();
// Get attribute selector value token
token = stream.getOrFail();
// It should be a string or identifier
const isValueString = token.type === csstokenizer/* .TokenType.String */.ks.String;
if (!isValueString && token.type !== csstokenizer/* .TokenType.Ident */.ks.Ident) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(
// eslint-disable-next-line max-len
`Expected '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.Ident */.ks.Ident)}' or '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.String */.ks.String)}' as attribute selector value, but got '%s' with value '%s'`, (0,csstokenizer/* .getFormattedTokenName */.bZ)(token.type), stream.fragment()), baseOffset + token.start, baseOffset + token.end);
}
// Save attribute selector value node start position
const valueStart = token.start + (isValueString ? 1 : 0);
// Save attribute selector value node end position
const valueEnd = token.end - (isValueString ? 1 : 0);
// Extract attribute selector value raw value
const valueRaw = stream.fragment();
// We should unescape respective quotes inside of the string value
const valueUnquotedAndUnescaped = quotes/* .QuoteUtils.removeQuotesAndUnescape */.Qj.removeQuotesAndUnescape(valueRaw);
// Construct attribute selector operator node
const operatorNode = {
type: 'Value',
value: operatorRaw,
};
// Construct attribute selector value node
const valueNode = {
type: 'Value',
value: valueUnquotedAndUnescaped,
};
// Set attribute selector operator and value nodes to result node
result.operator = operatorNode;
result.value = valueNode;
// Include attribute selector operator and value nodes locations if needed
if (options.isLocIncluded) {
operatorNode.start = baseOffset + operatorStart;
operatorNode.end = baseOffset + operatorStart + operatorRaw.length;
valueNode.start = baseOffset + valueStart;
valueNode.end = baseOffset + valueEnd;
}
// Advance attribute selector value token
stream.advance();
// Skip whitespaces after attribute selector value
stream.skipWhitespace();
// Get close square bracket or attribute selector value flag token
token = stream.getOrFail();
// Check if there is an any flag part
if (token.type !== csstokenizer/* .TokenType.CloseSquareBracket */.ks.CloseSquareBracket) {
// Expect a identifier (attribute selector value flag)
stream.expect(csstokenizer/* .TokenType.Ident */.ks.Ident);
// Extract attribute selector value flag raw value
const flagRaw = stream.fragment();
// Validate attribute selector value flag
if (!AttributeSelectorHandler.isValidFlag(flagRaw)) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)("Unexpected token '%s' with value '%s'", (0,csstokenizer/* .getFormattedTokenName */.bZ)(token.type), flagRaw), baseOffset + token.start, baseOffset + token.end);
}
// Save flag node start position
const flagStart = token.start;
// Construct attribute selector flag node
const flagNode = {
type: 'Value',
value: flagRaw,
};
// Set attribute selector flag node to result node
result.flag = flagNode;
// Include attribute selector flag node locations if needed
if (options.isLocIncluded) {
flagNode.start = baseOffset + flagStart;
flagNode.end = baseOffset + flagStart + flagRaw.length;
}
// Advance attribute selector value flag token
stream.advance();
// Skip whitespaces after attribute selector value flag
stream.skipWhitespace();
// Get close square bracket token
token = stream.getOrFail();
}
}
// Expect close square bracket token
stream.expect(csstokenizer/* .TokenType.CloseSquareBracket */.ks.CloseSquareBracket);
// Include attribute selector node end location if needed
if (options.isLocIncluded) {
result.end = baseOffset + token.end;
}
// Append attribute selector node to the current complex selector node
complexSelector.children.push(result);
// Advance close square bracket token
stream.advance();
}
/**
* Validates attribute selector flag.
*
* @param flag Attribute selector flag.
*
* @returns `true` if the flag is valid, otherwise `false`.
*/
static isValidFlag(flag) {
return AttributeSelectorHandler.ALLOWED_ATTRIBUTE_FLAGS.has(flag);
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/class-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles class selector parsing in selector list.
*/
class ClassSelectorHandler {
/**
* Handles class selector parsing by creating a class selector node
* and appending it to the current complex selector node.
*
* @param context Selector list parser context.
*
* @throws If the class selector is syntactically incorrect.
*/
static handle(context) {
const { options, baseOffset, stream, complexSelector, } = context;
// Get class selector dot token
const token = stream.getOrFail();
// Advance class selector dot token
stream.advance();
// Expect next token to be an identifier (class selector value)
stream.expect(csstokenizer/* .TokenType.Ident */.ks.Ident);
// Extract class selector value (without dot)
const value = stream.fragment();
// Construct class selector node
const result = {
type: 'ClassSelector',
value,
};
// Include class selector node locations if needed
if (options.isLocIncluded) {
result.start = baseOffset + token.start;
result.end = baseOffset + token.end + value.length;
}
// Append class selector node to the current complex selector node
complexSelector.children.push(result);
// Advance class selector value token
stream.advance();
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/compound-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles compound selector parsing in selector list.
*/
class CompoundSelectorHandler {
/**
* Set of allowed symbols between selectors (combinators + comma, except <space> combinator).
*
* @see {@link SelectorCombinatorValue}
*/
static ALLOWED_SYMBOLS_BETWEEN_SELECTORS = new Set([
// div > span
constants/* .GREATER_THAN */.vz,
// div + div
constants/* .PLUS */.uu,
// div ~ div
constants/* .TILDE */.wR,
// div, span
constants/* .COMMA */.KE,
]);
/**
* Finishes the current compound selector by:
* 1. Validating current compound selector node,
* 2. Constructing selector combinator node (if provided),
* 3. Appending selector combinator node to the complex selector (if provided).
*
* @param context Selector list parser context.
* @param combinator Optional combinator string.
*
* @throws If the current compound selector has no simple selectors.
*/
static handle(context, combinator) {
const { raw, options, baseOffset, stream, token, complexSelector, } = context;
// Get current compound selector end token
const currentEndToken = stream.lookbehindForNonWs();
// Throw error if current compound selector has no simple selectors (empty)
if (
// Combinator shouldn't be the first token in the complex selector
!currentEndToken
|| complexSelector.children.length === 0
// And the last token in the complex selector shouldn't be a combinator
|| complexSelector.children[complexSelector.children.length - 1].type === 'SelectorCombinator') {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)("Unexpected token '%s' with value '%s'", (0,csstokenizer/* .getFormattedTokenName */.bZ)(token.type), raw.slice(token.start, token.end)), baseOffset + token.start, baseOffset + token.end);
}
// Handle edge case for descendant combinator
if (combinator === constants/* .SPACE */.t6) {
// Skip whitespaces before checking next token
stream.skipWhitespace();
// EOF - just skip, we shouldn't consider it as descendant combinator
if (!stream.get()) {
return;
}
// Combinator or Comma - just skip, we shouldn't consider it as descendant combinator
if (CompoundSelectorHandler.ALLOWED_SYMBOLS_BETWEEN_SELECTORS.has(stream.fragment())) {
return;
}
}
else {
// Advance selector combinator token
stream.advance();
// Skip whitespaces after selector combinator token
stream.skipWhitespace();
}
// If no combinator is provided, just return, as we don't need to create and append selector combinator node
if (!combinator) {
return;
}
// Next compound selector token should be defined
stream.getOrFail();
// Construct selector combinator node
const result = {
type: 'SelectorCombinator',
value: combinator,
};
// Include selector combinator node locations if needed
if (options.isLocIncluded) {
result.start = baseOffset + token.start;
result.end = baseOffset + token.start + combinator.length;
}
// Append selector combinator node to the current complex selector node
complexSelector.children.push(result);
// Reset type selector set tracker for next compound selector
context.isTypeSelectorSet = false;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/complex-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles complex selector parsing in selector list.
*/
class ComplexSelectorHandler {
/**
* Finishes the current complex selector by:
* 1. Finishing current compound selector node via {@link CompoundSelectorHandler},
* 2. Validating current complex selector node,
* 3. Appending current complex selector node to the selector list node,
* If `isEof` is `false`:
* 4. Constructing next complex selector node.
*
* @param context Selector list parser context.
* @param isEof Indicates whether the end of the file has been reached.
*
* @throws If the current compound / complex selector has no simple selectors / compound selectors.
*/
static handle(context, isEof = true) {
const { raw, options, baseOffset, stream, token, result, complexSelector, } = context;
// Get current complex selector end token
const currentEndToken = stream.lookbehindForNonWs();
// Finish current compound selector node
CompoundSelectorHandler.handle(context);
// Throw error if current complex selector node has no compound selector nodes (empty)
if (!currentEndToken || complexSelector.children.length === 0) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)("Unexpected token '%s' with value '%s'", (0,csstokenizer/* .getFormattedTokenName */.bZ)(token.type), raw.slice(token.start, token.end)), baseOffset + token.start, baseOffset + token.end);
}
// Include current complex selector node end location if needed
if (options.isLocIncluded) {
complexSelector.end = baseOffset + currentEndToken.end;
}
// Append current complex selector node to selector list node
result.children.push(complexSelector);
// If EOF is reached, just return, as we don't need to construct a next complex selector node
if (isEof) {
return;
}
// Get next complex selector node start token
const nextStartToken = stream.getOrFail();
// Construct next complex selector node
const nextComplexSelector = {
type: 'ComplexSelector',
children: [],
};
// Include next complex selector node start location if needed
if (options.isLocIncluded) {
nextComplexSelector.start = baseOffset + nextStartToken.start;
}
// Update context with new complex selector
context.complexSelector = nextComplexSelector;
// Reset type selector set tracker for new selector
context.isTypeSelectorSet = false;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/id-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles ID selector parsing in selector list.
*/
class IdSelectorHandler {
/**
* Handles ID selector parsing by creating an ID selector node
* and appending it to the current complex selector node.
*
* @param context Selector list parser context.
*
* @throws If the ID selector is syntactically incorrect.
*/
static handle(context) {
const { raw, options, baseOffset, stream, complexSelector, } = context;
// Get ID selector token
const token = stream.getOrFail();
// Extract ID selector value (`start + 1` - without hashmark)
const value = raw.slice(token.start + 1, token.end);
// Construct ID selector node
const result = {
type: 'IdSelector',
value,
};
// Include ID selector node locations if needed
if (options.isLocIncluded) {
result.start = baseOffset + token.start;
result.end = baseOffset + token.end;
}
// Append ID selector node to the current complex selector node
complexSelector.children.push(result);
// Advance ID selector token
stream.advance();
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/pseudo-class-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles pseudo-class selector parsing in selector list.
*/
class PseudoClassSelectorHandler {
/**
* Handles pseudo-class selector parsing by creating a pseudo-class selector node
* and appending it to the current complex selector node.
*
* @param context Selector list parser context.
*
* @throws If the pseudo-class selector is syntactically incorrect.
*/
static handle(context) {
const { raw, options, baseOffset, stream, complexSelector, } = context;
// Get colon token
let token = stream.getOrFail();
// Save pseudo-class selector node start position
const { start } = token;
// Advance colon token
stream.advance();
// Get pseudo-class selector name token
token = stream.getOrFail();
// It should be a function or identifier
const isFunction = token.type === csstokenizer/* .TokenType.Function */.ks.Function;
if (!isFunction && token.type !== csstokenizer/* .TokenType.Ident */.ks.Ident) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(
// eslint-disable-next-line max-len
`Expected '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.Ident */.ks.Ident)}' or '${(0,csstokenizer/* .getFormattedTokenName */.bZ)(csstokenizer/* .TokenType.Function */.ks.Function)}' as pseudo-class selector name, but got '%s' with value '%s'`, (0,csstokenizer/* .getFormattedTokenName */.bZ)(token.type), stream.fragment()), baseOffset + token.start, baseOffset + token.end);
}
// Extract pseudo-class selector name raw value
let nameRaw;
if (!isFunction) {
nameRaw = raw.slice(token.start, token.end);
}
else {
nameRaw = raw.slice(token.start, token.end - 1); // Exclude '('
}
// Construct pseudo-class selector node
const result = {
type: 'PseudoClassSelector',
name: value_parser/* .ValueParser.parse */.J.parse(nameRaw, options, baseOffset + token.start),
};
// Include pseudo-class selector node start location if needed
if (options.isLocIncluded) {
result.start = baseOffset + start;
}
// If it's a function, parse its argument
if (isFunction) {
// Save the function token's balance level for finding the matching close parenthesis
const functionBalance = stream.getBalance();
// Advance pseudo-class selector name token
stream.advance();
// Get pseudo-class selector argument token
token = stream.getOrFail();
// Construct empty pseudo-class selector argument node by default
result.argument = {
type: 'Value',
value: constants/* .EMPTY */.wg,
};
// Include pseudo-class selector argument node location if needed
if (options.isLocIncluded) {
result.argument.start = baseOffset + token.start;
result.argument.end = baseOffset + token.start;
}
// Skip whitespaces after opening parenthesis
stream.skipWhitespace();
// Get pseudo-class selector argument or closing parenthesis token
token = stream.getOrFail();
// Check if there is any argument part
if (token.type !== csstokenizer/* .TokenType.CloseParenthesis */.ks.CloseParenthesis) {
// Use the function token's balance level to find the matching closing parenthesis
const balance = functionBalance;
// Skip leading whitespace
stream.skipWhitespace();
// Get argument token
token = stream.getOrFail();
// Save pseudo-class selector argument start position
const argumentStart = token.start;
// Track last non-whitespace token to handle trailing whitespace
let lastNonWsToken;
// Skip to the closing parenthesis at the matching balance level
while (stream.get()?.balance !== balance - 1) {
const currentToken = stream.get();
if (currentToken && currentToken.type !== csstokenizer/* .TokenType.Whitespace */.ks.Whitespace) {
lastNonWsToken = currentToken;
}
stream.advance();
}
// Get closing parenthesis token
token = stream.getOrFail();
// Save pseudo-class selector argument end position (after last non-whitespace token)
const argumentEnd = lastNonWsToken ? lastNonWsToken.end : token.start;
// Extract pseudo-class selector argument raw value (trimmed)
// TODO: Consider parsing inner selectors (like :not(.class))
const argumentRaw = raw.slice(argumentStart, argumentEnd);
// Specify pseudo-class selector argument node value
result.argument.value = argumentRaw;
// Include pseudo-class selector argument node location if needed
if (options.isLocIncluded) {
result.argument.start = baseOffset + argumentStart;
result.argument.end = baseOffset + argumentStart + argumentRaw.length;
}
}
// Expect close parenthesis token
stream.expect(csstokenizer/* .TokenType.CloseParenthesis */.ks.CloseParenthesis);
}
// Include pseudo-class selector end location if needed
if (options.isLocIncluded) {
result.end = baseOffset + token.end;
}
// Append pseudo-class selector node to the current complex selector node
complexSelector.children.push(result);
// Advance pseudo-class selector name token (if ident) or closing parenthesis token (if function)
stream.advance();
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/handlers/type-selector-handler.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Handles type selector parsing in selector list.
*/
class TypeSelectorHandler {
/**
* Handles type selector parsing by creating a type selector node
* and appending it to the current complex selector node.
*
* @param context Selector list parser context.
*
* @throws If the type selector is syntactically incorrect.
*/
static handle(context) {
const { options, baseOffset, stream, complexSelector, isTypeSelectorSet, } = context;
// Get type selector token
const token = stream.getOrFail();
// Throw error if type selector is already set
if (isTypeSelectorSet) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Type selector is already set for the compound selector', baseOffset + token.start, baseOffset + token.end);
}
// Throw error if type selector isn't first in the given compound selector
if (
// It should be first on current complex selector
complexSelector.children.length !== 0
// Or should be first on current compound selector (after combinator)
&& complexSelector.children[complexSelector.children.length - 1].type !== 'SelectorCombinator') {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Type selector must be first in the compound selector', baseOffset + token.start, baseOffset + token.end);
}
// Extract type selector value
const value = stream.fragment();
// Construct type selector node
const result = {
type: 'TypeSelector',
value,
};
// Include type selector node locations if needed
if (options.isLocIncluded) {
result.start = baseOffset + token.start;
result.end = baseOffset + token.start + value.length;
}
// Append type selector node to the current complex selector node
complexSelector.children.push(result);
// Advance type selector token
stream.advance();
// Mark that type name is set
context.isTypeSelectorSet = true;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/selector/selector-list-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Class responsible for parsing selector lists.
*
* Please note that the parser will parse any selector list if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* div[attr1="value1"] > h1[attr2="value2"], span[attr3="value3"]
* ```
*
* But it didn't check if the given attribute or pseudo-class is valid or not..
*
* @see {@link https://www.w3.org/TR/selectors-4/#selector-list}'
*/
class SelectorListParser extends base_parser/* .BaseParser */.V {
/**
* Common error messages used in the parser for unexpected tokens.
*/
static UNEXPECTED_TOKEN_WITH_VALUE_ERROR = "Unexpected token '%s' with value '%s'";
/**
* Parses a selector list.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed selector list.
*
* @throws If the selector list is syntactically incorrect.
*
* @example
* ```
* div[attr1="value1"] > h1[attr2="value2"], span[attr3="value3"]
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// Construct the stream
const stream = new css_token_stream/* .CssTokenStream */.d(raw, baseOffset);
// Skip whitespaces before first token
stream.skipWhitespace();
// Construct selector list parser context
const context = {
raw,
options,
baseOffset,
stream,
// Get first token
token: stream.getOrFail(),
// Construct selector list node
result: {
type: 'SelectorList',
children: [],
},
// Construct first complex selector node
complexSelector: {
type: 'ComplexSelector',
children: [],
},
// Track if type selector set in the current compound selector
isTypeSelectorSet: false,
};
// Include locations for (if needed):
// - start and end for the selector list node
// - start for the first complex selector node
if (options.isLocIncluded) {
context.result.start = baseOffset;
context.result.end = baseOffset + raw.length;
context.complexSelector.start = baseOffset + context.token.start;
}
// Traverse the stream
while (!stream.isEof()) {
// Get next token
context.token = stream.getOrFail();
switch (context.token.type) {
// Tag selector
case csstokenizer/* .TokenType.Ident */.ks.Ident: {
TypeSelectorHandler.handle(context);
break;
}
// ID selector
case csstokenizer/* .TokenType.Hash */.ks.Hash: {
IdSelectorHandler.handle(context);
break;
}
// Attribute selector
case csstokenizer/* .TokenType.OpenSquareBracket */.ks.OpenSquareBracket: {
AttributeSelectorHandler.handle(context);
break;
}
// Pseudo-class selector
case csstokenizer/* .TokenType.Colon */.ks.Colon: {
PseudoClassSelectorHandler.handle(context);
break;
}
// Universal type selector ('*'), Class selector ('.'), Combinators ('>', '+', '~')
case csstokenizer/* .TokenType.Delim */.ks.Delim: {
// Get delimiter value
const delimiter = stream.fragment();
switch (delimiter) {
// Universal type selector ('*')
case constants/* .ASTERISK */.Ln: {
TypeSelectorHandler.handle(context);
break;
}
// Class selector ('.)
case constants/* .DOT */.y0: {
ClassSelectorHandler.handle(context);
break;
}
// Combinators ('>', '+', '~')
case constants/* .GREATER_THAN */.vz:
case constants/* .PLUS */.uu:
case constants/* .TILDE */.wR: {
CompoundSelectorHandler.handle(context, delimiter);
break;
}
default: {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(SelectorListParser.UNEXPECTED_TOKEN_WITH_VALUE_ERROR, (0,csstokenizer/* .getFormattedTokenName */.bZ)(context.token.type), delimiter), baseOffset + context.token.start, baseOffset + context.token.end);
}
}
break;
}
// End of current compound selector (whitespace combinator - descendant)
case csstokenizer/* .TokenType.Whitespace */.ks.Whitespace: {
CompoundSelectorHandler.handle(context, constants/* .SPACE */.t6);
break;
}
// End of current complex selector
case csstokenizer/* .TokenType.Comma */.ks.Comma: {
ComplexSelectorHandler.handle(context, false);
break;
}
default: {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q((0,sprintf.sprintf)(SelectorListParser.UNEXPECTED_TOKEN_WITH_VALUE_ERROR, (0,csstokenizer/* .getFormattedTokenName */.bZ)(context.token.type), stream.fragment()), baseOffset + context.token.start, baseOffset + context.token.end);
}
}
}
// Finish last complex selector
ComplexSelectorHandler.handle(context);
return context.result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/html-filtering-body/html-filtering-body-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Class responsible for parsing HTML filtering rule body.
*
* Please note that the parser will parse any HTML filtering rule body if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* span[special-attr="Example"]
* div:special-pseudo(Example)
* ```
*
* But it didn't check if the pseudo selector `special-pseudo` or if
* the attribute selector `special-attr` actually supported by any adblocker..
*
* @see {@link https://www.w3.org/TR/selectors-4}
* @see {@link https://adguard.com/kb/general/ad-filtering/create-own-filters/#html-filtering-rules}
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#html-filters}
*/
class HtmlFilteringBodyParser extends base_parser/* .BaseParser */.V {
/**
* Parses a HTML filtering rule body.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed HTML filtering rule body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* span[tag-content="Example"]
* div:has-text(Example)
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
// If HTML filtering rules parsing is disabled, return raw value node
let result;
if (options.parseHtmlFilteringRuleBodies) {
result = {
type: 'HtmlFilteringRuleBody',
selectorList: SelectorListParser.parse(raw, options, baseOffset),
};
}
else {
result = {
type: 'Value',
value: raw,
};
}
// Include body locations if needed
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
},
91090(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
V: () => (UboHtmlFilteringBodyParser)
});
/* import */ var sprintf_js__rspack_import_0 = __webpack_require__(37155);
/* import */ var _adguard_css_tokenizer__rspack_import_1 = __webpack_require__(83747);
/* import */ var _errors_adblock_syntax_error_js__rspack_import_7 = __webpack_require__(10631);
/* import */ var _utils_constants_js__rspack_import_6 = __webpack_require__(53097);
/* import */ var _base_parser_js__rspack_import_2 = __webpack_require__(79963);
/* import */ var _css_css_token_stream_js__rspack_import_5 = __webpack_require__(44148);
/* import */ var _misc_value_parser_js__rspack_import_8 = __webpack_require__(29090);
/* import */ var _options_js__rspack_import_3 = __webpack_require__(64626);
/* import */ var _html_filtering_body_parser_js__rspack_import_4 = __webpack_require__(15683);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `UboHtmlFilteringBodyParser` is responsible for parsing the body of
* an uBlock-style HTML filtering rule, and also uBlock-style response header removal rule.
*
* Please note that the parser will parse any HTML filtering rule if it is syntactically correct.
* For example, it will parse this:.
* ```adblock
* example.com##^script:pseudo(content)
* example.com##^responseheader(header-name)
* ```
*
* But it didn't check if the pseudo selector `pseudo` or if
* the header name `header-name` actually supported by any adblocker..
*
* @see {@link https://www.w3.org/TR/selectors-4}
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#html-filters}
* @see {@link https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#response-header-filtering}
*/
class UboHtmlFilteringBodyParser extends _base_parser_js__rspack_import_2/* .BaseParser */.V {
/**
* Parses the body of an uBlock-style HTML filtering rule
* and also uBlock-style response header removal rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed HTML filtering rule body.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* div:has-text(Example)
* responseheader(header-name)
* ```
*/
static parse(raw, options = _options_js__rspack_import_3/* .defaultParserOptions */.n, baseOffset = 0) {
// First, check if it's a response header removal rule and return if so
const responseHeaderBody = UboHtmlFilteringBodyParser.parseResponseHeaderRule(raw, options, baseOffset);
if (responseHeaderBody !== null) {
return responseHeaderBody;
}
return _html_filtering_body_parser_js__rspack_import_4/* .HtmlFilteringBodyParser.parse */.F.parse(raw, options, baseOffset);
}
/**
* Parses uBlock-style response header removal rule body.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Node of the parsed response header removal rule body
* or `null` if the body is not a response header removal rule.
*
* @throws If the body is syntactically incorrect.
*
* @example
* ```
* responseheader(header-name)
* ```
*
* @note This method returns `HtmlFilteringRuleBody` because,
* response header removal rule syntax is same as uBlock-style
* HTML filtering rule syntax.
*/
static parseResponseHeaderRule(raw, options = _options_js__rspack_import_3/* .defaultParserOptions */.n, baseOffset = 0) {
// If HTML filtering rules parsing is disabled, return null
if (!options.parseHtmlFilteringRuleBodies) {
return null;
}
// Construct the stream
const stream = new _css_css_token_stream_js__rspack_import_5/* .CssTokenStream */.d(raw, baseOffset);
// Skip whitespaces before function
stream.skipWhitespace();
// Get token
let token = stream.get();
// Token should be a function
if (!token || token.type !== _adguard_css_tokenizer__rspack_import_1/* .TokenType.Function */.ks.Function) {
return null;
}
// Save the function start position
const { start } = token;
// Extract function name raw value (without opening parenthesis)
const functionNameRaw = raw.slice(token.start, token.end - 1);
// Check if it's `responseheader` function
if (functionNameRaw !== _utils_constants_js__rspack_import_6/* .UBO_RESPONSEHEADER_FN */.Bt) {
return null;
}
// Advance function token
stream.advance();
// Skip whitespaces after opening parenthesis
stream.skipWhitespace();
// Get argument token
token = stream.getOrFail();
// Save argument start position (starts after opening parenthesis and whitespaces)
const argumentStart = token.start;
// Skip until balanced (search for closing parenthesis)
stream.skipUntilBalanced();
// Get closing parenthesis token
token = stream.getOrFail();
// Save argument end position (ends before closing parenthesis)
const argumentEnd = token.start;
// Extract argument raw value
const argumentRaw = raw.slice(argumentStart, argumentEnd).trimEnd();
// Throw if the argument is empty
if (argumentRaw.length === 0) {
throw new _errors_adblock_syntax_error_js__rspack_import_7/* .AdblockSyntaxError */.q(`Empty parameter for '${_utils_constants_js__rspack_import_6/* .UBO_RESPONSEHEADER_FN */.Bt}' function`, argumentStart + baseOffset, argumentEnd + baseOffset);
}
// Expect closing parenthesis
stream.expect(_adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseParenthesis */.ks.CloseParenthesis);
// Advance closing parenthesis token
stream.advance();
// Skip whitespaces after closing parenthesis
stream.skipWhitespace();
// Expect the end of the rule - so nothing should be left in the stream
if (!stream.isEof()) {
token = stream.getOrFail();
throw new _errors_adblock_syntax_error_js__rspack_import_7/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)("Expected end of rule, but got '%s'", (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(token.type)), token.start + baseOffset, token.end + baseOffset);
}
// Construct pseudo-class selector node
const pseudoClassSelectorNode = {
type: 'PseudoClassSelector',
name: _misc_value_parser_js__rspack_import_8/* .ValueParser.parse */.J.parse(functionNameRaw, options, start + baseOffset),
argument: _misc_value_parser_js__rspack_import_8/* .ValueParser.parse */.J.parse(argumentRaw, options, argumentStart + baseOffset),
};
// Construct complex selector node
const complexSelectorNode = {
type: 'ComplexSelector',
children: [pseudoClassSelectorNode],
};
// Construct selector list node
const selectorList = {
type: 'SelectorList',
children: [complexSelectorNode],
};
// Construct body node
const result = {
type: 'HtmlFilteringRuleBody',
selectorList,
};
// Get last non-whitespace token
const lastNonWsToken = stream.lookbehindForNonWs();
// It shouldn't be null here, but just to be safe if it is
// it means that raw is empty or contains only whitespaces
if (!lastNonWsToken) {
return null;
}
// Include locations info if needed
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = raw.length + baseOffset;
selectorList.start = start + baseOffset;
selectorList.end = lastNonWsToken.end + baseOffset;
complexSelectorNode.start = selectorList.start;
complexSelectorNode.end = selectorList.end;
pseudoClassSelectorNode.start = complexSelectorNode.start;
pseudoClassSelectorNode.end = complexSelectorNode.end;
}
return result;
}
}
},
51175(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
g: () => (tokenizeFnBalanced),
u: () => (tokenizeBalanced)
});
/* import */ var sprintf_js__rspack_import_0 = __webpack_require__(37155);
/* import */ var _adguard_css_tokenizer__rspack_import_1 = __webpack_require__(83747);
/* import */ var _errors_adblock_syntax_error_js__rspack_import_2 = __webpack_require__(10631);
/* import */ var _constants_js__rspack_import_3 = __webpack_require__(57545);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Tokenizer helpers for balanced pairs.
*/
/**
* Map of opening tokens to their corresponding closing tokens.
*/
const standardTokenPairs = new Map([
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.Function */.ks.Function, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseParenthesis */.ks.CloseParenthesis],
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.OpenParenthesis */.ks.OpenParenthesis, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseParenthesis */.ks.CloseParenthesis],
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.OpenSquareBracket */.ks.OpenSquareBracket, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseSquareBracket */.ks.CloseSquareBracket],
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.OpenCurlyBracket */.ks.OpenCurlyBracket, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseCurlyBracket */.ks.CloseCurlyBracket],
]);
/**
* Map of opening tokens to their corresponding closing tokens just for function calls. This makes possible a more
* lightweight and tolerant check for balanced pairs in some cases.
*/
const functionTokenPairs = new Map([
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.Function */.ks.Function, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseParenthesis */.ks.CloseParenthesis],
[_adguard_css_tokenizer__rspack_import_1/* .TokenType.OpenParenthesis */.ks.OpenParenthesis, _adguard_css_tokenizer__rspack_import_1/* .TokenType.CloseParenthesis */.ks.CloseParenthesis],
]);
/**
* Helper function to tokenize and ensure balanced pairs.
*
* @param raw Raw CSS string to tokenize.
* @param onToken Callback which will be invoked for each token, extended with a `balance` parameter.
* @param onError Error callback which is called when a parsing error is found (optional).
* @param functionHandlers Custom function handlers (optional).
* @param tokenPairs Map of opening tokens to their corresponding closing tokens.
*
* @throws If the input is not balanced.
*
* @todo Consider adding a `tolerant` flag if error throwing seems too aggressive in the future.
*/
const tokenizeWithBalancedPairs = (raw, onToken, onError = () => { }, functionHandlers, tokenPairs = standardTokenPairs) => {
const stack = [];
const values = new Set(tokenPairs.values());
(0,_adguard_css_tokenizer__rspack_import_1/* .tokenizeExtended */.jz)(raw, (type, start, end, props, stop) => {
if (tokenPairs.has(type)) {
// If the token is an opening token, push its corresponding closing token to the stack.
// It is safe to use non-null assertion here, because we have checked that the token exists in the map.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
stack.push(tokenPairs.get(type));
}
else if (values.has(type)) {
// If the token is a closing token, check if it matches the last opening token, and if so, pop it.
if (stack[stack.length - 1] === type) {
stack.pop();
}
else {
throw new _errors_adblock_syntax_error_js__rspack_import_2/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_3/* .ERROR_MESSAGES.EXPECTED_TOKEN_BUT_GOT */.U.EXPECTED_TOKEN_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(stack[stack.length - 1]), (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(type)), start, raw.length);
}
}
onToken(type, start, end, props, stack.length, stop);
}, onError, functionHandlers);
// If the stack is not empty, then there are some opening tokens that were not closed.
if (stack.length > 0) {
throw new _errors_adblock_syntax_error_js__rspack_import_2/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_3/* .ERROR_MESSAGES.EXPECTED_TOKEN_BUT_GOT */.U.EXPECTED_TOKEN_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(stack[stack.length - 1]), _constants_js__rspack_import_3/* .END_OF_INPUT */.F), raw.length - 1, raw.length);
}
};
/**
* Tokenize and ensure balanced pairs for standard CSS.
*
* @param raw Raw CSS string to tokenize.
* @param onToken Callback which will be invoked for each token, extended with a `balance` parameter.
* @param onError Error callback which is called when a parsing error is found (optional).
* @param functionHandlers Custom function handlers (optional).
*
* @throws If the input is not balanced.
*/
const tokenizeBalanced = (raw, onToken, onError = () => { }, functionHandlers) => {
tokenizeWithBalancedPairs(raw, onToken, onError, functionHandlers);
};
/**
* Tokenize and ensure balanced pairs for function calls.
*
* @param raw Raw CSS string to tokenize.
* @param onToken Callback which will be invoked for each token, extended with a `balance` parameter.
* @param onError Error callback which is called when a parsing error is found (optional).
* @param functionHandlers Custom function handlers (optional).
*
* @throws If the input is not balanced.
*/
const tokenizeFnBalanced = (raw, onToken, onError = () => { }, functionHandlers) => {
tokenizeWithBalancedPairs(raw, onToken, onError, functionHandlers, functionTokenPairs);
};
},
57545(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
F: () => (END_OF_INPUT),
U: () => (ERROR_MESSAGES)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Error messages for CSS token stream and balancer.
*/
const END_OF_INPUT = 'end of input';
const ERROR_MESSAGES = {
EXPECTED_ANY_TOKEN_BUT_GOT: "Expected a token, but got '%s'",
EXPECTED_TOKEN_BUT_GOT: "Expected '%s', but got '%s'",
EXPECTED_TOKEN_WITH_BALANCE_BUT_GOT: "Expected '%s' with balance '%d', but got '%d'",
EXPECTED_TOKEN_WITH_VALUE_BUT_GOT: "Expected '%s' with value '%s', but got '%s'",
};
},
44148(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
d: () => (CssTokenStream)
});
/* import */ var sprintf_js__rspack_import_0 = __webpack_require__(37155);
/* import */ var _adguard_css_tokenizer__rspack_import_1 = __webpack_require__(83747);
/* import */ var _converter_data_css_js__rspack_import_6 = __webpack_require__(63829);
/* import */ var _errors_adblock_syntax_error_js__rspack_import_4 = __webpack_require__(10631);
/* import */ var _utils_constants_js__rspack_import_2 = __webpack_require__(53097);
/* import */ var _balancing_js__rspack_import_3 = __webpack_require__(51175);
/* import */ var _constants_js__rspack_import_5 = __webpack_require__(57545);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file CSS token stream.
*/
/**
* Represents a stream of CSS tokens.
*/
class CssTokenStream {
/**
* The tokens in the stream.
*/
tokens = [];
/**
* The source string.
*/
source = _utils_constants_js__rspack_import_2/* .EMPTY */.wg;
/**
* The current index in the stream.
*/
index = 0;
/**
* The base offset of the source string.
*/
baseOffset;
/**
* Initializes a new instance of the TokenStream class.
*
* @param source The source string to tokenize.
* @param baseOffset The base offset of the source string.
*/
constructor(source, baseOffset = 0) {
this.source = source;
// Tokenize the source string with the CSS tokenizer and add balance level to each token.
// 'onToken' callback is invoked when a token is found in the source string.
// Passed parameters:
// - type: type of the token
// - start: start index of the token
// - end: end index of the token
// - props: additional properties of the token, if any (we don't use it here, this is why we use underscore)
// - balance: balance level of the token
try {
(0,_balancing_js__rspack_import_3/* .tokenizeBalanced */.u)(source, (type, start, end, _, balance) => {
this.tokens.push({
type,
start,
end,
balance,
});
});
}
catch (error) {
// If the error is an AdblockSyntaxError, adjust the error positions to the base offset
if (error instanceof _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q) {
error.start += baseOffset;
error.end += baseOffset;
throw error;
}
}
this.index = 0;
this.baseOffset = baseOffset;
}
/**
* Gets the number of tokens in the stream.
*
* @returns The number of tokens in the stream.
*/
get length() {
return this.tokens.length;
}
/**
* Checks if the end of the token stream is reached.
*
* @returns True if the end of the stream is reached, otherwise false.
*/
isEof() {
return this.index >= this.tokens.length;
}
/**
* Gets the token at the specified index.
*
* @param index The index of the token to retrieve.
*
* @returns The token at the specified index or undefined if the index is out of bounds.
*/
get(index = this.index) {
return this.tokens[index];
}
/**
* Gets the token at the specified index or throws if no token is found at the specified index.
*
* @param index The index of the token to retrieve.
*
* @returns The token at the specified index or undefined if the index is out of bounds.
*
* @throws If no token is found at the specified index.
*/
getOrFail(index = this.index) {
const token = this.get(index);
if (!token) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_5/* .ERROR_MESSAGES.EXPECTED_ANY_TOKEN_BUT_GOT */.U.EXPECTED_ANY_TOKEN_BUT_GOT, _constants_js__rspack_import_5/* .END_OF_INPUT */.F), this.baseOffset + this.source.length - 1, this.baseOffset + this.source.length);
}
return token;
}
/**
* Gets the source fragment of the token at the specified index.
*
* @param index The index of the token to retrieve the fragment for.
*
* @returns The source fragment of the token or an empty string if the index is out of bounds.
*/
fragment(index = this.index) {
const token = this.get(index);
if (token) {
return this.source.slice(token.start, token.end);
}
return _utils_constants_js__rspack_import_2/* .EMPTY */.wg;
}
/**
* Moves the index to the next token and returns it.
*
* @returns The next token or undefined if the end of the stream is reached.
*/
advance() {
if (this.isEof()) {
return undefined;
}
this.index += 1;
return this.tokens[this.index];
}
/**
* Looks ahead in the stream without changing the index.
*
* @param index The relative index to look ahead to, starting from the current index.
*
* @returns The next token or undefined if the end of the stream is reached.
*/
lookahead(index = 1) {
return this.tokens[this.index + Math.max(1, index)];
}
/**
* Looks behind in the stream without changing the index.
*
* @param index The relative index to look behind to, starting from the current index.
*
* @returns The previous token or undefined if the current token is the first in the stream.
*/
lookbehind(index = 1) {
if (this.index === 0) {
return undefined;
}
return this.tokens[this.index - Math.max(1, index)];
}
/**
* Looks behind in the stream for the previous non-whitespace token without changing the index.
*
* @returns The previous non-whitespace token or undefined if it could not be found.
*/
lookbehindForNonWs() {
for (let i = this.index - 1; i >= 0; i -= 1) {
if (this.tokens[i].type !== _adguard_css_tokenizer__rspack_import_1/* .TokenType.Whitespace */.ks.Whitespace) {
return this.tokens[i];
}
}
return undefined;
}
/**
* Skips whitespace tokens in the stream.
*/
skipWhitespace() {
while (this.get()?.type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Whitespace */.ks.Whitespace) {
this.index += 1;
}
}
/**
* Skips tokens until the current balance level is reached.
*
* @returns The number of tokens skipped.
*/
skipUntilBalanced() {
if (this.isEof()) {
return 0;
}
// It is safe to use ! here, because we check for EOF above
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const currentBalance = this.get().balance;
// If the current balance is 0, do nothing
if (currentBalance === 0) {
return 0;
}
// Otherwise, skip tokens until the balance is the current balance - 1
let skipped = 0;
while (!this.isEof() && this.get()?.balance !== currentBalance - 1) {
this.index += 1;
skipped += 1;
}
return skipped;
}
/**
* Skips tokens until a token with the specified type or the end of the stream is reached.
*
* @param type The type of token to skip until.
* @param balance The balance level of the token to skip until.
*
* @returns The number of tokens skipped.
*/
skipUntil(type, balance) {
let skipped = 0;
while (!this.isEof()
&& (this.get()?.type !== type || (balance !== undefined && this.get()?.balance !== balance))) {
this.index += 1;
skipped += 1;
}
return skipped;
}
/**
* Skips tokens until a token with the specified type or the end of the stream is reached. This is an extended
* version of skipUntil that also returns the number of tokens skipped without calculating leading and trailing
* whitespace tokens.
*
* @param type The type of token to skip until.
* @param balance The balance level of the token to skip until.
*
* @returns An array containing the number of tokens skipped and the number of tokens skipped without leading and
* trailing whitespace tokens.
*/
skipUntilExt(type, balance) {
let i = this.index;
let firstNonWsToken = -1; // -1 means no non-whitespace token found yet
let lastNonWsToken = -1; // -1 means no non-whitespace token found yet
while (i < this.tokens.length) {
const currentToken = this.tokens[i];
if (currentToken.type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Whitespace */.ks.Whitespace) {
i += 1;
continue;
}
else if (currentToken.type === type && currentToken.balance === balance) {
break;
}
if (firstNonWsToken === -1) {
firstNonWsToken = i;
}
lastNonWsToken = i;
i += 1;
}
const skipped = i - this.index;
this.index = i;
return {
skipped,
// if firstNonWsToken is -1, then lastNonWsToken is also -1
skippedTrimmed: firstNonWsToken === -1 ? 0 : lastNonWsToken - firstNonWsToken + 1,
};
}
/**
* Expects that the end of the stream is not reached.
*/
expectNotEof() {
if (this.isEof()) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q('Unexpected end of input', this.baseOffset + this.source.length - 1, this.baseOffset + this.source.length);
}
}
/**
* Expects the current token to have a specific type and optional value and balance level.
*
* @param type The expected token type.
* @param data Optional expectation data.
*
* @throws If the end of the stream is reached or if the token type or expectation data does not match.
*/
expect(type, data) {
const token = this.get();
if (!token) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_5/* .ERROR_MESSAGES.EXPECTED_TOKEN_BUT_GOT */.U.EXPECTED_TOKEN_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(type), _constants_js__rspack_import_5/* .END_OF_INPUT */.F), this.baseOffset + this.source.length - 1, this.baseOffset + this.source.length);
}
if (token.type !== type) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_5/* .ERROR_MESSAGES.EXPECTED_TOKEN_BUT_GOT */.U.EXPECTED_TOKEN_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(type), (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(token.type)), this.baseOffset + token.start, this.baseOffset + token.end);
}
if (data?.balance !== undefined && token.balance !== data.balance) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_5/* .ERROR_MESSAGES.EXPECTED_TOKEN_WITH_BALANCE_BUT_GOT */.U.EXPECTED_TOKEN_WITH_BALANCE_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(type), data.balance, token.balance), this.baseOffset + token.start, this.baseOffset + token.end);
}
if (data?.value && this.fragment() !== data.value) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q((0,sprintf_js__rspack_import_0.sprintf)(_constants_js__rspack_import_5/* .ERROR_MESSAGES.EXPECTED_TOKEN_WITH_VALUE_BUT_GOT */.U.EXPECTED_TOKEN_WITH_VALUE_BUT_GOT, (0,_adguard_css_tokenizer__rspack_import_1/* .getFormattedTokenName */.bZ)(type), data.value, this.fragment()), this.baseOffset + token.start, this.baseOffset + token.end);
}
}
/**
* Gets the balance level of the token at the specified index.
*
* @param index The index of the token to retrieve the balance level for.
*
* @returns The balance level of the token or 0 if the index is out of bounds.
*/
getBalance(index = this.index) {
return this.tokens[index]?.balance || 0;
}
/**
* Checks whether the token stream contains any Extended CSS elements, such as `:contains()`, etc.
*
* @returns `true` if the stream contains any Extended CSS elements, otherwise `false`.
*/
hasAnySelectorExtendedCssNode() {
return this.hasAnySelectorExtendedCssNodeInternal(_converter_data_css_js__rspack_import_6/* .EXT_CSS_PSEUDO_CLASSES */.Ss);
}
/**
* Strictly checks whether the token stream contains any Extended CSS elements, such as `:contains()`.
*
* Some Extended CSS elements are natively supported by browsers, like `:has()`.
* This method is used to check for Extended CSS elements that are not natively supported by browsers,
* this is why it called "strict", because it strictly checks for Extended CSS elements.
*
* @returns `true` if the stream contains any Extended CSS elements, otherwise `false`.
*/
hasAnySelectorExtendedCssNodeStrict() {
return this.hasAnySelectorExtendedCssNodeInternal(_converter_data_css_js__rspack_import_6/* .EXT_CSS_PSEUDO_CLASSES_STRICT */.ig);
}
/**
* _Lightweight_ static check for native CSS pseudo-classes — `:has()`, `:is()`, `:not()`.
*
* This method uses `tokenizeExtended` directly with early stopping,
* avoiding the overhead of:
* - full tokenization with balance tracking;
* - storing all tokens in memory;
* - processing remaining tokens after a match is found.
*
* Use this method when you only need to detect native pseudo-classes
* and don't need the full `CssTokenStream` functionality.
*
* @param selector CSS selector string to check.
*
* @returns True if the selector contains `:has()`, `:is()`, or `:not()`,
* otherwise false.
*/
static hasNativeCssPseudoClass(selector) {
let found = false;
try {
(0,_adguard_css_tokenizer__rspack_import_1/* .tokenizeExtended */.jz)(selector, (type, start, end, _props, stop) => {
if (type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Function */.ks.Function) {
// Omit trailing '(' from function name
const name = selector.slice(start, end - 1);
if (_converter_data_css_js__rspack_import_6/* .NATIVE_CSS_PSEUDO_CLASSES.has */.Y_.has(name)) {
found = true;
stop();
}
}
});
}
catch {
// Invalid CSS, treat as not containing native pseudo-classes
return false;
}
return found;
}
/**
* Checks whether the token stream contains any Extended CSS elements, such as `:has()`, `:contains()`, etc.
*
* @param pseudos Set of pseudo-classes to check for.
*
* @returns `true` if the stream contains any Extended CSS elements, otherwise `false`.
*/
hasAnySelectorExtendedCssNodeInternal(pseudos) {
for (let i = 0; i < this.tokens.length; i += 1) {
const token = this.tokens[i];
if (token.type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Function */.ks.Function) {
const name = this.source.slice(token.start, token.end - 1); // omit the last parenthesis
if (pseudos.has(name)) {
return true;
}
}
else if (token.type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.OpenSquareBracket */.ks.OpenSquareBracket) {
let j = i + 1;
// skip whitespace
while (j < this.tokens.length && this.tokens[j].type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Whitespace */.ks.Whitespace) {
j += 1;
}
if (j < this.tokens.length && this.tokens[j].type === _adguard_css_tokenizer__rspack_import_1/* .TokenType.Ident */.ks.Ident) {
const attr = this.source.slice(this.tokens[j].start, this.tokens[j].end);
// [-ext-<name>=...] or [-abp-<name>=...]
if (attr.startsWith(_converter_data_css_js__rspack_import_6/* .LEGACY_EXT_CSS_ATTRIBUTE_PREFIX */.at) || attr.startsWith(_converter_data_css_js__rspack_import_6/* .ABP_EXT_CSS_PREFIX */.PY)) {
return true;
}
}
// do not check these tokens again
i = j;
}
}
return false;
}
}
},
70254(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
y: () => (/* binding */ DomainListParser)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/list-items-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Prefixes for error messages which are used for parsing of value lists.
*/
const LIST_PARSE_ERROR_PREFIX = {
EMPTY_ITEM: 'Empty value specified in the list',
NO_MULTIPLE_NEGATION: 'Exception marker cannot be followed by another exception marker',
NO_SEPARATOR_AFTER_NEGATION: 'Exception marker cannot be followed by a separator',
NO_SEPARATOR_AT_THE_BEGINNING: 'Value list cannot start with a separator',
NO_SEPARATOR_AT_THE_END: 'Value list cannot end with a separator',
NO_WHITESPACE_AFTER_NEGATION: 'Exception marker cannot be followed by whitespace',
};
/**
* Parser for list items in modifiers.
*/
class ListItemsParser {
/**
* Parses a `raw` modifier value which may be represented as a list of items separated by `separator`.
* Needed for $app, $denyallow, $domain, $method.
*
* @template T Type of the list items.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
* @param separator Separator character (default: comma).
* @param type Type of the list items (default: {@link ListItemNodeType.Domain}).
*
* @returns List of parsed items.
*
* @throws An {@link AdblockSyntaxError} if the list is syntactically invalid.
*
* @example
* - parses an app list — `com.example.app|Example.exe`
* - parses a domain list — `example.com,example.org,~example.org` or `example.com|~example.org`
* - parses a method list — `~post|~put`
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0, separator = constants/* .COMMA */.KE, type = nodes/* .ListItemNodeType.Unknown */.WR.Unknown) {
// Function body here
const rawListItems = [];
let offset = 0;
// Skip whitespace before the list
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// If the first character is a separator, then the list is invalid
// and no need to continue parsing
if (raw[offset] === separator) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.NO_SEPARATOR_AT_THE_BEGINNING, baseOffset + offset, baseOffset + raw.length);
}
// If the last character is a separator, then the list item is invalid
// and no need to continue parsing
const realEndIndex = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw);
if (raw[realEndIndex] === separator) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.NO_SEPARATOR_AT_THE_END, baseOffset + realEndIndex, baseOffset + realEndIndex + 1);
}
// Split list items by unescaped separators
while (offset < raw.length) {
// Skip whitespace before the list item
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
const exception = raw[offset] === constants/* .NEGATION_MARKER */.bP;
const itemStart = exception
? offset + 1
: offset;
let separatorStartIndex = -1;
// item possibly a regex
if (raw[itemStart] === constants/* .REGEX_MARKER */.Vb) {
// try to find the next slash
let i = itemStart + 1;
let insideCharacterClass = false;
let escaped = false;
while (i < raw.length) {
if (escaped) {
escaped = false;
}
else if (raw[i] === constants/* .ESCAPE_CHARACTER */.Kx) {
escaped = true;
}
else if (raw[i] === constants/* .OPEN_SQUARE_BRACKET */.cU) {
insideCharacterClass = true;
}
else if (raw[i] === constants/* .CLOSE_SQUARE_BRACKET */.A1) {
insideCharacterClass = false;
}
else if (!insideCharacterClass
&& raw[i] === constants/* .REGEX_MARKER */.Vb) {
// check if slash followed by optional space followed by the separator
const j = string/* .StringUtils.skipWS */.$x.skipWS(raw, i + 1);
if (raw[j] === separator) {
separatorStartIndex = j;
break;
}
}
i += 1;
}
if (separatorStartIndex === -1) {
separatorStartIndex = raw.length;
}
}
else {
separatorStartIndex = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, separator, itemStart);
}
const itemEnd = separatorStartIndex === -1
? string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1
: string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorStartIndex - 1) + 1;
// Skip the exception marker
if (exception) {
const item = raw[itemStart];
// Exception marker cannot be followed by another exception marker
if (item === constants/* .NEGATION_MARKER */.bP) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.NO_MULTIPLE_NEGATION, baseOffset + itemStart, baseOffset + itemStart + 1);
}
// Exception marker cannot be followed by a separator
if (item === separator) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.NO_SEPARATOR_AFTER_NEGATION, baseOffset + itemStart, baseOffset + itemStart + 1);
}
// Exception marker cannot be followed by whitespace
if (string/* .StringUtils.isWhitespace */.$x.isWhitespace(item)) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.NO_WHITESPACE_AFTER_NEGATION, baseOffset + itemStart, baseOffset + itemStart + 1);
}
}
// List item can't be empty
// Note we use '<=' instead of '===' because we have bidirectional trim
// This is needed to handle cases like 'example.com, ,example.org'
if (itemEnd <= itemStart) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q(LIST_PARSE_ERROR_PREFIX.EMPTY_ITEM, baseOffset + itemStart, baseOffset + raw.length);
}
const listItem = {
type,
value: raw.slice(itemStart, itemEnd),
exception,
};
if (options.isLocIncluded) {
listItem.start = baseOffset + itemStart;
listItem.end = baseOffset + itemEnd;
}
// Collect list item
rawListItems.push(listItem);
// Increment the offset to the next list item (or the end of the string)
offset = separatorStartIndex === -1 ? raw.length : separatorStartIndex + 1;
}
return rawListItems;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/domain-list-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `DomainListParser` is responsible for parsing a domain list.
*
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_domains}
*
* @example
* - If the rule is `example.com,~example.net##.ads`, the domain list is `example.com,~example.net`.
* - If the rule is `ads.js^$script,domains=example.com|~example.org`, the domain list is `example.com|~example.org`.
* This parser is responsible for parsing these domain lists.
*/
class DomainListParser extends base_parser/* .BaseParser */.V {
/**
* Parses a domain list, eg. `example.com,example.org,~example.org`.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
* @param separator Separator character (default: comma).
*
* @returns Domain list AST.
*
* @throws An {@link AdblockSyntaxError} if the domain list is syntactically invalid.
* @throws An {@link Error} if the options are invalid.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0, separator = constants/* .COMMA */.KE) {
if (separator !== constants/* .COMMA */.KE && separator !== constants/* .PIPE */.L5) {
throw new Error(`Invalid separator: ${separator}`);
}
const result = {
type: nodes/* .ListNodeType.DomainList */.h6.DomainList,
separator,
children: ListItemsParser.parse(raw, options, baseOffset, separator, nodes/* .ListItemNodeType.Domain */.WR.Domain),
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
},
48609(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Z: () => (NodeType),
f: () => (LogicalExpressionParser)
});
/* import */ var _errors_adblock_syntax_error_js__rspack_import_4 = __webpack_require__(10631);
/* import */ var _nodes_index_js__rspack_import_0 = __webpack_require__(79864);
/* import */ var _utils_constants_js__rspack_import_3 = __webpack_require__(53097);
/* import */ var _utils_string_js__rspack_import_2 = __webpack_require__(16875);
/* import */ var _base_parser_js__rspack_import_1 = __webpack_require__(79963);
/* import */ var _options_js__rspack_import_5 = __webpack_require__(64626);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Possible token types in the logical expression.
*/
const TokenType = {
Variable: 0,
Operator: 1,
Parenthesis: 2,
};
/**
* Possible node types in the logical expression.
*/
const NodeType = {
Variable: 'Variable',
Operator: 'Operator',
Parenthesis: 'Parenthesis',
};
/**
* Precedence of the operators, larger number means higher precedence.
*/
const OPERATOR_PRECEDENCE = {
[_nodes_index_js__rspack_import_0/* .OperatorValue.Not */.oC.Not]: 3,
[_nodes_index_js__rspack_import_0/* .OperatorValue.And */.oC.And]: 2,
[_nodes_index_js__rspack_import_0/* .OperatorValue.Or */.oC.Or]: 1,
};
/**
* `LogicalExpressionParser` is responsible for parsing logical expressions.
*
* @example
* From the following rule:
* ```adblock
* !#if (adguard_ext_android_cb || adguard_ext_safari)
* ```
* this parser will parse the expression `(adguard_ext_android_cb || adguard_ext_safari)`.
*/
// TODO: Refactor this class
class LogicalExpressionParser extends _base_parser_js__rspack_import_1/* .BaseParser */.V {
/**
* Split the expression into tokens.
*
* @param raw Source code of the expression.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Token list.
*
* @throws {AdblockSyntaxError} If the expression is invalid.
*/
static tokenize(raw, baseOffset = 0) {
const tokens = [];
let offset = 0;
while (offset < raw.length) {
const char = raw[offset];
if (_utils_string_js__rspack_import_2/* .StringUtils.isWhitespace */.$x.isWhitespace(char)) {
// Ignore whitespace
offset += 1;
}
else if (_utils_string_js__rspack_import_2/* .StringUtils.isLetter */.$x.isLetter(char)) {
// Save the start offset of the variable name
const nameStart = offset;
// Variable name shouldn't start with a number or underscore,
// but can contain them
while (offset + 1 < raw.length
&& (_utils_string_js__rspack_import_2/* .StringUtils.isAlphaNumeric */.$x.isAlphaNumeric(raw[offset + 1]) || raw[offset + 1] === _utils_constants_js__rspack_import_3/* .UNDERSCORE */.fB)) {
offset += 1;
}
tokens.push({
type: TokenType.Variable,
start: nameStart,
end: offset + 1,
});
offset += 1;
}
else if (char === _utils_constants_js__rspack_import_3/* .OPEN_PARENTHESIS */.Cx || char === _utils_constants_js__rspack_import_3/* .CLOSE_PARENTHESIS */.s1) {
// Parenthesis
tokens.push({
type: TokenType.Parenthesis,
start: offset,
end: offset + 1,
});
offset += 1;
}
else if (char === _utils_constants_js__rspack_import_3/* .AMPERSAND */.e0 || char === _utils_constants_js__rspack_import_3/* .PIPE */.L5) {
// Parse operator
if (offset + 1 < raw.length && raw[offset + 1] === char) {
tokens.push({
type: TokenType.Operator,
start: offset,
end: offset + 2,
});
offset += 2;
}
else {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Unexpected character "${char}"`, baseOffset + offset, baseOffset + offset + 1);
}
}
else if (char === _utils_constants_js__rspack_import_3/* .EXCLAMATION_MARK */.Ec) {
tokens.push({
type: TokenType.Operator,
start: offset,
end: offset + 1,
});
offset += 1;
}
else {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Unexpected character "${char}"`, baseOffset + offset, baseOffset + offset + 1);
}
}
return tokens;
}
/**
* Parses a logical expression.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Parsed expression.
*
* @throws {AdblockSyntaxError} If the expression is invalid.
*/
// TODO: Create a separate TokenStream class
static parse(raw, options = _options_js__rspack_import_5/* .defaultParserOptions */.n, baseOffset = 0) {
// Tokenize the source (produces an array of tokens)
const tokens = LogicalExpressionParser.tokenize(raw, baseOffset);
// Current token index
let tokenIndex = 0;
/**
* Consumes a token of the expected type.
*
* @param type Expected token type.
*
* @returns The consumed token.
*/
function consume(type) {
const token = tokens[tokenIndex];
if (!token) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Expected token of type "${type}", but reached end of input`, baseOffset, baseOffset + raw.length);
}
// We only use this function internally, so we can safely ignore this
// from the coverage report
// istanbul ignore next
if (token.type !== type) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Expected token of type "${type}", but got "${token.type}"`, baseOffset + token.start, baseOffset + token.end);
}
tokenIndex += 1;
return token;
}
/**
* Parses a variable.
*
* @returns Variable node.
*/
function parseVariable() {
const token = consume(TokenType.Variable);
const result = {
type: NodeType.Variable,
name: raw.slice(token.start, token.end),
};
if (options.isLocIncluded) {
result.start = baseOffset + token.start;
result.end = baseOffset + token.end;
}
return result;
}
/**
* Parses a binary expression.
*
* @param left Left-hand side of the expression.
* @param minPrecedence Minimum precedence of the operator.
*
* @returns Binary expression node.
*/
function parseBinaryExpression(left, minPrecedence = 0) {
let node = left;
let operatorToken;
while (tokens[tokenIndex]) {
operatorToken = tokens[tokenIndex];
if (!operatorToken || operatorToken.type !== TokenType.Operator) {
break;
}
// It is safe to cast here, because we already checked the type
const operator = raw.slice(operatorToken.start, operatorToken.end);
const precedence = OPERATOR_PRECEDENCE[operator];
if (precedence < minPrecedence) {
break;
}
tokenIndex += 1;
// eslint-disable-next-line @typescript-eslint/no-use-before-define
const right = parseExpression(precedence + 1);
const newNode = {
type: NodeType.Operator,
operator,
left: node,
right,
};
if (options.isLocIncluded) {
newNode.start = node.start ?? baseOffset + operatorToken.start;
newNode.end = right.end ?? baseOffset + operatorToken.end;
}
node = newNode;
}
return node;
}
/**
* Parses a parenthesized expression.
*
* @returns Parenthesized expression node.
*/
function parseParenthesizedExpression() {
consume(TokenType.Parenthesis);
// eslint-disable-next-line @typescript-eslint/no-use-before-define
const expression = parseExpression();
consume(TokenType.Parenthesis);
const result = {
type: NodeType.Parenthesis,
expression,
};
if (options.isLocIncluded) {
result.start = expression.start;
result.end = expression.end;
}
return result;
}
/**
* Parses an expression.
*
* @param minPrecedence Minimum precedence of the operator.
*
* @returns Expression node.
*/
function parseExpression(minPrecedence = 0) {
let node;
const token = tokens[tokenIndex];
const value = raw.slice(token.start, token.end);
if (token.type === TokenType.Variable) {
node = parseVariable();
}
else if (token.type === TokenType.Operator && value === _nodes_index_js__rspack_import_0/* .OperatorValue.Not */.oC.Not) {
tokenIndex += 1;
const expression = parseExpression(OPERATOR_PRECEDENCE[_nodes_index_js__rspack_import_0/* .OperatorValue.Not */.oC.Not]);
node = {
type: NodeType.Operator,
operator: _nodes_index_js__rspack_import_0/* .OperatorValue.Not */.oC.Not,
left: expression,
};
if (options.isLocIncluded) {
if (expression.end) {
node.start = baseOffset + token.start;
// no need to shift the node location, because it's already shifted
node.end = expression.end;
}
else {
node.start = baseOffset + token.start;
node.end = baseOffset + token.end;
}
}
}
else if (token.type === TokenType.Parenthesis && value === _utils_constants_js__rspack_import_3/* .OPEN_PARENTHESIS */.Cx) {
node = parseParenthesizedExpression();
}
else {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Unexpected token "${value}"`, baseOffset + token.start, baseOffset + token.end);
}
return parseBinaryExpression(node, minPrecedence);
}
const expression = parseExpression();
if (tokenIndex !== tokens.length) {
throw new _errors_adblock_syntax_error_js__rspack_import_4/* .AdblockSyntaxError */.q(`Unexpected token "${tokens[tokenIndex].type}"`, baseOffset + tokens[tokenIndex].start, baseOffset + tokens[tokenIndex].end);
}
return expression;
}
}
},
24704(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
l: () => (/* binding */ ModifierListParser)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/constants.js
var constants = __webpack_require__(53097);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/value-parser.js
var value_parser = __webpack_require__(29090);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/modifier-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `ModifierParser` is responsible for parsing modifiers.
*
* @example
* `match-case`, `~third-party`, `domain=example.com|~example.org`
*/
class ModifierParser extends base_parser/* .BaseParser */.V {
/**
* Parses a modifier.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Parsed modifier.
*
* @throws An error if modifier name or value is empty.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Skip leading whitespace
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save the offset of the first character of the modifier (whole modifier)
const modifierStart = offset;
// Check if the modifier is an exception
let exception = false;
if (raw[offset] === constants/* .NEGATION_MARKER */.bP) {
offset += constants/* .NEGATION_MARKER.length */.bP.length;
exception = true;
}
// Skip whitespace after the exception marker (if any)
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Save the offset of the first character of the modifier name
const modifierNameStart = offset;
// Find assignment operator
const assignmentIndex = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, constants/* .MODIFIER_ASSIGN_OPERATOR */.li);
// Find the end of the modifier
const modifierEnd = Math.max(string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1, modifierNameStart);
// Modifier name can't be empty
if (modifierNameStart === modifierEnd) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Modifier name cannot be empty', baseOffset, baseOffset + raw.length);
}
let modifier;
let value;
// If there is no assignment operator, the whole modifier is the name
// without a value
if (assignmentIndex === -1) {
modifier = value_parser/* .ValueParser.parse */.J.parse(raw.slice(modifierNameStart, modifierEnd), options, baseOffset + modifierNameStart);
}
else {
// If there is an assignment operator, first we need to find the
// end of the modifier name, then we can parse the value
const modifierNameEnd = string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, assignmentIndex - 1) + 1;
modifier = value_parser/* .ValueParser.parse */.J.parse(raw.slice(modifierNameStart, modifierNameEnd), options, baseOffset + modifierNameStart);
// Value can't be empty
if (assignmentIndex + 1 === modifierEnd) {
throw new adblock_syntax_error/* .AdblockSyntaxError */.q('Modifier value cannot be empty', baseOffset, baseOffset + raw.length);
}
// Skip whitespace after the assignment operator
const valueStart = string/* .StringUtils.skipWS */.$x.skipWS(raw, assignmentIndex + constants/* .MODIFIER_ASSIGN_OPERATOR.length */.li.length);
value = value_parser/* .ValueParser.parse */.J.parse(raw.slice(valueStart, modifierEnd), options, baseOffset + valueStart);
}
const result = {
type: 'Modifier',
name: modifier,
value,
exception,
};
if (options.isLocIncluded) {
result.start = baseOffset + modifierStart;
result.end = baseOffset + modifierEnd;
}
return result;
}
}
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/modifier-list.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `ModifierListParser` is responsible for parsing modifier lists. Please note that the name is not
* uniform, "modifiers" are also known as "options".
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules-modifiers}
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#non-basic-rules-modifiers}
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#options}
*/
class ModifierListParser extends base_parser/* .BaseParser */.V {
/**
* Parses the cosmetic rule modifiers, eg. `third-party,domain=example.com|~example.org`.
*
* _Note:_ you should remove `$` separator before passing the raw modifiers to this function,
* or it will be parsed in the first modifier.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Parsed modifiers interface.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
const result = {
type: 'ModifierList',
children: [],
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
let offset = string/* .StringUtils.skipWS */.$x.skipWS(raw);
let separatorIndex = -1;
// Split modifiers by unescaped commas
while (offset < raw.length) {
// Skip whitespace before the modifier
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
const modifierStart = offset;
// Check if this modifier has a regexp pattern
// Look for the `=` sign to find where the modifier value starts
let useSimpleSearch = false;
const equalsIndex = raw.indexOf('=', offset);
if (equalsIndex !== -1 && equalsIndex < raw.length - 1) {
const valueStart = equalsIndex + 1;
// Check if value starts with / (potential regex)
if (raw[valueStart] === '/' && raw[valueStart + 1] !== '/') {
// Look for a closing / for the regex pattern
// Search through the rest of the string for an unescaped /
let firstClosingSlashIndex = -1;
for (let i = valueStart + 1; i < raw.length; i += 1) {
if (raw[i] === '/' && raw[i - 1] !== '\\') {
firstClosingSlashIndex = i;
break;
}
}
if (firstClosingSlashIndex === -1) {
// No closing slash found anywhere - incomplete regex pattern
// Use simple search to allow it to work when it's the last modifier
useSimpleSearch = true;
}
else {
// Found a closing slash - check if there are MORE slashes after it
// If yes, this might be a complex pattern like replace=/pattern/replacement/flags
// and we should use simple search to avoid breaking it
let hasMoreSlashes = false;
for (let i = firstClosingSlashIndex + 1; i < raw.length; i += 1) {
if (raw[i] === '/' && raw[i - 1] !== '\\') {
hasMoreSlashes = true;
break;
}
}
// Use simple search if there are more slashes (complex pattern)
if (hasMoreSlashes) {
useSimpleSearch = true;
}
}
}
else {
// Value doesn't start with `/`, so it's not a regexp pattern.
// Use simple search to avoid treating slashes in values
// as regex markers, e.g. `redirect=googlesyndication.com/adsbygoogle.js`.
useSimpleSearch = true;
}
}
// Find the index of the first unescaped comma
let nextSeparator;
if (useSimpleSearch) {
// Use simple search for incomplete regex patterns
nextSeparator = string/* .StringUtils.findNextUnescapedCharacter */.$x.findNextUnescapedCharacter(raw, constants/* .MODIFIERS_SEPARATOR */.b9, offset);
}
else {
// Use regex-aware search to handle complete regex patterns
nextSeparator = string/* .StringUtils.findUnescapedNonStringNonRegexChar */.$x.findUnescapedNonStringNonRegexChar(raw, constants/* .MODIFIERS_SEPARATOR */.b9, offset);
}
separatorIndex = nextSeparator;
const modifierEnd = separatorIndex === -1
? raw.length
: string/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorIndex - 1) + 1;
// Parse the modifier
const modifier = ModifierParser.parse(raw.slice(modifierStart, modifierEnd), options, baseOffset + modifierStart);
result.children.push(modifier);
// Increment the offset to the next modifier (or the end of the string)
offset = separatorIndex === -1 ? raw.length : separatorIndex + 1;
}
// Check if there are any modifiers after the last separator
if (separatorIndex !== -1) {
const modifierStart = string/* .StringUtils.skipWS */.$x.skipWS(raw, separatorIndex + 1);
result.children.push(ModifierParser.parse(raw.slice(modifierStart, raw.length), options, baseOffset + modifierStart));
}
return result;
}
}
},
43939(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
D: () => (ParameterListParser)
});
/* import */ var _utils_constants_js__rspack_import_2 = __webpack_require__(53097);
/* import */ var _utils_string_js__rspack_import_3 = __webpack_require__(16875);
/* import */ var _base_parser_js__rspack_import_0 = __webpack_require__(79963);
/* import */ var _options_js__rspack_import_1 = __webpack_require__(64626);
/* import */ var _value_parser_js__rspack_import_4 = __webpack_require__(29090);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Parser for parameter lists.
*/
class ParameterListParser extends _base_parser_js__rspack_import_0/* .BaseParser */.V {
/**
* Parses a raw parameter list.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
* @param separator Separator character (default: comma).
*
* @returns Parameter list AST.
*/
static parse(raw, options = _options_js__rspack_import_1/* .defaultParserOptions */.n, baseOffset = 0, separator = _utils_constants_js__rspack_import_2/* .COMMA */.KE) {
// Prepare the parameter list node
const params = {
type: 'ParameterList',
children: [],
};
const { length } = raw;
if (options.isLocIncluded) {
params.start = baseOffset;
params.end = baseOffset + length;
}
let offset = 0;
// Parse parameters: skip whitespace before and after each parameter, and
// split parameters by the separator character.
while (offset < length) {
// Skip whitespace before parameter
offset = _utils_string_js__rspack_import_3/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Parameter may only contain whitespace
// In this case, we reached the end of the parameter list
if (raw[offset] === separator || offset === length) {
// Add a null for empty parameter
params.children.push(null);
// Skip separator
offset += 1;
}
else {
// Get parameter start position
const paramStart = offset;
// Get next unescaped separator position
const nextSeparator = _utils_string_js__rspack_import_3/* .StringUtils.findUnescapedNonStringNonRegexChar */.$x.findUnescapedNonStringNonRegexChar(raw, separator, offset);
// Get parameter end position
const paramEnd = nextSeparator !== -1
? _utils_string_js__rspack_import_3/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, nextSeparator - 1)
: _utils_string_js__rspack_import_3/* .StringUtils.skipWSBack */.$x.skipWSBack(raw);
// Add parameter to the list
const param = _value_parser_js__rspack_import_4/* .ValueParser.parse */.J.parse(raw.slice(paramStart, paramEnd + 1), options, baseOffset + paramStart);
params.children.push(param);
// Set offset to the next separator position + 1
offset = nextSeparator !== -1 ? nextSeparator + 1 : length;
}
}
// If the last character was a separator, add an additional null parameter
if (raw[length - 1] === separator) {
params.children.push(null);
}
return params;
}
}
},
29090(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
J: () => (ValueParser)
});
/* import */ var _base_parser_js__rspack_import_0 = __webpack_require__(79963);
/* import */ var _options_js__rspack_import_1 = __webpack_require__(64626);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Value parser.
* This parser is very simple, it just exists to provide a consistent interface for parsing.
*/
class ValueParser extends _base_parser_js__rspack_import_0/* .BaseParser */.V {
/**
* Parses a value.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Value node.
*/
static parse(raw, options = _options_js__rspack_import_1/* .defaultParserOptions */.n, baseOffset = 0) {
const result = {
type: 'Value',
value: raw,
};
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
},
72192(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
i: () => (NetworkRuleParser)
});
/* import */ var _errors_adblock_syntax_error_js__rspack_import_5 = __webpack_require__(10631);
/* import */ var _nodes_index_js__rspack_import_7 = __webpack_require__(79864);
/* import */ var _utils_adblockers_js__rspack_import_8 = __webpack_require__(22380);
/* import */ var _utils_constants_js__rspack_import_3 = __webpack_require__(53097);
/* import */ var _utils_string_js__rspack_import_2 = __webpack_require__(16875);
/* import */ var _base_parser_js__rspack_import_0 = __webpack_require__(79963);
/* import */ var _misc_modifier_list_js__rspack_import_6 = __webpack_require__(24704);
/* import */ var _misc_value_parser_js__rspack_import_4 = __webpack_require__(29090);
/* import */ var _options_js__rspack_import_1 = __webpack_require__(64626);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* `NetworkRuleParser` is responsible for parsing network rules.
*
* Please note that this will parse all syntactically correct network rules.
* Modifier compatibility is not checked at the parser level.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules}
* @see {@link https://help.eyeo.com/adblockplus/how-to-write-filters#basic}
*/
class NetworkRuleParser extends _base_parser_js__rspack_import_0/* .BaseParser */.V {
/**
* Parses a network rule (also known as basic rule).
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Network rule AST.
*
* @throws If the rule is syntactically incorrect.
*/
static parse(raw, options = _options_js__rspack_import_1/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = 0;
// Skip leading whitespace
offset = _utils_string_js__rspack_import_2/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
// Handle exception rules
let exception = false;
// Rule starts with exception marker, eg @@||example.com,
// where @@ is the exception marker
if (raw.startsWith(_utils_constants_js__rspack_import_3/* .NETWORK_RULE_EXCEPTION_MARKER */.rF, offset)) {
offset += _utils_constants_js__rspack_import_3/* .NETWORK_RULE_EXCEPTION_MARKER_LEN */.Lb;
exception = true;
}
// Save the start of the pattern
const patternStart = offset;
// Find corresponding (last) separator ($) character (if any)
const separatorIndex = NetworkRuleParser.findNetworkRuleSeparatorIndex(raw);
// Save the end of the pattern
const patternEnd = separatorIndex === -1
? _utils_string_js__rspack_import_2/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1
: _utils_string_js__rspack_import_2/* .StringUtils.skipWSBack */.$x.skipWSBack(raw, separatorIndex - 1) + 1;
// Parse pattern
const pattern = _misc_value_parser_js__rspack_import_4/* .ValueParser.parse */.J.parse(raw.slice(patternStart, patternEnd), options, baseOffset + patternStart);
// Parse modifiers (if any)
let modifiers;
// Get a last non-whitespace index
const lastNonWsIndex = _utils_string_js__rspack_import_2/* .StringUtils.skipWSBack */.$x.skipWSBack(raw);
// Find start and end index of the modifiers
const modifiersStart = separatorIndex + 1;
const modifiersEnd = _utils_string_js__rspack_import_2/* .StringUtils.skipWSBack */.$x.skipWSBack(raw) + 1;
if (separatorIndex !== -1) {
// Check for empty modifiers
if (separatorIndex === lastNonWsIndex) {
throw new _errors_adblock_syntax_error_js__rspack_import_5/* .AdblockSyntaxError */.q('Empty modifiers are not allowed', baseOffset + separatorIndex, baseOffset + raw.length);
}
modifiers = _misc_modifier_list_js__rspack_import_6/* .ModifierListParser.parse */.l.parse(raw.slice(modifiersStart, modifiersEnd), options, baseOffset + modifiersStart);
}
// Throw error if there is no pattern and no modifiers
if (pattern.value.length === 0 && (modifiers === undefined || modifiers.children.length === 0)) {
throw new _errors_adblock_syntax_error_js__rspack_import_5/* .AdblockSyntaxError */.q('Network rule must have a pattern or modifiers', baseOffset, baseOffset + raw.length);
}
const result = {
type: _nodes_index_js__rspack_import_7/* .NetworkRuleType.NetworkRule */.vY.NetworkRule,
category: _nodes_index_js__rspack_import_7/* .RuleCategory.Network */.$O.Network,
syntax: _utils_adblockers_js__rspack_import_8/* .AdblockSyntax.Common */.YG.Common,
exception,
pattern,
modifiers,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
/**
* Finds the index of the separator character in a network rule.
*
* @param rule Network rule to check.
*
* @returns The index of the separator character, or -1 if there is no separator.
*/
static findNetworkRuleSeparatorIndex(rule) {
// As we are looking for the last separator, we start from the end of the string
for (let i = rule.length - 1; i >= 0; i -= 1) {
// If we find a potential separator, we should check
// - if it's not escaped
// - if it's not followed by a regex marker, for example: `example.org^$removeparam=/regex$/`
// eslint-disable-next-line max-len
if (rule[i] === _utils_constants_js__rspack_import_3/* .NETWORK_RULE_SEPARATOR */.Xj && rule[i + 1] !== _utils_constants_js__rspack_import_3/* .REGEX_MARKER */.Vb && rule[i - 1] !== _utils_constants_js__rspack_import_3/* .ESCAPE_CHARACTER */.Kx) {
return i;
}
}
return -1;
}
}
},
64626(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
n: () => (defaultParserOptions)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Common options for all parsers.
*/
/**
* Default parser options.
*/
const defaultParserOptions = Object.freeze({
tolerant: false,
isLocIncluded: true,
parseAbpSpecificRules: true,
parseUboSpecificRules: true,
includeRaws: true,
ignoreComments: false,
parseHostRules: false,
parseHtmlFilteringRuleBodies: false,
});
},
53550(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
G: () => (/* binding */ RuleParser)
});
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/errors/adblock-syntax-error.js
var adblock_syntax_error = __webpack_require__(10631);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/nodes/index.js
var nodes = __webpack_require__(79864);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/adblockers.js
var adblockers = __webpack_require__(22380);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/base-parser.js
var base_parser = __webpack_require__(79963);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/comment/comment-parser.js + 9 modules
var comment_parser = __webpack_require__(83102);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/cosmetic/cosmetic-rule-parser.js + 6 modules
var cosmetic_rule_parser = __webpack_require__(36573);
// EXTERNAL MODULE: ./node_modules/.pnpm/is-ip@3.1.0/node_modules/is-ip/index.js
var is_ip = __webpack_require__(4371);
// EXTERNAL MODULE: ./node_modules/.pnpm/tldts@5.7.112/node_modules/tldts/dist/es6/index.js + 12 modules
var es6 = __webpack_require__(86136);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/utils/string.js
var string = __webpack_require__(16875);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/misc/value-parser.js
var value_parser = __webpack_require__(29090);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/options.js
var parser_options = __webpack_require__(64626);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/network/host-rule-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-param-reassign */
/**
* `HostRuleParser` is responsible for parsing hosts-like rules.
*
* HostRule is a structure for simple host-level rules (i.e. /etc/hosts syntax).
* It also supports "just domain" syntax. In this case, the IP will be set to 0.0.0.0.
*
* Rules syntax looks like this:.
* ```text
* IP_address canonical_hostname [aliases...]
* ```
*
* @see {@link http://man7.org/linux/man-pages/man5/hosts.5.html}
*
* @example
* `192.168.1.13 bar.mydomain.org bar` -- ipv4
* `ff02::1 ip6-allnodes` -- ipv6
* `::1 localhost ip6-localhost ip6-loopback` -- ipv6 aliases
* `example.org` -- "just domain" syntax
*/
class HostRuleParser extends base_parser/* .BaseParser */.V {
/**
* Default IP address for host rules without explicit IP.
*/
static NULL_IP = '0.0.0.0';
/**
* Comment marker character.
*/
static COMMENT_MARKER = '#';
/**
* Parses an etc/hosts-like rule.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Host rule node.
*
* @throws If the input contains invalid data.
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
let offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, 0);
const parts = [];
let lastPartStartIndex = offset;
let comment = null;
const rawLength = raw.length;
const parsePartIfNeeded = (startIndex, endIndex) => {
if (startIndex < endIndex) {
parts.push(value_parser/* .ValueParser.parse */.J.parse(raw.slice(startIndex, endIndex), options, baseOffset + startIndex));
}
};
while (offset < rawLength) {
if (string/* .StringUtils.isWhitespace */.$x.isWhitespace(raw[offset])) {
parsePartIfNeeded(lastPartStartIndex, offset);
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset);
lastPartStartIndex = offset;
}
else if (raw[offset] === HostRuleParser.COMMENT_MARKER) {
const commentStart = offset;
offset = string/* .StringUtils.skipWS */.$x.skipWS(raw, offset + 1);
comment = value_parser/* .ValueParser.parse */.J.parse(raw.slice(offset), options, baseOffset + commentStart);
offset = rawLength;
lastPartStartIndex = offset;
}
else {
offset += 1;
}
}
parsePartIfNeeded(lastPartStartIndex, offset);
const partsLength = parts.length;
if (partsLength < 1) {
throw new Error('Host rule must have at least one domain name or an IP address and a domain name');
}
const result = {
category: nodes/* .RuleCategory.Network */.$O.Network,
type: nodes/* .NetworkRuleType.HostRule */.vY.HostRule,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
};
if (partsLength === 1) {
// "Just domain" syntax, e.g. `example.org`
// In this case, domain should be valid and IP will be set to 0.0.0.0 by default
if ((0,es6/* .getDomain */.FB)(parts[0].value) !== parts[0].value) {
throw new Error(`Not a valid domain: ${parts[0].value}`);
}
result.ip = {
type: 'Value',
value: HostRuleParser.NULL_IP,
};
result.hostnames = {
type: 'HostnameList',
children: parts,
};
}
else if (partsLength > 1) {
// IP + domain list syntax
const [ip, ...hostnames] = parts;
if (!is_ip(ip.value)) {
throw new Error(`Invalid IP address: ${ip.value}`);
}
for (const { value } of hostnames) {
if ((0,es6/* .getHostname */.EW)(value) !== value) {
throw new Error(`Not a valid hostname: ${value}`);
}
}
result.ip = ip;
result.hostnames = {
type: 'HostnameList',
children: hostnames,
};
}
if (comment) {
result.comment = comment;
}
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
return result;
}
}
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/network/network-rule-parser.js
var network_rule_parser = __webpack_require__(72192);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+agtree@4.2.1/node_modules/@adguard/agtree/dist/parser/rule-parser.js
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/* eslint-disable no-param-reassign */
/**
* `RuleParser` is responsible for parsing the rules.
*
* It automatically determines the category and syntax of the rule, so you can pass any kind of rule to it.
*/
class RuleParser extends base_parser/* .BaseParser */.V {
/**
* Helper method to parse host rules if the `parseHostRules` option is enabled, otherwise it will
* parse network rules.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Host rule or network rule node.
*/
static parseHostOrNetworkRule(raw, options, baseOffset) {
if (options.parseHostRules) {
try {
return HostRuleParser.parse(raw, options, baseOffset);
}
catch (error) {
// Ignore the error, and fall back to network rule parser
}
}
return network_rule_parser/* .NetworkRuleParser.parse */.i.parse(raw, options, baseOffset);
}
/**
* Parse an adblock rule. You can pass any kind of rule to this method, since it will automatically determine
* the category and syntax. If the rule is syntactically invalid, then an error will be thrown. If the
* syntax / compatibility cannot be determined clearly, then the value of the `syntax` property will be
* `Common`.
*
* For example, let's have this network rule:
* ```adblock
* ||example.org^$important
* ```
* The `syntax` property will be `Common`, since the rule is syntactically correct in every adblockers, but we
* cannot determine at parsing level whether `important` is an existing option or not, nor if it exists, then
* which adblocker supports it. This is why the `syntax` property is simply `Common` at this point.
* The concrete COMPATIBILITY of the rule will be determined later, in a different, higher-level layer, called
* "Compatibility table".
*
* But we can determinate the concrete syntax of this rule:
* ```adblock
* example.org#%#//scriptlet("scriptlet0", "arg0")
* ```
* since it is clearly an AdGuard-specific rule and no other adblockers uses this syntax natively. However, we also
* cannot determine the COMPATIBILITY of this rule, as it is not clear at this point whether the `scriptlet0`
* scriptlet is supported by AdGuard or not. This is also the task of the "Compatibility table". Here, we simply
* mark the rule with the `AdGuard` syntax in this case.
*
* @param raw Raw input to parse.
* @param options Global parser options.
* @param baseOffset Starting offset of the input. Node locations are calculated relative to this offset.
*
* @returns Adblock rule node.
*
* @throws If the input matches a pattern but syntactically invalid.
*
* @example
* Take a look at the following example:
* ```js
* // Parse a network rule
* const ast1 = RuleParser.parse("||example.org^$important");
*
* // Parse another network rule
* const ast2 = RuleParser.parse("/ads.js^$important,third-party,domain=example.org|~example.com");
*
* // Parse a cosmetic rule
* const ast2 = RuleParser.parse("example.org##.banner");
*
* // Parse another cosmetic rule
* const ast3 = RuleParser.parse("example.org#?#.banner:-abp-has(.ad)");
*
* // Parse a comment rule
* const ast4 = RuleParser.parse("! Comment");
*
* // Parse an empty rule
* const ast5 = RuleParser.parse("");
*
* // Parse a comment rule (with metadata)
* const ast6 = RuleParser.parse("! Title: Example");
*
* // Parse a pre-processor rule
* const ast7 = RuleParser.parse("!#if (adguard)");
* ```
*/
static parse(raw, options = parser_options/* .defaultParserOptions */.n, baseOffset = 0) {
try {
// Empty lines / rules (handle it just for convenience)
if (raw.trim().length === 0) {
const result = {
type: 'EmptyRule',
category: nodes/* .RuleCategory.Empty */.$O.Empty,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
// Try to parse the rule with all sub-parsers. If a rule doesn't match
// the pattern of a parser, then it will return `null`. For example, a
// network rule will not match the pattern of a comment rule, since it
// doesn't start with comment marker. But if the rule matches the
// pattern of a parser, then it will return the AST of the rule, or
// throw an error if the rule is syntactically invalid.
if (options.ignoreComments) {
if (comment_parser/* .CommentParser.isCommentRule */.B.isCommentRule(raw)) {
const result = {
type: 'EmptyRule',
category: nodes/* .RuleCategory.Empty */.$O.Empty,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
return cosmetic_rule_parser/* .CosmeticRuleParser.parse */.R.parse(raw, options, baseOffset)
|| RuleParser.parseHostOrNetworkRule(raw, options, baseOffset);
}
return comment_parser/* .CommentParser.parse */.B.parse(raw, options, baseOffset)
|| cosmetic_rule_parser/* .CosmeticRuleParser.parse */.R.parse(raw, options, baseOffset)
|| RuleParser.parseHostOrNetworkRule(raw, options, baseOffset);
}
catch (error) {
// If tolerant mode is disabled or the error is not known, then simply
// re-throw the error
if (!options.tolerant || !(error instanceof Error)) {
throw error;
}
// If tolerant mode is enabled and we have an onParseError callback,
// call it for any error instances
if (options.onParseError) {
options.onParseError(error);
}
const errorNode = {
type: 'InvalidRuleError',
name: error.name,
message: error.message,
};
// If the error is an AdblockSyntaxError, then we can add the
// location of the error to the result
if (error instanceof adblock_syntax_error/* .AdblockSyntaxError */.q) {
errorNode.start = error.start;
errorNode.end = error.end;
}
// Otherwise, return an invalid rule (tolerant mode)
const result = {
type: 'InvalidRule',
category: nodes/* .RuleCategory.Invalid */.$O.Invalid,
syntax: adblockers/* .AdblockSyntax.Common */.YG.Common,
raw,
error: errorNode,
};
if (options.includeRaws) {
result.raws = {
text: raw,
};
}
if (options.isLocIncluded) {
result.start = baseOffset;
result.end = baseOffset + raw.length;
}
return result;
}
}
}
},
22380(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
C6: () => (AdblockProduct),
YG: () => (AdblockSyntax)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Possible adblock syntaxes are listed here.
*/
/**
* Adblock products (specific adblockers, excludes 'Common').
*/
const AdblockProduct = {
/**
* Adblock Plus.
*
* @see {@link https://adblockplus.org/}
*/
Abp: 'AdblockPlus',
/**
* UBlock Origin..
*
* @see {@link https://github.com/gorhill/uBlock}
*/
Ubo: 'UblockOrigin',
/**
* AdGuard.
*
* @see {@link https://adguard.com/}
*/
Adg: 'AdGuard',
};
/**
* Possible adblock syntaxes (supported by this library).
*/
const AdblockSyntax = {
/**
* Common syntax, which is supported by more than one adblocker (or by all adblockers).
*
* We typically use this syntax when we cannot determine the concrete syntax of the rule,
* because the syntax is used by more than one adblocker natively.
*
* @example
* - `||example.org^$important` is a common syntax, since it is used by all adblockers natively, and
* we cannot determine at parsing level whether `important` is a valid option or not, and if it is valid,
* then which adblocker supports it.
*/
Common: 'Common',
/**
* Adblock Plus syntax.
*
* @see {@link https://adblockplus.org/}
*
* @example
* - `example.org#$#abort-on-property-read alert` is an Adblock Plus syntax, since it is not used by any other
* adblockers directly (probably supported by some on-the-fly conversion, but this is not the native syntax).
*/
Abp: AdblockProduct.Abp,
/**
* UBlock Origin syntax..
*
* @see {@link https://github.com/gorhill/uBlock}
*
* @example
* - `example.com##+js(set, atob, noopFunc)` is an uBlock Origin syntax, since it is not used by any other
* adblockers directly (probably supported by some on-the-fly conversion, but this is not the native syntax).
*/
Ubo: AdblockProduct.Ubo,
/**
* AdGuard syntax.
*
* @see {@link https://adguard.com/}
*
* @example
* - `example.org#%#//scriptlet("abort-on-property-read", "alert")` is an AdGuard syntax, since it is not used
* by any other adblockers directly (probably supported by some on-the-fly conversion, but this is not the native
* syntax).
*/
Adg: AdblockProduct.Adg,
};
/**
* Map of adblock products to their human-readable names.
*/
const PRODUCT_HUMAN_READABLE_NAME_MAP = new Map([
[AdblockProduct.Abp, 'AdBlock / Adblock Plus'],
[AdblockProduct.Ubo, 'uBlock Origin'],
[AdblockProduct.Adg, 'AdGuard'],
]);
/**
* Returns the human-readable name for the given adblock product.
*
* @param product Adblock product.
*
* @returns Human-readable product name, e.g., 'Adblock Plus', 'uBlock Origin', 'AdGuard'.
*
* @throws Error if the product is unknown.
*
* @example
* ```typescript
* getHumanReadableProductName(AdblockProduct.Abp); // 'Adblock Plus'
* getHumanReadableProductName(AdblockProduct.Ubo); // 'uBlock Origin'
* getHumanReadableProductName(AdblockProduct.Adg); // 'AdGuard'
* ```
*/
const getHumanReadableProductName = (product) => {
const name = PRODUCT_HUMAN_READABLE_NAME_MAP.get(product);
if (!name) {
throw new Error(`Unknown product: ${product}`);
}
return name;
};
},
53097(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
A1: () => (CLOSE_SQUARE_BRACKET),
AT: () => (SMALL_LETTER_Z),
Ae: () => (CSS_MEDIA_MARKER),
BH: () => (AGLINT_COMMAND_PREFIX),
BR: () => (HINT_MARKER_LEN),
Bt: () => (UBO_RESPONSEHEADER_FN),
C: () => (HASHMARK),
CR: () => (CR),
Cx: () => (OPEN_PARENTHESIS),
Ec: () => (EXCLAMATION_MARK),
Ez: () => (AGLINT_CONFIG_COMMENT_MARKER),
FF: () => (FF),
H3: () => (SMALL_LETTER_A),
I6: () => (UBO_MATCHES_PATH_OPERATOR),
I8: () => (SEMICOLON),
IF: () => (IF),
JD: () => (ADG_PATH_MODIFIER),
KE: () => (COMMA),
KT: () => (CRLF),
Kx: () => (ESCAPE_CHARACTER),
L5: () => (PIPE),
LF: () => (LF),
Lb: () => (NETWORK_RULE_EXCEPTION_MARKER_LEN),
Ln: () => (ASTERISK),
NW: () => (ADG_DOMAINS_MODIFIER),
Nb: () => (QUESTION_MARK),
PD: () => (PREPROCESSOR_MARKER),
Pe: () => (ADG_APP_MODIFIER),
Rq: () => (UBO_SCRIPTLET_MASK),
UT: () => (EQUALS),
Vb: () => (REGEX_MARKER),
Vs: () => (UBO_SCRIPTLET_MASK_LEGACY),
Vw: () => (ADG_URL_MODIFIER),
Xj: () => (NETWORK_RULE_SEPARATOR),
_h: () => (UBO_HTML_MASK),
b9: () => (MODIFIERS_SEPARATOR),
bP: () => (NEGATION_MARKER),
bs: () => (WILDCARD),
cP: () => (CARET),
cU: () => (OPEN_SQUARE_BRACKET),
e0: () => (AMPERSAND),
fB: () => (UNDERSCORE),
fW: () => (PIPE_MODIFIER_SEPARATOR),
fi: () => (DOUBLE_QUOTE),
g9: () => (NUMBER_9),
hk: () => (CAPITAL_LETTER_Z),
j6: () => (HINT_MARKER),
li: () => (MODIFIER_ASSIGN_OPERATOR),
nC: () => (NUMBER_0),
nj: () => (DOLLAR_SIGN),
nx: () => (PREPROCESSOR_MARKER_LEN),
o: () => (SLASH),
oH: () => (COLON),
oo: () => (COMMA_DOMAIN_LIST_SEPARATOR),
ot: () => (CAPITAL_LETTER_A),
pi: () => (CSS_BLOCK_CLOSE),
rF: () => (NETWORK_RULE_EXCEPTION_MARKER),
rM: () => (INCLUDE),
r_: () => (BACKSLASH),
s1: () => (CLOSE_PARENTHESIS),
sA: () => (PREPROCESSOR_SEPARATOR),
sV: () => (OPEN_CURLY_BRACKET),
t6: () => (SPACE),
ur: () => (SINGLE_QUOTE),
us: () => (SAFARI_CB_AFFINITY),
uu: () => (PLUS),
vr: () => (CSS_NOT_PSEUDO),
vz: () => (GREATER_THAN),
w1: () => (BACKTICK_QUOTE),
wH: () => (AT_SIGN),
wR: () => (TILDE),
wU: () => (CLOSE_CURLY_BRACKET),
wg: () => (EMPTY),
wn: () => (TAB),
x$: () => (ADG_SCRIPTLET_MASK),
y0: () => (DOT),
zW: () => (CSS_BLOCK_OPEN)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Constant values used by all parts of the library.
*/
// TODO: remove unused constants
// General
/**
* Empty string.
*/
const EMPTY = '';
const SPACE = ' ';
const TAB = '\t';
const COLON = ':';
const COMMA = ',';
const DOT = '.';
const SEMICOLON = ';';
const AMPERSAND = '&';
const ASTERISK = '*';
const AT_SIGN = '@';
const CARET = '^';
const DOLLAR_SIGN = '$';
const EQUALS = '=';
const EXCLAMATION_MARK = '!';
const GREATER_THAN = '>';
const HASHMARK = '#';
const PIPE = '|';
const PLUS = '+';
const QUESTION_MARK = '?';
const SLASH = '/';
const TILDE = '~';
const UNDERSCORE = '_';
// Escape characters
const BACKSLASH = '\\';
const ESCAPE_CHARACTER = BACKSLASH;
// Newlines
const CR = '\r';
const FF = '\f';
const LF = '\n';
const CRLF = CR + LF;
const NEWLINE = (/* unused pure expression or super */ null && (LF));
// Quotes
const BACKTICK_QUOTE = '`';
const DOUBLE_QUOTE = '"';
const SINGLE_QUOTE = '\'';
// Brackets
const OPEN_PARENTHESIS = '(';
const CLOSE_PARENTHESIS = ')';
const OPEN_SQUARE_BRACKET = '[';
const CLOSE_SQUARE_BRACKET = ']';
const OPEN_CURLY_BRACKET = '{';
const CLOSE_CURLY_BRACKET = '}';
// Letters
const SMALL_LETTER_A = 'a';
const SMALL_LETTER_B = 'b';
const SMALL_LETTER_C = 'c';
const SMALL_LETTER_D = 'd';
const SMALL_LETTER_E = 'e';
const SMALL_LETTER_F = 'f';
const SMALL_LETTER_G = 'g';
const SMALL_LETTER_H = 'h';
const SMALL_LETTER_I = 'i';
const SMALL_LETTER_J = 'j';
const SMALL_LETTER_K = 'k';
const SMALL_LETTER_L = 'l';
const SMALL_LETTER_M = 'm';
const SMALL_LETTER_N = 'n';
const SMALL_LETTER_O = 'o';
const SMALL_LETTER_P = 'p';
const SMALL_LETTER_Q = 'q';
const SMALL_LETTER_R = 'r';
const SMALL_LETTER_S = 's';
const SMALL_LETTER_T = 't';
const SMALL_LETTER_U = 'u';
const SMALL_LETTER_V = 'v';
const SMALL_LETTER_W = 'w';
const SMALL_LETTER_X = 'x';
const SMALL_LETTER_Y = 'y';
const SMALL_LETTER_Z = 'z';
/**
* Set of all small letters.
*/
const SMALL_LETTERS = new Set([
SMALL_LETTER_A,
SMALL_LETTER_B,
SMALL_LETTER_C,
SMALL_LETTER_D,
SMALL_LETTER_E,
SMALL_LETTER_F,
SMALL_LETTER_G,
SMALL_LETTER_H,
SMALL_LETTER_I,
SMALL_LETTER_J,
SMALL_LETTER_K,
SMALL_LETTER_L,
SMALL_LETTER_M,
SMALL_LETTER_N,
SMALL_LETTER_O,
SMALL_LETTER_P,
SMALL_LETTER_Q,
SMALL_LETTER_R,
SMALL_LETTER_S,
SMALL_LETTER_T,
SMALL_LETTER_U,
SMALL_LETTER_V,
SMALL_LETTER_W,
SMALL_LETTER_X,
SMALL_LETTER_Y,
SMALL_LETTER_Z,
]);
// Capital letters
const CAPITAL_LETTER_A = 'A';
const CAPITAL_LETTER_B = 'B';
const CAPITAL_LETTER_C = 'C';
const CAPITAL_LETTER_D = 'D';
const CAPITAL_LETTER_E = 'E';
const CAPITAL_LETTER_F = 'F';
const CAPITAL_LETTER_G = 'G';
const CAPITAL_LETTER_H = 'H';
const CAPITAL_LETTER_I = 'I';
const CAPITAL_LETTER_J = 'J';
const CAPITAL_LETTER_K = 'K';
const CAPITAL_LETTER_L = 'L';
const CAPITAL_LETTER_M = 'M';
const CAPITAL_LETTER_N = 'N';
const CAPITAL_LETTER_O = 'O';
const CAPITAL_LETTER_P = 'P';
const CAPITAL_LETTER_Q = 'Q';
const CAPITAL_LETTER_R = 'R';
const CAPITAL_LETTER_S = 'S';
const CAPITAL_LETTER_T = 'T';
const CAPITAL_LETTER_U = 'U';
const CAPITAL_LETTER_V = 'V';
const CAPITAL_LETTER_W = 'W';
const CAPITAL_LETTER_X = 'X';
const CAPITAL_LETTER_Y = 'Y';
const CAPITAL_LETTER_Z = 'Z';
/**
* Set of all capital letters.
*/
const CAPITAL_LETTERS = new Set([
CAPITAL_LETTER_A,
CAPITAL_LETTER_B,
CAPITAL_LETTER_C,
CAPITAL_LETTER_D,
CAPITAL_LETTER_E,
CAPITAL_LETTER_F,
CAPITAL_LETTER_G,
CAPITAL_LETTER_H,
CAPITAL_LETTER_I,
CAPITAL_LETTER_J,
CAPITAL_LETTER_K,
CAPITAL_LETTER_L,
CAPITAL_LETTER_M,
CAPITAL_LETTER_N,
CAPITAL_LETTER_O,
CAPITAL_LETTER_P,
CAPITAL_LETTER_Q,
CAPITAL_LETTER_R,
CAPITAL_LETTER_S,
CAPITAL_LETTER_T,
CAPITAL_LETTER_U,
CAPITAL_LETTER_V,
CAPITAL_LETTER_W,
CAPITAL_LETTER_X,
CAPITAL_LETTER_Y,
CAPITAL_LETTER_Z,
]);
// Numbers as strings
const NUMBER_0 = '0';
const NUMBER_1 = '1';
const NUMBER_2 = '2';
const NUMBER_3 = '3';
const NUMBER_4 = '4';
const NUMBER_5 = '5';
const NUMBER_6 = '6';
const NUMBER_7 = '7';
const NUMBER_8 = '8';
const NUMBER_9 = '9';
/**
* Set of all numbers as strings.
*/
const NUMBERS = new Set([
NUMBER_0,
NUMBER_1,
NUMBER_2,
NUMBER_3,
NUMBER_4,
NUMBER_5,
NUMBER_6,
NUMBER_7,
NUMBER_8,
NUMBER_9,
]);
const REGEX_MARKER = '/';
const ADG_SCRIPTLET_MASK = '//scriptlet';
const UBO_SCRIPTLET_MASK = '+js';
const UBO_SCRIPTLET_MASK_LEGACY = 'script:inject';
const UBO_HTML_MASK = '^';
const UBO_MATCHES_PATH_OPERATOR = 'matches-path';
const UBO_RESPONSEHEADER_FN = 'responseheader';
const ADG_PATH_MODIFIER = 'path';
const ADG_DOMAINS_MODIFIER = 'domain';
const ADG_APP_MODIFIER = 'app';
const ADG_URL_MODIFIER = 'url';
// Modifiers are separated by ",". For example: "script,domain=example.com"
const MODIFIERS_SEPARATOR = ',';
const MODIFIER_ASSIGN_OPERATOR = '=';
const NEGATION_MARKER = '~';
/**
* The wildcard symbol — `*`.
*/
const WILDCARD = ASTERISK;
/**
* Classic domain separator.
*
* @example
* ```adblock
* ! Domains are separated by ",":
* example.com,~example.org##.ads
* ```
*/
const COMMA_DOMAIN_LIST_SEPARATOR = ',';
/**
* Modifier separator for $app, $denyallow, $domain, $method.
*
* @example
* ```adblock
* ! Domains are separated by "|":
* ads.js^$script,domains=example.com|~example.org
* ```
*/
const PIPE_MODIFIER_SEPARATOR = '|';
const CSS_MEDIA_MARKER = '@media';
const CSS_NOT_PSEUDO = 'not';
const CSS_BLOCK_OPEN = '{';
const CSS_BLOCK_CLOSE = '}';
const HINT_MARKER = '!+';
const HINT_MARKER_LEN = HINT_MARKER.length;
const NETWORK_RULE_EXCEPTION_MARKER = '@@';
const NETWORK_RULE_EXCEPTION_MARKER_LEN = NETWORK_RULE_EXCEPTION_MARKER.length;
const NETWORK_RULE_SEPARATOR = '$';
const AGLINT_COMMAND_PREFIX = 'aglint';
const AGLINT_CONFIG_COMMENT_MARKER = '--';
const PREPROCESSOR_MARKER = '!#';
const PREPROCESSOR_MARKER_LEN = PREPROCESSOR_MARKER.length;
const PREPROCESSOR_SEPARATOR = ' ';
const SAFARI_CB_AFFINITY = 'safari_cb_affinity';
const IF = 'if';
const INCLUDE = 'include';
},
77342(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
m: () => (CosmeticRuleSeparatorUtils)
});
/* import */ var _nodes_index_js__rspack_import_1 = __webpack_require__(79864);
/* import */ var _constants_js__rspack_import_0 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Cosmetic rule separator finder and categorizer.
*/
/**
* Utility class for cosmetic rule separators.
*/
class CosmeticRuleSeparatorUtils {
/**
* Checks whether the specified separator is an exception.
*
* @param separator Separator to check.
*
* @returns `true` if the separator is an exception, `false` otherwise.
*/
static isException(separator) {
// Simply check the second character
return separator[1] === _constants_js__rspack_import_0/* .AT_SIGN */.wH;
}
/**
* Checks whether the specified separator is marks an Extended CSS cosmetic rule.
*
* @param separator Separator to check.
*
* @returns `true` if the separator is marks an Extended CSS cosmetic rule, `false` otherwise.
*/
static isExtendedCssMarker(separator) {
return (separator === _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ExtendedElementHiding */.p5.ExtendedElementHiding
|| separator === _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ExtendedElementHidingException */.p5.ExtendedElementHidingException
|| separator === _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgExtendedCssInjection */.p5.AdgExtendedCssInjection
|| separator === _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgExtendedCssInjectionException */.p5.AdgExtendedCssInjectionException);
}
/**
* Looks for the cosmetic rule separator in the rule. This is a simplified version that
* masks the recursive function.
*
* @param rule Raw rule.
*
* @returns Separator result or null if no separator was found.
*/
static find(rule) {
/**
* Helper function to create results of the `find` method.
*
* @param start Start position.
* @param separator Separator type.
*
* @returns Cosmetic rule separator node.
*/
// eslint-disable-next-line max-len
function createResult(start, separator) {
return {
separator,
start,
end: start + separator.length,
};
}
for (let i = 0; i < rule.length; i += 1) {
if (rule[i] === '#') {
if (rule[i + 1] === '#' && rule[i - 1] !== _constants_js__rspack_import_0/* .SPACE */.t6) {
// ##
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ElementHiding */.p5.ElementHiding);
}
if (rule[i + 1] === '?' && rule[i + 2] === '#') {
// #?#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ExtendedElementHiding */.p5.ExtendedElementHiding);
}
if (rule[i + 1] === '%' && rule[i + 2] === '#') {
// #%#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgJsInjection */.p5.AdgJsInjection);
}
if (rule[i + 1] === '$') {
if (rule[i + 2] === '#') {
// #$#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgCssInjection */.p5.AdgCssInjection);
}
if (rule[i + 2] === '?' && rule[i + 3] === '#') {
// #$?#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgExtendedCssInjection */.p5.AdgExtendedCssInjection);
}
}
// Exceptions
if (rule[i + 1] === '@') {
if (rule[i + 2] === '#' && rule[i - 1] !== _constants_js__rspack_import_0/* .SPACE */.t6) {
// #@#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ElementHidingException */.p5.ElementHidingException);
}
if (rule[i + 2] === '?' && rule[i + 3] === '#') {
// #@?#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.ExtendedElementHidingException */.p5.ExtendedElementHidingException);
}
if (rule[i + 2] === '%' && rule[i + 3] === '#') {
// #@%#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgJsInjectionException */.p5.AdgJsInjectionException);
}
if (rule[i + 2] === '$') {
if (rule[i + 3] === '#') {
// #@$#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgCssInjectionException */.p5.AdgCssInjectionException);
}
if (rule[i + 3] === '?' && rule[i + 4] === '#') {
// #@$?#
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgExtendedCssInjectionException */.p5.AdgExtendedCssInjectionException);
}
}
}
}
if (rule[i] === '$') {
if (rule[i + 1] === '$') {
// $$
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgHtmlFiltering */.p5.AdgHtmlFiltering);
}
if (rule[i + 1] === '@' && rule[i + 2] === '$') {
// $@$
return createResult(i, _nodes_index_js__rspack_import_1/* .CosmeticRuleSeparator.AdgHtmlFilteringException */.p5.AdgHtmlFilteringException);
}
}
}
return null;
}
}
},
41666(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
o: () => (deepFreeze)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Simple deep freeze implementation.
* It freezes the object and all its properties recursively.
*
* @template T Type of the object to freeze.
*
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze#deep_freezing}
*
* @param object Object to freeze.
*
* @returns Frozen object.
*/
const deepFreeze = (object) => {
// Retrieve the property names defined on object
const propNames = Reflect.ownKeys(object);
// Freeze properties before freezing self
for (const name of propNames) {
const value = object[name];
if ((value && typeof value === 'object') || typeof value === 'function') {
deepFreeze(value);
}
}
return Object.freeze(object);
};
},
89934(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Aw: () => (DomainUtils)
});
/* import */ var tldts__rspack_import_0 = __webpack_require__(86136);
/* import */ var _constants_js__rspack_import_1 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for domain and hostname validation.
*/
/**
* Marker for a wildcard top-level domain — `.*`.
*
* @example
* `example.*` — matches with any TLD, e.g. `example.org`, `example.com`, etc.
*/
const WILDCARD_TLD = _constants_js__rspack_import_1/* .DOT */.y0 + _constants_js__rspack_import_1/* .WILDCARD */.bs;
/**
* Marker for a wildcard subdomain — `*.`.
*
* @example
* `*.example.org` — matches with any subdomain, e.g. `foo.example.org` or `bar.example.org`
*/
const WILDCARD_SUBDOMAIN = _constants_js__rspack_import_1/* .WILDCARD */.bs + _constants_js__rspack_import_1/* .DOT */.y0;
/**
* Utility functions for domain and hostname validation.
*/
class DomainUtils {
/**
* Check if the input is a valid domain or hostname.
*
* @param domain Domain to check.
*
* @returns `true` if the domain is valid, `false` otherwise.
*/
static isValidDomainOrHostname(domain) {
let domainToCheck = domain;
// Wildcard-only domain, typically a generic rule
if (domainToCheck === _constants_js__rspack_import_1/* .WILDCARD */.bs) {
return true;
}
// https://adguard.com/kb/general/ad-filtering/create-own-filters/#wildcard-for-tld
if (domainToCheck.endsWith(WILDCARD_TLD)) {
// Remove the wildcard TLD
domainToCheck = domainToCheck.substring(0, domainToCheck.length - WILDCARD_TLD.length);
}
if (domainToCheck.startsWith(WILDCARD_SUBDOMAIN)) {
// Remove the wildcard subdomain
domainToCheck = domainToCheck.substring(WILDCARD_SUBDOMAIN.length);
}
// Parse the domain with tldts
const tldtsResult = (0,tldts__rspack_import_0/* .parse */.qg)(domainToCheck);
// Check if the domain is valid
return domainToCheck === tldtsResult.domain || domainToCheck === tldtsResult.hostname;
}
}
},
68999(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Qj: () => (QuoteUtils),
XA: () => (QuoteType),
iO: () => (QUOTE_SET)
});
/* import */ var _constants_js__rspack_import_0 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for working with quotes.
*/
/**
* Set of all possible quote characters supported by the library.
*/
const QUOTE_SET = new Set([
_constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur,
_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi,
_constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1,
]);
/**
* Possible quote types for scriptlet parameters.
*/
const QuoteType = {
/**
* No quotes at all.
*/
None: 'none',
/**
* Single quotes (`'`).
*/
Single: 'single',
/**
* Double quotes (`"`).
*/
Double: 'double',
/**
* Backtick quotes (`` ` ``).
*/
Backtick: 'backtick',
};
/**
* Utility functions for working with quotes.
*/
class QuoteUtils {
/**
* Escape all unescaped occurrences of the character.
*
* @param string String to escape.
* @param char Character to escape.
*
* @returns Escaped string.
*/
static escapeUnescapedOccurrences(string, char) {
let result = _constants_js__rspack_import_0/* .EMPTY */.wg;
for (let i = 0; i < string.length; i += 1) {
if (string[i] === char && (i === 0 || string[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx)) {
result += _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx;
}
result += string[i];
}
return result;
}
/**
* Unescape all single escaped occurrences of the character.
*
* @param string String to unescape.
* @param char Character to unescape.
*
* @returns Unescaped string.
*/
static unescapeSingleEscapedOccurrences(string, char) {
let result = _constants_js__rspack_import_0/* .EMPTY */.wg;
for (let i = 0; i < string.length; i += 1) {
if (string[i] === char
&& string[i - 1] === _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx
&& (i === 1 || string[i - 2] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx)) {
result = result.slice(0, -1);
}
result += string[i];
}
return result;
}
/**
* Get quote type of the string.
*
* @param string String to check.
*
* @returns Quote type of the string.
*/
static getStringQuoteType(string) {
// Don't check 1-character strings to avoid false positives
if (string.length > 1) {
if (string.startsWith(_constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur) && string.endsWith(_constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur)) {
return QuoteType.Single;
}
if (string.startsWith(_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) && string.endsWith(_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi)) {
return QuoteType.Double;
}
if (string.startsWith(_constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1) && string.endsWith(_constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1)) {
return QuoteType.Backtick;
}
}
return QuoteType.None;
}
/**
* Set quote type of the string.
*
* @param string String to set quote type of.
* @param quoteType Quote type to set.
*
* @returns String with the specified quote type.
*/
static setStringQuoteType(string, quoteType) {
const actualQuoteType = QuoteUtils.getStringQuoteType(string);
switch (quoteType) {
case QuoteType.None:
if (actualQuoteType === QuoteType.Single) {
return QuoteUtils.escapeUnescapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur);
}
if (actualQuoteType === QuoteType.Double) {
return QuoteUtils.escapeUnescapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi);
}
if (actualQuoteType === QuoteType.Backtick) {
return QuoteUtils.escapeUnescapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1);
}
return string;
case QuoteType.Single:
if (actualQuoteType === QuoteType.None) {
return _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur + QuoteUtils.escapeUnescapedOccurrences(string, _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur) + _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur;
}
if (actualQuoteType === QuoteType.Double) {
return _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur
+ QuoteUtils.escapeUnescapedOccurrences(QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur) + _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur;
}
if (actualQuoteType === QuoteType.Backtick) {
return _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur
+ QuoteUtils.escapeUnescapedOccurrences(QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur) + _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur;
}
return string;
case QuoteType.Double:
if (actualQuoteType === QuoteType.None) {
return _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi + QuoteUtils.escapeUnescapedOccurrences(string, _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) + _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi;
}
if (actualQuoteType !== QuoteType.Double) {
// eslint-disable-next-line max-len
return _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi
+ QuoteUtils.escapeUnescapedOccurrences(QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur), _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) + _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi;
}
return string;
case QuoteType.Backtick:
if (actualQuoteType === QuoteType.None) {
// eslint-disable-next-line max-len
return _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1 + QuoteUtils.escapeUnescapedOccurrences(string, _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1) + _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1;
}
if (actualQuoteType !== QuoteType.Backtick) {
// eslint-disable-next-line max-len
return _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1
+ QuoteUtils.escapeUnescapedOccurrences(QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur), _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1) + _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1;
}
return string;
default:
return string;
}
}
/**
* Removes bounding quotes from a string, if any.
*
* @param string Input string.
*
* @returns String without quotes.
*/
static removeQuotes(string) {
if (
// We should check for string length to avoid false positives
string.length > 1
&& (string[0] === _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur || string[0] === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi || string[0] === _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1)
&& string[0] === string[string.length - 1]) {
return string.slice(1, -1);
}
return string;
}
/**
* Removes bounding quotes from a string, if any, and unescapes the escaped quotes,
* like transforming `'abc\'def'` to `abc'def`.
*
* @param string Input string.
*
* @returns String without quotes.
*/
static removeQuotesAndUnescape(string) {
const quoteType = QuoteUtils.getStringQuoteType(string);
switch (quoteType) {
case QuoteType.Single:
return QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur);
case QuoteType.Double:
return QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi);
case QuoteType.Backtick:
return QuoteUtils.unescapeSingleEscapedOccurrences(string.slice(1, -1), _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1);
default:
return string;
}
}
/**
* Wraps given `strings` with `quote` (defaults to single quote `'`)
* and joins them with `separator` (defaults to comma+space `, `).
*
* @param strings Strings to quote and join.
* @param quoteType Quote to use.
* @param separator Separator to use.
*
* @returns String with joined items.
*
* @example
* ['abc', 'def']: strings[] -> "'abc', 'def'": string
*/
static quoteAndJoinStrings(strings, quoteType = QuoteType.Single, separator = `${_constants_js__rspack_import_0/* .COMMA */.KE}${_constants_js__rspack_import_0/* .SPACE */.t6}`) {
return strings
.map((s) => QuoteUtils.setStringQuoteType(s, quoteType))
.join(separator);
}
/**
* Convert `""` to `\"` within strings inside of attribute selectors,
* because it is not compatible with the standard CSS syntax.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#tag-content}
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#wildcard}
*
* @param selector CSS selector string.
*
* @returns Escaped CSS selector.
*
* @example
* ```ts
* QuoteUtils.escapeAttributeDoubleQuotes('[attr="value with "" quotes"]');
* QuoteUtils.escapeAttributeDoubleQuotes('div[attr="value with "" quotes"] > span');
* ```
*
* @note In the legacy syntax, `""` is used to escape double quotes, but it cannot be used
* in the standard CSS syntax, so we use conversion functions to handle this.
* @note This function is intended to be used on whole attribute selector or whole selector strings.
*/
static escapeAttributeDoubleQuotes(selector) {
const nestingBlockPairs = new Map([
[_constants_js__rspack_import_0/* .OPEN_PARENTHESIS */.Cx, _constants_js__rspack_import_0/* .CLOSE_PARENTHESIS */.s1],
[_constants_js__rspack_import_0/* .OPEN_SQUARE_BRACKET */.cU, _constants_js__rspack_import_0/* .CLOSE_SQUARE_BRACKET */.A1],
[_constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur, _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur],
[_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi, _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi],
[_constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1, _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1],
]);
const nestingBlockStack = [];
const buffer = [];
for (let i = 0; i < selector.length; i += 1) {
const char = selector[i];
// Check if we are inside of an attribute selector's value
if (
// nesting will be 2 levels deep if we are inside of attribute selector's value
nestingBlockStack.length === 2
// and the outer block is an attribute selector
&& nestingBlockStack[0] === _constants_js__rspack_import_0/* .CLOSE_SQUARE_BRACKET */.A1
// and the inner block is a double quote
&& nestingBlockStack[1] === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) {
// We found `""` inside of attribute selector's value
if (char === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi
&& selector[i + 1] === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) {
// Convert `""` to `\"`
buffer.push(_constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx);
buffer.push(_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi);
// Skip the next double quote
i += 1;
continue;
}
// Normal character inside of attribute selector's value
buffer.push(char);
continue;
}
// Handle entering nesting blocks
if (nestingBlockPairs.has(char)
&& selector[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
nestingBlockStack.push(nestingBlockPairs.get(char));
buffer.push(char);
continue;
}
// Handle exiting nesting blocks
if (nestingBlockStack.length > 0
&& char === nestingBlockStack[nestingBlockStack.length - 1]
&& selector[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
nestingBlockStack.pop();
buffer.push(char);
continue;
}
// Normal character
buffer.push(char);
}
return buffer.join(_constants_js__rspack_import_0/* .EMPTY */.wg);
}
/**
* Convert escaped double quotes `\"` to `""` within strings inside of attribute selectors,
* because it is not compatible with the standard CSS syntax.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#tag-content}
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#wildcard}
*
* @param selector CSS selector string.
*
* @returns Unescaped CSS selector.
*
* @example
* ```ts
* QuoteUtils.unescapeAttributeDoubleQuotes('[attr="value with \\" quotes"]');
* QuoteUtils.unescapeAttributeDoubleQuotes('div[attr="value with \\" quotes"] > span');
* ```
*
* @note In the legacy syntax, `""` is used to escape double quotes, but it cannot be used
* in the standard CSS syntax, so we use conversion functions to handle this.
* @note This function is intended to be used on whole attribute selector or whole selector strings.
*/
static unescapeAttributeDoubleQuotes(selector) {
const nestingBlockPairs = new Map([
[_constants_js__rspack_import_0/* .OPEN_PARENTHESIS */.Cx, _constants_js__rspack_import_0/* .CLOSE_PARENTHESIS */.s1],
[_constants_js__rspack_import_0/* .OPEN_SQUARE_BRACKET */.cU, _constants_js__rspack_import_0/* .CLOSE_SQUARE_BRACKET */.A1],
[_constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur, _constants_js__rspack_import_0/* .SINGLE_QUOTE */.ur],
[_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi, _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi],
[_constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1, _constants_js__rspack_import_0/* .BACKTICK_QUOTE */.w1],
]);
const nestingBlockStack = [];
const buffer = [];
for (let i = 0; i < selector.length; i += 1) {
const char = selector[i];
// Check if we are inside of an attribute selector's value
if (
// nesting will be 2 levels deep if we are inside of attribute selector's value
nestingBlockStack.length === 2
// and the outer block is an attribute selector
&& nestingBlockStack[0] === _constants_js__rspack_import_0/* .CLOSE_SQUARE_BRACKET */.A1
// and the inner block is a double quote
&& nestingBlockStack[1] === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) {
// We found `\"` inside of attribute selector's value
if (char === _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx
&& selector[i + 1] === _constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi) {
// Convert `\"` to `""`
buffer.push(_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi);
buffer.push(_constants_js__rspack_import_0/* .DOUBLE_QUOTE */.fi);
// Skip the next double quote
i += 1;
continue;
}
// Normal character inside of attribute selector's value
buffer.push(char);
continue;
}
// Handle entering nesting blocks
if (nestingBlockPairs.has(char)
&& selector[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
nestingBlockStack.push(nestingBlockPairs.get(char));
buffer.push(char);
continue;
}
// Handle exiting nesting blocks
if (nestingBlockStack.length > 0
&& char === nestingBlockStack[nestingBlockStack.length - 1]
&& selector[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
nestingBlockStack.pop();
buffer.push(char);
continue;
}
// Normal character
buffer.push(char);
}
return buffer.join(_constants_js__rspack_import_0/* .EMPTY */.wg);
}
}
},
64539(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Cg: () => (ADBLOCK_URL_START),
Fx: () => (ADBLOCK_URL_SEPARATOR),
Lp: () => (RegExpUtils)
});
/* import */ var glob_to_regexp__rspack_import_0 = __webpack_require__(68874);
/* import */ var _constants_js__rspack_import_1 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Regular expression utilities.
*/
// Special RegExp constants
const REGEX_START = _constants_js__rspack_import_1/* .CARET */.cP; // '^'
const REGEX_END = _constants_js__rspack_import_1/* .DOLLAR_SIGN */.nj; // '$'
const REGEX_ANY_CHARACTERS = _constants_js__rspack_import_1/* .DOT */.y0 + _constants_js__rspack_import_1/* .ASTERISK */.Ln; // '.*'
// Special adblock pattern symbols and their RegExp equivalents
const ADBLOCK_URL_START = _constants_js__rspack_import_1/* .PIPE */.L5 + _constants_js__rspack_import_1/* .PIPE */.L5; // '||'
const ADBLOCK_URL_START_REGEX = '^(http|https|ws|wss)://([a-z0-9-_.]+\\.)?';
const ADBLOCK_URL_SEPARATOR = _constants_js__rspack_import_1/* .CARET */.cP; // '^'
const ADBLOCK_URL_SEPARATOR_REGEX = '([^ a-zA-Z0-9.%_-]|$)';
const ADBLOCK_WILDCARD = _constants_js__rspack_import_1/* .ASTERISK */.Ln; // '*'
const ADBLOCK_WILDCARD_REGEX = REGEX_ANY_CHARACTERS;
// Negation wrapper for RegExp patterns
const REGEX_NEGATION_PREFIX = '^((?!';
const REGEX_NEGATION_SUFFIX = ').)*$';
/**
* Special RegExp symbols.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-escape
*/
const SPECIAL_REGEX_SYMBOLS = new Set([
_constants_js__rspack_import_1/* .ASTERISK */.Ln,
_constants_js__rspack_import_1/* .CARET */.cP,
_constants_js__rspack_import_1/* .CLOSE_CURLY_BRACKET */.wU,
_constants_js__rspack_import_1/* .CLOSE_PARENTHESIS */.s1,
_constants_js__rspack_import_1/* .CLOSE_SQUARE_BRACKET */.A1,
_constants_js__rspack_import_1/* .DOLLAR_SIGN */.nj,
_constants_js__rspack_import_1/* .DOT */.y0,
_constants_js__rspack_import_1/* .ESCAPE_CHARACTER */.Kx,
_constants_js__rspack_import_1/* .OPEN_CURLY_BRACKET */.sV,
_constants_js__rspack_import_1/* .OPEN_PARENTHESIS */.Cx,
_constants_js__rspack_import_1/* .OPEN_SQUARE_BRACKET */.cU,
_constants_js__rspack_import_1/* .PIPE */.L5,
_constants_js__rspack_import_1/* .PLUS */.uu,
_constants_js__rspack_import_1/* .QUESTION_MARK */.Nb,
_constants_js__rspack_import_1/* .SLASH */.o,
]);
/**
* Utility functions for working with RegExp patterns.
*/
class RegExpUtils {
/**
* Checks whether a string possibly is a RegExp pattern.
* Flags are not supported.
*
* Note: it does not perform a full validation of the pattern,
* it just checks if the string starts and ends with a slash.
*
* @param pattern Pattern to check.
*
* @returns `true` if the string is a RegExp pattern, `false` otherwise.
*/
static isRegexPattern(pattern) {
const trimmedPattern = pattern.trim();
// Avoid false positives
return trimmedPattern.length > _constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length * 2
&& trimmedPattern.startsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb)
&& trimmedPattern.endsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb)
&& trimmedPattern[_constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length - 2] !== _constants_js__rspack_import_1/* .ESCAPE_CHARACTER */.Kx;
}
/**
* Checks whether a string is a negated RegExp pattern.
*
* @param pattern Pattern to check.
*
* @returns `true` if the string is a negated RegExp pattern, `false` otherwise.
*/
static isNegatedRegexPattern(pattern) {
if (pattern.startsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb) && pattern.endsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb)) {
const innerPattern = pattern.slice(_constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length, pattern.length - _constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length);
return innerPattern.startsWith(REGEX_NEGATION_PREFIX) && innerPattern.endsWith(REGEX_NEGATION_SUFFIX);
}
return pattern.startsWith(REGEX_NEGATION_PREFIX) && pattern.endsWith(REGEX_NEGATION_SUFFIX);
}
/**
* Removes negation from a RegExp pattern.
*
* @param pattern RegExp pattern to remove negation from.
*
* @returns RegExp pattern without negation.
*/
static removeNegationFromRegexPattern(pattern) {
let result = pattern.trim();
const slashes = RegExpUtils.isRegexPattern(result);
if (slashes) {
result = result.substring(_constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length, result.length - _constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length);
}
if (result.startsWith(REGEX_NEGATION_PREFIX) && result.endsWith(REGEX_NEGATION_SUFFIX)) {
result = result.substring(REGEX_NEGATION_PREFIX.length, result.length - REGEX_NEGATION_SUFFIX.length);
}
return slashes ? `${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}${result}${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}` : result;
}
/**
* Negates a RegExp pattern. Technically, this method wraps the pattern in `^((?!` and `).)*$`.
*
* RegExp modifiers are not supported.
*
* @param pattern Pattern to negate (can be wrapped in slashes or not).
*
* @returns Negated RegExp pattern.
*/
static negateRegexPattern(pattern) {
let result = pattern.trim();
let slashes = false;
// Remove the leading and trailing slashes (/)
if (RegExpUtils.isRegexPattern(result)) {
result = result.substring(_constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length, result.length - _constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length);
slashes = true;
}
// Only negate the pattern if it's not already negated
if (!(result.startsWith(REGEX_NEGATION_PREFIX) && result.endsWith(REGEX_NEGATION_SUFFIX))) {
// Remove leading caret (^)
if (result.startsWith(REGEX_START)) {
result = result.substring(REGEX_START.length);
}
// Remove trailing dollar sign ($)
if (result.endsWith(REGEX_END)) {
result = result.substring(0, result.length - REGEX_END.length);
}
// Wrap the pattern in the negation
result = `${REGEX_NEGATION_PREFIX}${result}${REGEX_NEGATION_SUFFIX}`;
}
// Add the leading and trailing slashes back if they were there
if (slashes) {
result = `${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}${result}${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}`;
}
return result;
}
/**
* Ensures that a pattern is wrapped in slashes.
*
* @param pattern Pattern to ensure slashes for.
*
* @returns Pattern with slashes.
*/
static ensureSlashes(pattern) {
let result = pattern;
if (!result.startsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb)) {
result = `${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}${result}`;
}
if (!result.endsWith(_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb)) {
result += _constants_js__rspack_import_1/* .REGEX_MARKER */.Vb;
}
return result;
}
/**
* Converts a basic adblock rule pattern to a RegExp pattern. Based on
* https://github.com/AdguardTeam/tsurlfilter/blob/9b26e0b4a0e30b87690bc60f7cf377d112c3085c/packages/tsurlfilter/src/rules/simple-regex.ts#L219.
*
* @see {@link https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#basic-rules}
*
* @param pattern Pattern to convert.
*
* @returns RegExp equivalent of the pattern.
*/
static patternToRegexp(pattern) {
const trimmed = pattern.trim();
// Return regex for any character sequence if the pattern is just |, ||, * or empty
if (trimmed === ADBLOCK_URL_START
|| trimmed === _constants_js__rspack_import_1/* .PIPE */.L5
|| trimmed === ADBLOCK_WILDCARD
|| trimmed === _constants_js__rspack_import_1/* .EMPTY */.wg) {
return REGEX_ANY_CHARACTERS;
}
// If the pattern is already a RegExp, just return it, but remove the leading and trailing slashes
if (RegExpUtils.isRegexPattern(pattern)) {
return pattern.substring(_constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length, pattern.length - _constants_js__rspack_import_1/* .REGEX_MARKER.length */.Vb.length);
}
let result = _constants_js__rspack_import_1/* .EMPTY */.wg;
let offset = 0;
let len = trimmed.length;
// Handle leading pipes
if (trimmed[0] === _constants_js__rspack_import_1/* .PIPE */.L5) {
if (trimmed[1] === _constants_js__rspack_import_1/* .PIPE */.L5) {
// Replace adblock url start (||) with its RegExp equivalent
result += ADBLOCK_URL_START_REGEX;
offset = ADBLOCK_URL_START.length;
}
else {
// Replace single pipe (|) with the RegExp start symbol (^)
result += REGEX_START;
offset = REGEX_START.length;
}
}
// Handle trailing pipes
let trailingPipe = false;
if (trimmed.endsWith(_constants_js__rspack_import_1/* .PIPE */.L5)) {
trailingPipe = true;
len -= _constants_js__rspack_import_1/* .PIPE.length */.L5.length;
}
// Handle the rest of the pattern, if any
for (; offset < len; offset += 1) {
if (trimmed[offset] === ADBLOCK_WILDCARD) {
// Replace adblock wildcard (*) with its RegExp equivalent
result += ADBLOCK_WILDCARD_REGEX;
}
else if (trimmed[offset] === ADBLOCK_URL_SEPARATOR) {
// Replace adblock url separator (^) with its RegExp equivalent
result += ADBLOCK_URL_SEPARATOR_REGEX;
}
else if (SPECIAL_REGEX_SYMBOLS.has(trimmed[offset])) {
// Escape special RegExp symbols (we handled pipe (|) and asterisk (*) already)
result += _constants_js__rspack_import_1/* .ESCAPE_CHARACTER */.Kx + trimmed[offset];
}
else {
// Just add any other character
result += trimmed[offset];
}
}
// Handle trailing pipes
if (trailingPipe) {
// Replace trailing pipe (|) with the RegExp end symbol ($)
result += REGEX_END;
}
return result;
}
/**
* Creates a length-matching regular expression string: /^(?=.{min,max}$).*\/s
* Where:
* - (?=.{min,max}$) is a lookahead that ensures the string length is between min and max
* - .* matches any character (including newlines, due to the 's' flag).
*
* @param min Minimum length or `null` for no minimum (default to `0`).
* @param max Maximum length or `null` for no maximum (default to no maximum).
*
* @returns Length-matching regular expression string.
*/
static getLengthRegexp(min, max) {
return `/^(?=.{${min ?? 0},${max ?? ''}}$).*/s`;
}
/**
* Converts a glob pattern to a RegExp string with slashes and 's' flag.
*
* @param glob Glob pattern to convert.
*
* @returns RegExp string.
*
* @example
* // Returns '/^foo.*bar$/s'
* RegExpUtils.globToRegExp('foo*bar');
*/
static globToRegExp(glob) {
return `${_constants_js__rspack_import_1/* .REGEX_MARKER */.Vb + glob_to_regexp__rspack_import_0(glob).source + _constants_js__rspack_import_1/* .REGEX_MARKER */.Vb}s`;
}
}
},
16875(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
$x: () => (StringUtils)
});
/* import */ var _constants_js__rspack_import_0 = __webpack_require__(53097);
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* @file Utility functions for string manipulation.
*/
const SINGLE_QUOTE_MARKER = "'";
const DOUBLE_QUOTE_MARKER = '"';
/**
* Utility functions for string manipulation.
*/
class StringUtils {
/**
* Finds the first occurrence of a character that:
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param start Start index.
* @param escapeCharacter Escape character, \ by default.
* @param end End index (excluded).
*
* @returns Index or -1 if the character not found.
*/
static findNextUnescapedCharacter(pattern, searchedCharacter, start = 0, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx, end = pattern.length) {
for (let i = start; i < end; i += 1) {
// The searched character cannot be preceded by an escape
if (pattern[i] === searchedCharacter && pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the first occurrence in backward direction of a character that isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param start Start index.
* @param escapeCharacter Escape character, \ by default.
* @param end End index (Included).
*
* @returns Index or -1 if the character not found.
*/
static findNextUnescapedCharacterBackwards(pattern, searchedCharacter, start = pattern.length - 1, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx, end = 0) {
for (let i = start; i >= end; i -= 1) {
// The searched character cannot be preceded by an escape
if (pattern[i] === searchedCharacter && pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the last occurrence of a character that:
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param escapeCharacter Escape character, \ by default.
*
* @returns Index or -1 if the character not found.
*/
static findLastUnescapedCharacter(pattern, searchedCharacter, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
for (let i = pattern.length - 1; i >= 0; i -= 1) {
// The searched character cannot be preceded by an escape
if (pattern[i] === searchedCharacter && pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the next occurrence of a character that:
* - isn't preceded by an escape character
* - isn't followed by the specified character.
*
* @param pattern Source pattern.
* @param start Start index.
* @param searchedCharacter Searched character.
* @param notFollowedBy Searched character not followed by this character.
* @param escapeCharacter Escape character, \ by default.
*
* @returns Index or -1 if the character not found.
*/
static findNextUnescapedCharacterThatNotFollowedBy(pattern, start, searchedCharacter, notFollowedBy, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
for (let i = start; i < pattern.length; i += 1) {
// The searched character cannot be preceded by an escape
if (pattern[i] === searchedCharacter
&& pattern[i + 1] !== notFollowedBy
&& pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the last occurrence of a character that:
* - isn't preceded by an escape character
* - isn't followed by the specified character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param notFollowedBy Searched character not followed by this character.
* @param escapeCharacter Escape character, \ by default.
*
* @returns Index or -1 if the character not found.
*/
static findLastUnescapedCharacterThatNotFollowedBy(pattern, searchedCharacter, notFollowedBy, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
for (let i = pattern.length - 1; i >= 0; i -= 1) {
// The searched character cannot be preceded by an escape
if (pattern[i] === searchedCharacter
&& pattern[i + 1] !== notFollowedBy
&& pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the next occurrence of a character that:
* - isn't part of any string literal ('literal' or "literal")
* - isn't part of any RegExp expression (/regexp/).
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param start Start index.
*
* @returns Index or -1 if the character not found.
*/
static findUnescapedNonStringNonRegexChar(pattern, searchedCharacter, start = 0) {
let open = null;
for (let i = start; i < pattern.length; i += 1) {
if ((pattern[i] === SINGLE_QUOTE_MARKER
|| pattern[i] === DOUBLE_QUOTE_MARKER
|| pattern[i] === _constants_js__rspack_import_0/* .REGEX_MARKER */.Vb)
&& pattern[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
if (open === pattern[i]) {
open = null;
}
else if (open === null) {
open = pattern[i];
}
}
else if (open === null && pattern[i] === searchedCharacter && pattern[i - 1] !== _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
return i;
}
}
return -1;
}
/**
* Finds the last occurrence of a character that is:
* - not part of any string literal ('literal' or "literal")
* - not part of any RegExp expression (/regexp/)
* - not preceded by an escape character.
*
* Searches backwards from the end of the pattern.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param escapeCharacter Escape character, `\` by default.
*
* @returns Index of the character or -1 if the character not found.
*/
static findLastUnescapedNonStringNonRegexChar(pattern, searchedCharacter, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
let open = null;
// Search backwards through the pattern
for (let i = pattern.length - 1; i >= 0; i -= 1) {
if ((pattern[i] === SINGLE_QUOTE_MARKER
|| pattern[i] === DOUBLE_QUOTE_MARKER
|| pattern[i] === _constants_js__rspack_import_0/* .REGEX_MARKER */.Vb)
&& pattern[i - 1] !== escapeCharacter) {
// When searching backwards,
// we close when we see the marker and are already inside,
// and open when we see it and are not inside.
if (open === pattern[i]) {
open = null;
}
else if (open === null) {
open = pattern[i];
}
}
else if (open === null
&& pattern[i] === searchedCharacter
&& pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Finds the next occurrence of a character that:
* - isn't part of any string literal ('literal' or "literal")
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param start Start index.
* @param escapeCharacter Escape character, \ by default.
*
* @returns Index or -1 if the character not found.
*/
static findNextUnquotedUnescapedCharacter(pattern, searchedCharacter, start = 0, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
let openQuote = null;
for (let i = start; i < pattern.length; i += 1) {
// Unescaped ' or "
if ((pattern[i] === SINGLE_QUOTE_MARKER || pattern[i] === DOUBLE_QUOTE_MARKER)
&& pattern[i - 1] !== escapeCharacter) {
if (!openQuote) {
openQuote = pattern[i];
}
else if (openQuote === pattern[i]) {
openQuote = null;
}
}
else if (pattern[i] === searchedCharacter && pattern[i - 1] !== escapeCharacter) {
// Unescaped character
if (!openQuote) {
return i;
}
}
}
return -1;
}
/**
* Finds the next occurrence of a character that:
* - isn't "bracketed"
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param searchedCharacter Searched character.
* @param start Start index.
* @param escapeCharacter Escape character, \ by default.
* @param openBracket Open bracket, ( by default.
* @param closeBracket Close bracket, ( by default.
*
* @returns Index or -1 if the character not found.
*
* @throws If the opening and closing brackets are the same.
*/
static findNextNotBracketedUnescapedCharacter(pattern, searchedCharacter, start = 0, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx, openBracket = '(', closeBracket = ')') {
if (openBracket === closeBracket) {
throw new Error('Open and close bracket cannot be the same');
}
let depth = 0;
for (let i = start; i < pattern.length; i += 1) {
if (pattern[i] === openBracket) {
depth += 1;
}
else if (pattern[i] === closeBracket) {
depth -= 1;
}
else if (depth < 1 && pattern[i] === searchedCharacter && pattern[i - 1] !== escapeCharacter) {
return i;
}
}
return -1;
}
/**
* Splits the source pattern along characters that:
* - isn't part of any string literal ('literal' or "literal")
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param delimeterCharacter Delimeter character.
*
* @returns Splitted string.
*/
static splitStringByUnquotedUnescapedCharacter(pattern, delimeterCharacter) {
const parts = [];
let delimeterIndex = -1;
do {
const prevDelimeterIndex = delimeterIndex;
delimeterIndex = StringUtils.findNextUnquotedUnescapedCharacter(pattern, delimeterCharacter, delimeterIndex + 1);
if (delimeterIndex !== -1) {
parts.push(pattern.substring(prevDelimeterIndex + 1, delimeterIndex));
}
else {
parts.push(pattern.substring(prevDelimeterIndex + 1, pattern.length));
}
} while (delimeterIndex !== -1);
return parts;
}
/**
* Splits the source pattern along characters that:
* - isn't part of any string literal ('literal' or "literal")
* - isn't part of any RegExp expression (/regexp/)
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param delimeterCharacter Delimeter character.
*
* @returns Splitted string.
*/
static splitStringByUnescapedNonStringNonRegexChar(pattern, delimeterCharacter) {
const parts = [];
let delimeterIndex = -1;
do {
const prevDelimeterIndex = delimeterIndex;
delimeterIndex = StringUtils.findUnescapedNonStringNonRegexChar(pattern, delimeterCharacter, delimeterIndex + 1);
if (delimeterIndex !== -1) {
parts.push(pattern.substring(prevDelimeterIndex + 1, delimeterIndex));
}
else {
parts.push(pattern.substring(prevDelimeterIndex + 1, pattern.length));
}
} while (delimeterIndex !== -1);
return parts;
}
/**
* Splits the source pattern along characters that:
* - isn't preceded by an escape character.
*
* @param pattern Source pattern.
* @param delimeterCharacter Delimeter character.
*
* @returns Splitted string.
*/
static splitStringByUnescapedCharacter(pattern, delimeterCharacter) {
const parts = [];
let delimeterIndex = -1;
do {
const prevDelimeterIndex = delimeterIndex;
delimeterIndex = StringUtils.findNextUnescapedCharacter(pattern, delimeterCharacter, delimeterIndex + 1);
if (delimeterIndex !== -1) {
parts.push(pattern.substring(prevDelimeterIndex + 1, delimeterIndex));
}
else {
parts.push(pattern.substring(prevDelimeterIndex + 1, pattern.length));
}
} while (delimeterIndex !== -1);
return parts;
}
/**
* Determines whether the given character is a space or tab character.
*
* @param char The character to check.
*
* @returns True if the given character is a space or tab character, false otherwise.
*/
static isWhitespace(char) {
return char === _constants_js__rspack_import_0/* .SPACE */.t6 || char === _constants_js__rspack_import_0/* .TAB */.wn;
}
/**
* Checks if the given character is a digit.
*
* @param char The character to check.
*
* @returns `true` if the given character is a digit, `false` otherwise.
*/
static isDigit(char) {
return char >= _constants_js__rspack_import_0/* .NUMBER_0 */.nC && char <= _constants_js__rspack_import_0/* .NUMBER_9 */.g9;
}
/**
* Checks if the given character is a small letter.
*
* @param char The character to check.
*
* @returns `true` if the given character is a small letter, `false` otherwise.
*/
static isSmallLetter(char) {
return char >= _constants_js__rspack_import_0/* .SMALL_LETTER_A */.H3 && char <= _constants_js__rspack_import_0/* .SMALL_LETTER_Z */.AT;
}
/**
* Checks if the given character is a capital letter.
*
* @param char The character to check.
*
* @returns `true` if the given character is a capital letter, `false` otherwise.
*/
static isCapitalLetter(char) {
return char >= _constants_js__rspack_import_0/* .CAPITAL_LETTER_A */.ot && char <= _constants_js__rspack_import_0/* .CAPITAL_LETTER_Z */.hk;
}
/**
* Checks if the given character is a letter (small or capital).
*
* @param char The character to check.
*
* @returns `true` if the given character is a letter, `false` otherwise.
*/
static isLetter(char) {
return StringUtils.isSmallLetter(char) || StringUtils.isCapitalLetter(char);
}
/**
* Checks if the given character is a letter or a digit.
*
* @param char Character to check.
*
* @returns `true` if the given character is a letter or a digit, `false` otherwise.
*/
static isAlphaNumeric(char) {
return StringUtils.isLetter(char) || StringUtils.isDigit(char);
}
/**
* Searches for the first non-whitespace character in the source pattern.
*
* @param pattern Source pattern.
* @param start Start index.
*
* @returns Index or -1 if the character not found.
*/
static findFirstNonWhitespaceCharacter(pattern, start = 0) {
for (let i = start; i < pattern.length; i += 1) {
if (!StringUtils.isWhitespace(pattern[i])) {
return i;
}
}
return -1;
}
/**
* Searches for the last non-whitespace character in the source pattern.
*
* @param pattern Source pattern.
*
* @returns Index or -1 if the character not found.
*/
static findLastNonWhitespaceCharacter(pattern) {
for (let i = pattern.length - 1; i >= 0; i -= 1) {
if (!StringUtils.isWhitespace(pattern[i])) {
return i;
}
}
return -1;
}
/**
* Finds the next whitespace character in the pattern.
*
* @param pattern Pattern to search in.
* @param start Start index.
*
* @returns Index of the next whitespace character or the length of the pattern if not found.
*/
static findNextWhitespaceCharacter(pattern, start = 0) {
for (let i = start; i < pattern.length; i += 1) {
if (StringUtils.isWhitespace(pattern[i])) {
return i;
}
}
return pattern.length;
}
/**
* Escapes a specified character in the string.
*
* @param pattern Input string.
* @param character Character to escape.
* @param escapeCharacter Escape character (optional).
*
* @returns Escaped string.
*/
static escapeCharacter(pattern, character, escapeCharacter = _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx) {
let result = _constants_js__rspack_import_0/* .EMPTY */.wg;
for (let i = 0; i < pattern.length; i += 1) {
if (pattern[i] === character && pattern[i - 1] !== escapeCharacter) {
result += escapeCharacter;
}
result += pattern[i];
}
return result;
}
/**
* Searches for the next non-whitespace character in the source pattern.
*
* @param pattern Pattern to search.
* @param start Start index.
*
* @returns Index of the next non-whitespace character or the length of the pattern.
*/
static skipWS(pattern, start = 0) {
let i = start;
while (i < pattern.length && StringUtils.isWhitespace(pattern[i])) {
i += 1;
}
return Math.min(i, pattern.length);
}
/**
* Searches for the previous non-whitespace character in the source pattern.
*
* @param pattern Pattern to search.
* @param start Start index.
*
* @returns Index of the previous non-whitespace character or -1.
*/
static skipWSBack(pattern, start = pattern.length - 1) {
let i = start;
while (i >= 0 && StringUtils.isWhitespace(pattern[i])) {
i -= 1;
}
return Math.max(i, -1);
}
/**
* Checks if the given character is a new line character.
*
* @param char Character to check.
*
* @returns `true` if the given character is a new line character, `false` otherwise.
*/
static isEOL(char) {
return char === _constants_js__rspack_import_0.CR || char === _constants_js__rspack_import_0.LF || char === _constants_js__rspack_import_0.FF;
}
/**
* Splits a string along newline characters.
*
* @param input Input string.
*
* @returns Splitted string.
*/
static splitStringByNewLines(input) {
return input.split(/\r?\n/);
}
/**
* Splits a string by new lines and stores the new line type for each line.
*
* @param input The input string to be split.
*
* @returns An array of tuples, where each tuple contains a line of the input string and its
* corresponding new line type ("lf", "crlf", or "cr").
*/
static splitStringByNewLinesEx(input) {
// Array to store the tuples of line and new line type
const result = [];
let currentLine = _constants_js__rspack_import_0/* .EMPTY */.wg;
let newLineType = null;
// Iterate over each character in the input string
for (let i = 0; i < input.length; i += 1) {
const char = input[i];
if (char === _constants_js__rspack_import_0.CR) {
if (input[i + 1] === _constants_js__rspack_import_0.LF) {
newLineType = 'crlf';
i += 1;
}
else {
newLineType = 'cr';
}
result.push([currentLine, newLineType]);
currentLine = _constants_js__rspack_import_0/* .EMPTY */.wg;
newLineType = null;
}
else if (char === _constants_js__rspack_import_0.LF) {
newLineType = 'lf';
result.push([currentLine, newLineType]);
currentLine = _constants_js__rspack_import_0/* .EMPTY */.wg;
newLineType = null;
}
else {
currentLine += char;
}
}
if (result.length === 0 || currentLine !== _constants_js__rspack_import_0/* .EMPTY */.wg) {
result.push([currentLine, newLineType]);
}
return result;
}
/**
* Merges an array of tuples (line, newLineType) into a single string.
*
* @param input The array of tuples to be merged.
*
* @returns A single string containing the lines and new line characters from the input array.
*/
static mergeStringByNewLines(input) {
let result = _constants_js__rspack_import_0/* .EMPTY */.wg;
// Iterate over each tuple in the input array
for (let i = 0; i < input.length; i += 1) {
const [line, newLineType] = input[i];
// Add the line to the result string
result += line;
// Add the appropriate new line character based on the newLineType
if (newLineType !== null) {
if (newLineType === 'crlf') {
result += _constants_js__rspack_import_0/* .CRLF */.KT;
}
else if (newLineType === 'cr') {
result += _constants_js__rspack_import_0.CR;
}
else {
result += _constants_js__rspack_import_0.LF;
}
}
}
return result;
}
/**
* Helper method to parse a raw string as a number.
*
* @param raw Raw string to parse.
*
* @returns Parsed number.
*
* @throws If the raw string can't be parsed as a number.
*/
static parseNumber(raw) {
const result = parseInt(raw, 10);
if (Number.isNaN(result)) {
throw new Error('Expected a number');
}
return result;
}
/**
* Checks if the given value is a string.
*
* @param value Value to check.
*
* @returns `true` if the value is a string, `false` otherwise.
*/
static isString(value) {
return typeof value === 'string';
}
/**
* Escapes the given characters in the input string.
*
* @param input Input string.
* @param characters Characters to escape (by default, no characters are escaped).
*
* @returns Escaped string.
*/
static escapeCharacters(input, characters = new Set()) {
let result = _constants_js__rspack_import_0/* .EMPTY */.wg;
for (let i = 0; i < input.length; i += 1) {
if (characters.has(input[i])) {
result += _constants_js__rspack_import_0/* .ESCAPE_CHARACTER */.Kx;
}
result += input[i];
}
return result;
}
}
},
64505(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Kg: () => (isString),
b0: () => (isUndefined),
kZ: () => (isNull)
});
/*
* AGTree v4.2.1 (build date: Wed, 12 Aug 2026 01:31:02 GMT)
* (c) 2026 Adguard Software Ltd.
* Released under the MIT license
* https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/agtree#readme
*/
/**
* Checks whether the given value is undefined.
*
* @param value Value to check.
*
* @returns `true` if the value is 'undefined', `false` otherwise.
*/
const isUndefined = (value) => {
return typeof value === 'undefined';
};
/**
* Checks whether the given value is null.
*
* @param value Value to check.
*
* @returns `true` if the value is 'null', `false` otherwise.
*/
const isNull = (value) => {
return value === null;
};
/**
* Checks whether the given value is a string.
*
* @param value Value to check.
*
* @returns `true` if the value is a string, `false` otherwise.
*/
const isString = (value) => {
return typeof value === 'string';
};
},
53034(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
Ay: () => (z),
G: () => (ZodError),
Yj: () => (stringType),
ai: () => (numberType),
eq: () => (ZodIssueCode),
g1: () => (recordType),
z: () => (z),
zM: () => (booleanType)
});
var util;
(function (util) {
util.assertEqual = (val) => val;
function assertIs(_arg) { }
util.assertIs = assertIs;
function assertNever(_x) {
throw new Error();
}
util.assertNever = assertNever;
util.arrayToEnum = (items) => {
const obj = {};
for (const item of items) {
obj[item] = item;
}
return obj;
};
util.getValidEnumValues = (obj) => {
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
const filtered = {};
for (const k of validKeys) {
filtered[k] = obj[k];
}
return util.objectValues(filtered);
};
util.objectValues = (obj) => {
return util.objectKeys(obj).map(function (e) {
return obj[e];
});
};
util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
: (object) => {
const keys = [];
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
keys.push(key);
}
}
return keys;
};
util.find = (arr, checker) => {
for (const item of arr) {
if (checker(item))
return item;
}
return undefined;
};
util.isInteger = typeof Number.isInteger === "function"
? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
: (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
function joinValues(array, separator = " | ") {
return array
.map((val) => (typeof val === "string" ? `'${val}'` : val))
.join(separator);
}
util.joinValues = joinValues;
util.jsonStringifyReplacer = (_, value) => {
if (typeof value === "bigint") {
return value.toString();
}
return value;
};
})(util || (util = {}));
var objectUtil;
(function (objectUtil) {
objectUtil.mergeShapes = (first, second) => {
return {
...first,
...second, // second overwrites first
};
};
})(objectUtil || (objectUtil = {}));
const ZodParsedType = util.arrayToEnum([
"string",
"nan",
"number",
"integer",
"float",
"boolean",
"date",
"bigint",
"symbol",
"function",
"undefined",
"null",
"array",
"object",
"unknown",
"promise",
"void",
"never",
"map",
"set",
]);
const getParsedType = (data) => {
const t = typeof data;
switch (t) {
case "undefined":
return ZodParsedType.undefined;
case "string":
return ZodParsedType.string;
case "number":
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
case "boolean":
return ZodParsedType.boolean;
case "function":
return ZodParsedType.function;
case "bigint":
return ZodParsedType.bigint;
case "symbol":
return ZodParsedType.symbol;
case "object":
if (Array.isArray(data)) {
return ZodParsedType.array;
}
if (data === null) {
return ZodParsedType.null;
}
if (data.then &&
typeof data.then === "function" &&
data.catch &&
typeof data.catch === "function") {
return ZodParsedType.promise;
}
if (typeof Map !== "undefined" && data instanceof Map) {
return ZodParsedType.map;
}
if (typeof Set !== "undefined" && data instanceof Set) {
return ZodParsedType.set;
}
if (typeof Date !== "undefined" && data instanceof Date) {
return ZodParsedType.date;
}
return ZodParsedType.object;
default:
return ZodParsedType.unknown;
}
};
const ZodIssueCode = util.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",
]);
const quotelessJson = (obj) => {
const json = JSON.stringify(obj, null, 2);
return json.replace(/"([^"]+)":/g, "$1:");
};
class ZodError extends Error {
get errors() {
return this.issues;
}
constructor(issues) {
super();
this.issues = [];
this.addIssue = (sub) => {
this.issues = [...this.issues, sub];
};
this.addIssues = (subs = []) => {
this.issues = [...this.issues, ...subs];
};
const actualProto = new.target.prototype;
if (Object.setPrototypeOf) {
// eslint-disable-next-line ban/ban
Object.setPrototypeOf(this, actualProto);
}
else {
this.__proto__ = actualProto;
}
this.name = "ZodError";
this.issues = issues;
}
format(_mapper) {
const mapper = _mapper ||
function (issue) {
return issue.message;
};
const fieldErrors = { _errors: [] };
const processError = (error) => {
for (const issue of error.issues) {
if (issue.code === "invalid_union") {
issue.unionErrors.map(processError);
}
else if (issue.code === "invalid_return_type") {
processError(issue.returnTypeError);
}
else if (issue.code === "invalid_arguments") {
processError(issue.argumentsError);
}
else if (issue.path.length === 0) {
fieldErrors._errors.push(mapper(issue));
}
else {
let curr = fieldErrors;
let i = 0;
while (i < issue.path.length) {
const el = issue.path[i];
const terminal = i === issue.path.length - 1;
if (!terminal) {
curr[el] = curr[el] || { _errors: [] };
// if (typeof el === "string") {
// curr[el] = curr[el] || { _errors: [] };
// } else if (typeof el === "number") {
// const errorArray: any = [];
// errorArray._errors = [];
// curr[el] = curr[el] || errorArray;
// }
}
else {
curr[el] = curr[el] || { _errors: [] };
curr[el]._errors.push(mapper(issue));
}
curr = curr[el];
i++;
}
}
}
};
processError(this);
return fieldErrors;
}
static assert(value) {
if (!(value instanceof ZodError)) {
throw new Error(`Not a ZodError: ${value}`);
}
}
toString() {
return this.message;
}
get message() {
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
}
get isEmpty() {
return this.issues.length === 0;
}
flatten(mapper = (issue) => issue.message) {
const fieldErrors = {};
const formErrors = [];
for (const sub of this.issues) {
if (sub.path.length > 0) {
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
fieldErrors[sub.path[0]].push(mapper(sub));
}
else {
formErrors.push(mapper(sub));
}
}
return { formErrors, fieldErrors };
}
get formErrors() {
return this.flatten();
}
}
ZodError.create = (issues) => {
const error = new ZodError(issues);
return error;
};
const errorMap = (issue, _ctx) => {
let message;
switch (issue.code) {
case ZodIssueCode.invalid_type:
if (issue.received === ZodParsedType.undefined) {
message = "Required";
}
else {
message = `Expected ${issue.expected}, received ${issue.received}`;
}
break;
case ZodIssueCode.invalid_literal:
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
break;
case ZodIssueCode.unrecognized_keys:
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
break;
case ZodIssueCode.invalid_union:
message = `Invalid input`;
break;
case ZodIssueCode.invalid_union_discriminator:
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
break;
case ZodIssueCode.invalid_enum_value:
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
break;
case ZodIssueCode.invalid_arguments:
message = `Invalid function arguments`;
break;
case ZodIssueCode.invalid_return_type:
message = `Invalid function return type`;
break;
case ZodIssueCode.invalid_date:
message = `Invalid date`;
break;
case ZodIssueCode.invalid_string:
if (typeof issue.validation === "object") {
if ("includes" in issue.validation) {
message = `Invalid input: must include "${issue.validation.includes}"`;
if (typeof issue.validation.position === "number") {
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
}
}
else if ("startsWith" in issue.validation) {
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
}
else if ("endsWith" in issue.validation) {
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
}
else {
util.assertNever(issue.validation);
}
}
else if (issue.validation !== "regex") {
message = `Invalid ${issue.validation}`;
}
else {
message = "Invalid";
}
break;
case ZodIssueCode.too_small:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact
? `exactly equal to `
: issue.inclusive
? `greater than or equal to `
: `greater than `}${issue.minimum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact
? `exactly equal to `
: issue.inclusive
? `greater than or equal to `
: `greater than `}${new Date(Number(issue.minimum))}`;
else
message = "Invalid input";
break;
case ZodIssueCode.too_big:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact
? `exactly`
: issue.inclusive
? `less than or equal to`
: `less than`} ${issue.maximum}`;
else if (issue.type === "bigint")
message = `BigInt must be ${issue.exact
? `exactly`
: issue.inclusive
? `less than or equal to`
: `less than`} ${issue.maximum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact
? `exactly`
: issue.inclusive
? `smaller than or equal to`
: `smaller than`} ${new Date(Number(issue.maximum))}`;
else
message = "Invalid input";
break;
case ZodIssueCode.custom:
message = `Invalid input`;
break;
case ZodIssueCode.invalid_intersection_types:
message = `Intersection results could not be merged`;
break;
case ZodIssueCode.not_multiple_of:
message = `Number must be a multiple of ${issue.multipleOf}`;
break;
case ZodIssueCode.not_finite:
message = "Number must be finite";
break;
default:
message = _ctx.defaultError;
util.assertNever(issue);
}
return { message };
};
let overrideErrorMap = errorMap;
function setErrorMap(map) {
overrideErrorMap = map;
}
function getErrorMap() {
return overrideErrorMap;
}
const makeIssue = (params) => {
const { data, path, errorMaps, issueData } = params;
const fullPath = [...path, ...(issueData.path || [])];
const fullIssue = {
...issueData,
path: fullPath,
};
if (issueData.message !== undefined) {
return {
...issueData,
path: fullPath,
message: issueData.message,
};
}
let errorMessage = "";
const maps = errorMaps
.filter((m) => !!m)
.slice()
.reverse();
for (const map of maps) {
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
}
return {
...issueData,
path: fullPath,
message: errorMessage,
};
};
const EMPTY_PATH = [];
function addIssueToContext(ctx, issueData) {
const overrideMap = getErrorMap();
const issue = makeIssue({
issueData: issueData,
data: ctx.data,
path: ctx.path,
errorMaps: [
ctx.common.contextualErrorMap, // contextual error map is first priority
ctx.schemaErrorMap, // then schema-bound map if available
overrideMap, // then global override map
overrideMap === errorMap ? undefined : errorMap, // then global default map
].filter((x) => !!x),
});
ctx.common.issues.push(issue);
}
class ParseStatus {
constructor() {
this.value = "valid";
}
dirty() {
if (this.value === "valid")
this.value = "dirty";
}
abort() {
if (this.value !== "aborted")
this.value = "aborted";
}
static mergeArray(status, results) {
const arrayValue = [];
for (const s of results) {
if (s.status === "aborted")
return INVALID;
if (s.status === "dirty")
status.dirty();
arrayValue.push(s.value);
}
return { status: status.value, value: arrayValue };
}
static async mergeObjectAsync(status, pairs) {
const syncPairs = [];
for (const pair of pairs) {
const key = await pair.key;
const value = await pair.value;
syncPairs.push({
key,
value,
});
}
return ParseStatus.mergeObjectSync(status, syncPairs);
}
static mergeObjectSync(status, pairs) {
const finalObject = {};
for (const pair of pairs) {
const { key, value } = pair;
if (key.status === "aborted")
return INVALID;
if (value.status === "aborted")
return INVALID;
if (key.status === "dirty")
status.dirty();
if (value.status === "dirty")
status.dirty();
if (key.value !== "__proto__" &&
(typeof value.value !== "undefined" || pair.alwaysSet)) {
finalObject[key.value] = value.value;
}
}
return { status: status.value, value: finalObject };
}
}
const INVALID = Object.freeze({
status: "aborted",
});
const DIRTY = (value) => ({ status: "dirty", value });
const OK = (value) => ({ status: "valid", value });
const isAborted = (x) => x.status === "aborted";
const isDirty = (x) => x.status === "dirty";
const isValid = (x) => x.status === "valid";
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var errorUtil;
(function (errorUtil) {
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
})(errorUtil || (errorUtil = {}));
var _ZodEnum_cache, _ZodNativeEnum_cache;
class ParseInputLazyPath {
constructor(parent, value, path, key) {
this._cachedPath = [];
this.parent = parent;
this.data = value;
this._path = path;
this._key = key;
}
get path() {
if (!this._cachedPath.length) {
if (this._key instanceof Array) {
this._cachedPath.push(...this._path, ...this._key);
}
else {
this._cachedPath.push(...this._path, this._key);
}
}
return this._cachedPath;
}
}
const handleResult = (ctx, result) => {
if (isValid(result)) {
return { success: true, data: result.value };
}
else {
if (!ctx.common.issues.length) {
throw new Error("Validation failed but no issues detected.");
}
return {
success: false,
get error() {
if (this._error)
return this._error;
const error = new ZodError(ctx.common.issues);
this._error = error;
return this._error;
},
};
}
};
function processCreateParams(params) {
if (!params)
return {};
const { errorMap, invalid_type_error, required_error, description } = params;
if (errorMap && (invalid_type_error || required_error)) {
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
}
if (errorMap)
return { errorMap: errorMap, description };
const customMap = (iss, ctx) => {
var _a, _b;
const { message } = params;
if (iss.code === "invalid_enum_value") {
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
}
if (typeof ctx.data === "undefined") {
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
}
if (iss.code !== "invalid_type")
return { message: ctx.defaultError };
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
};
return { errorMap: customMap, description };
}
class ZodType {
get description() {
return this._def.description;
}
_getType(input) {
return getParsedType(input.data);
}
_getOrReturnCtx(input, ctx) {
return (ctx || {
common: input.parent.common,
data: input.data,
parsedType: getParsedType(input.data),
schemaErrorMap: this._def.errorMap,
path: input.path,
parent: input.parent,
});
}
_processInputParams(input) {
return {
status: new ParseStatus(),
ctx: {
common: input.parent.common,
data: input.data,
parsedType: getParsedType(input.data),
schemaErrorMap: this._def.errorMap,
path: input.path,
parent: input.parent,
},
};
}
_parseSync(input) {
const result = this._parse(input);
if (isAsync(result)) {
throw new Error("Synchronous parse encountered promise.");
}
return result;
}
_parseAsync(input) {
const result = this._parse(input);
return Promise.resolve(result);
}
parse(data, params) {
const result = this.safeParse(data, params);
if (result.success)
return result.data;
throw result.error;
}
safeParse(data, params) {
var _a;
const ctx = {
common: {
issues: [],
async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
},
path: (params === null || params === void 0 ? void 0 : params.path) || [],
schemaErrorMap: this._def.errorMap,
parent: null,
data,
parsedType: getParsedType(data),
};
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
return handleResult(ctx, result);
}
"~validate"(data) {
var _a, _b;
const ctx = {
common: {
issues: [],
async: !!this["~standard"].async,
},
path: [],
schemaErrorMap: this._def.errorMap,
parent: null,
data,
parsedType: getParsedType(data),
};
if (!this["~standard"].async) {
try {
const result = this._parseSync({ data, path: [], parent: ctx });
return isValid(result)
? {
value: result.value,
}
: {
issues: ctx.common.issues,
};
}
catch (err) {
if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
this["~standard"].async = true;
}
ctx.common = {
issues: [],
async: true,
};
}
}
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)
? {
value: result.value,
}
: {
issues: ctx.common.issues,
});
}
async parseAsync(data, params) {
const result = await this.safeParseAsync(data, params);
if (result.success)
return result.data;
throw result.error;
}
async safeParseAsync(data, params) {
const ctx = {
common: {
issues: [],
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
async: true,
},
path: (params === null || params === void 0 ? void 0 : params.path) || [],
schemaErrorMap: this._def.errorMap,
parent: null,
data,
parsedType: getParsedType(data),
};
const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
const result = await (isAsync(maybeAsyncResult)
? maybeAsyncResult
: Promise.resolve(maybeAsyncResult));
return handleResult(ctx, result);
}
refine(check, message) {
const getIssueProperties = (val) => {
if (typeof message === "string" || typeof message === "undefined") {
return { message };
}
else if (typeof message === "function") {
return message(val);
}
else {
return message;
}
};
return this._refinement((val, ctx) => {
const result = check(val);
const setError = () => ctx.addIssue({
code: ZodIssueCode.custom,
...getIssueProperties(val),
});
if (typeof Promise !== "undefined" && result instanceof Promise) {
return result.then((data) => {
if (!data) {
setError();
return false;
}
else {
return true;
}
});
}
if (!result) {
setError();
return false;
}
else {
return true;
}
});
}
refinement(check, refinementData) {
return this._refinement((val, ctx) => {
if (!check(val)) {
ctx.addIssue(typeof refinementData === "function"
? refinementData(val, ctx)
: refinementData);
return false;
}
else {
return true;
}
});
}
_refinement(refinement) {
return new ZodEffects({
schema: this,
typeName: ZodFirstPartyTypeKind.ZodEffects,
effect: { type: "refinement", refinement },
});
}
superRefine(refinement) {
return this._refinement(refinement);
}
constructor(def) {
/** Alias of safeParseAsync */
this.spa = this.safeParseAsync;
this._def = def;
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: (data) => this["~validate"](data),
};
}
optional() {
return ZodOptional.create(this, this._def);
}
nullable() {
return ZodNullable.create(this, this._def);
}
nullish() {
return this.nullable().optional();
}
array() {
return ZodArray.create(this);
}
promise() {
return ZodPromise.create(this, this._def);
}
or(option) {
return ZodUnion.create([this, option], this._def);
}
and(incoming) {
return ZodIntersection.create(this, incoming, this._def);
}
transform(transform) {
return new ZodEffects({
...processCreateParams(this._def),
schema: this,
typeName: ZodFirstPartyTypeKind.ZodEffects,
effect: { type: "transform", transform },
});
}
default(def) {
const defaultValueFunc = typeof def === "function" ? def : () => def;
return new ZodDefault({
...processCreateParams(this._def),
innerType: this,
defaultValue: defaultValueFunc,
typeName: ZodFirstPartyTypeKind.ZodDefault,
});
}
brand() {
return new ZodBranded({
typeName: ZodFirstPartyTypeKind.ZodBranded,
type: this,
...processCreateParams(this._def),
});
}
catch(def) {
const catchValueFunc = typeof def === "function" ? def : () => def;
return new ZodCatch({
...processCreateParams(this._def),
innerType: this,
catchValue: catchValueFunc,
typeName: ZodFirstPartyTypeKind.ZodCatch,
});
}
describe(description) {
const This = this.constructor;
return new This({
...this._def,
description,
});
}
pipe(target) {
return ZodPipeline.create(this, target);
}
readonly() {
return ZodReadonly.create(this);
}
isOptional() {
return this.safeParse(undefined).success;
}
isNullable() {
return this.safeParse(null).success;
}
}
const cuidRegex = /^c[^\s-]{8,}$/i;
const cuid2Regex = /^[0-9a-z]+$/;
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
// const uuidRegex =
// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
const uuidRegex = /^[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;
const nanoidRegex = /^[a-z0-9_-]{21}$/i;
const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
const durationRegex = /^[-+]?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)?)??$/;
// from https://stackoverflow.com/a/46181/1550155
// old version: too slow, didn't support unicode
// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
//old email regex
// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
// eslint-disable-next-line
// const emailRegex =
// /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
// const emailRegex =
// /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
// const emailRegex =
// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
// const emailRegex =
// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
let emojiRegex;
// faster, simpler, safer
const ipv4Regex = /^(?:(?: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])$/;
const ipv4CidrRegex = /^(?:(?: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])$/;
// const ipv6Regex =
// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
const ipv6Regex = /^(([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]))$/;
const ipv6CidrRegex = /^(([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])$/;
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
// https://base64.guru/standards/base64url
const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
// simple
// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
// no leap year validation
// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
// with leap year validation
const dateRegexSource = `((\\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])))`;
const dateRegex = new RegExp(`^${dateRegexSource}$`);
function timeRegexSource(args) {
let secondsRegexSource = `[0-5]\\d`;
if (args.precision) {
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
}
else if (args.precision == null) {
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
}
const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
}
function timeRegex(args) {
return new RegExp(`^${timeRegexSource(args)}$`);
}
// Adapted from https://stackoverflow.com/a/3143231
function datetimeRegex(args) {
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
const opts = [];
opts.push(args.local ? `Z?` : `Z`);
if (args.offset)
opts.push(`([+-]\\d{2}:?\\d{2})`);
regex = `${regex}(${opts.join("|")})`;
return new RegExp(`^${regex}$`);
}
function isValidIP(ip, version) {
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
return true;
}
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
return true;
}
return false;
}
function isValidJWT(jwt, alg) {
if (!jwtRegex.test(jwt))
return false;
try {
const [header] = jwt.split(".");
// Convert base64url to base64
const base64 = header
.replace(/-/g, "+")
.replace(/_/g, "/")
.padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
const decoded = JSON.parse(atob(base64));
if (typeof decoded !== "object" || decoded === null)
return false;
if (!decoded.typ || !decoded.alg)
return false;
if (alg && decoded.alg !== alg)
return false;
return true;
}
catch (_a) {
return false;
}
}
function isValidCidr(ip, version) {
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
return true;
}
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
return true;
}
return false;
}
class ZodString extends ZodType {
_parse(input) {
if (this._def.coerce) {
input.data = String(input.data);
}
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.string) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.string,
received: ctx.parsedType,
});
return INVALID;
}
const status = new ParseStatus();
let ctx = undefined;
for (const check of this._def.checks) {
if (check.kind === "min") {
if (input.data.length < check.value) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: check.value,
type: "string",
inclusive: true,
exact: false,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "max") {
if (input.data.length > check.value) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: check.value,
type: "string",
inclusive: true,
exact: false,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "length") {
const tooBig = input.data.length > check.value;
const tooSmall = input.data.length < check.value;
if (tooBig || tooSmall) {
ctx = this._getOrReturnCtx(input, ctx);
if (tooBig) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: check.value,
type: "string",
inclusive: true,
exact: true,
message: check.message,
});
}
else if (tooSmall) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: check.value,
type: "string",
inclusive: true,
exact: true,
message: check.message,
});
}
status.dirty();
}
}
else if (check.kind === "email") {
if (!emailRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "email",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "emoji") {
if (!emojiRegex) {
emojiRegex = new RegExp(_emojiRegex, "u");
}
if (!emojiRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "emoji",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "uuid") {
if (!uuidRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "uuid",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "nanoid") {
if (!nanoidRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "nanoid",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "cuid") {
if (!cuidRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "cuid",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "cuid2") {
if (!cuid2Regex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "cuid2",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "ulid") {
if (!ulidRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "ulid",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "url") {
try {
new URL(input.data);
}
catch (_a) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "url",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "regex") {
check.regex.lastIndex = 0;
const testResult = check.regex.test(input.data);
if (!testResult) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "regex",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "trim") {
input.data = input.data.trim();
}
else if (check.kind === "includes") {
if (!input.data.includes(check.value, check.position)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: { includes: check.value, position: check.position },
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "toLowerCase") {
input.data = input.data.toLowerCase();
}
else if (check.kind === "toUpperCase") {
input.data = input.data.toUpperCase();
}
else if (check.kind === "startsWith") {
if (!input.data.startsWith(check.value)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: { startsWith: check.value },
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "endsWith") {
if (!input.data.endsWith(check.value)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: { endsWith: check.value },
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "datetime") {
const regex = datetimeRegex(check);
if (!regex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: "datetime",
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "date") {
const regex = dateRegex;
if (!regex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: "date",
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "time") {
const regex = timeRegex(check);
if (!regex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_string,
validation: "time",
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "duration") {
if (!durationRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "duration",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "ip") {
if (!isValidIP(input.data, check.version)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "ip",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "jwt") {
if (!isValidJWT(input.data, check.alg)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "jwt",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "cidr") {
if (!isValidCidr(input.data, check.version)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "cidr",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "base64") {
if (!base64Regex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "base64",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "base64url") {
if (!base64urlRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
validation: "base64url",
code: ZodIssueCode.invalid_string,
message: check.message,
});
status.dirty();
}
}
else {
util.assertNever(check);
}
}
return { status: status.value, value: input.data };
}
_regex(regex, validation, message) {
return this.refinement((data) => regex.test(data), {
validation,
code: ZodIssueCode.invalid_string,
...errorUtil.errToObj(message),
});
}
_addCheck(check) {
return new ZodString({
...this._def,
checks: [...this._def.checks, check],
});
}
email(message) {
return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
}
url(message) {
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
}
emoji(message) {
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
}
uuid(message) {
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
}
nanoid(message) {
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
}
cuid(message) {
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
}
cuid2(message) {
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
}
ulid(message) {
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
}
base64(message) {
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
}
base64url(message) {
// base64url encoding is a modification of base64 that can safely be used in URLs and filenames
return this._addCheck({
kind: "base64url",
...errorUtil.errToObj(message),
});
}
jwt(options) {
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
}
ip(options) {
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
}
cidr(options) {
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
}
datetime(options) {
var _a, _b;
if (typeof options === "string") {
return this._addCheck({
kind: "datetime",
precision: null,
offset: false,
local: false,
message: options,
});
}
return this._addCheck({
kind: "datetime",
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
});
}
date(message) {
return this._addCheck({ kind: "date", message });
}
time(options) {
if (typeof options === "string") {
return this._addCheck({
kind: "time",
precision: null,
message: options,
});
}
return this._addCheck({
kind: "time",
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
});
}
duration(message) {
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
}
regex(regex, message) {
return this._addCheck({
kind: "regex",
regex: regex,
...errorUtil.errToObj(message),
});
}
includes(value, options) {
return this._addCheck({
kind: "includes",
value: value,
position: options === null || options === void 0 ? void 0 : options.position,
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
});
}
startsWith(value, message) {
return this._addCheck({
kind: "startsWith",
value: value,
...errorUtil.errToObj(message),
});
}
endsWith(value, message) {
return this._addCheck({
kind: "endsWith",
value: value,
...errorUtil.errToObj(message),
});
}
min(minLength, message) {
return this._addCheck({
kind: "min",
value: minLength,
...errorUtil.errToObj(message),
});
}
max(maxLength, message) {
return this._addCheck({
kind: "max",
value: maxLength,
...errorUtil.errToObj(message),
});
}
length(len, message) {
return this._addCheck({
kind: "length",
value: len,
...errorUtil.errToObj(message),
});
}
/**
* Equivalent to `.min(1)`
*/
nonempty(message) {
return this.min(1, errorUtil.errToObj(message));
}
trim() {
return new ZodString({
...this._def,
checks: [...this._def.checks, { kind: "trim" }],
});
}
toLowerCase() {
return new ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toLowerCase" }],
});
}
toUpperCase() {
return new ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toUpperCase" }],
});
}
get isDatetime() {
return !!this._def.checks.find((ch) => ch.kind === "datetime");
}
get isDate() {
return !!this._def.checks.find((ch) => ch.kind === "date");
}
get isTime() {
return !!this._def.checks.find((ch) => ch.kind === "time");
}
get isDuration() {
return !!this._def.checks.find((ch) => ch.kind === "duration");
}
get isEmail() {
return !!this._def.checks.find((ch) => ch.kind === "email");
}
get isURL() {
return !!this._def.checks.find((ch) => ch.kind === "url");
}
get isEmoji() {
return !!this._def.checks.find((ch) => ch.kind === "emoji");
}
get isUUID() {
return !!this._def.checks.find((ch) => ch.kind === "uuid");
}
get isNANOID() {
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
}
get isCUID() {
return !!this._def.checks.find((ch) => ch.kind === "cuid");
}
get isCUID2() {
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
}
get isULID() {
return !!this._def.checks.find((ch) => ch.kind === "ulid");
}
get isIP() {
return !!this._def.checks.find((ch) => ch.kind === "ip");
}
get isCIDR() {
return !!this._def.checks.find((ch) => ch.kind === "cidr");
}
get isBase64() {
return !!this._def.checks.find((ch) => ch.kind === "base64");
}
get isBase64url() {
// base64url encoding is a modification of base64 that can safely be used in URLs and filenames
return !!this._def.checks.find((ch) => ch.kind === "base64url");
}
get minLength() {
let min = null;
for (const ch of this._def.checks) {
if (ch.kind === "min") {
if (min === null || ch.value > min)
min = ch.value;
}
}
return min;
}
get maxLength() {
let max = null;
for (const ch of this._def.checks) {
if (ch.kind === "max") {
if (max === null || ch.value < max)
max = ch.value;
}
}
return max;
}
}
ZodString.create = (params) => {
var _a;
return new ZodString({
checks: [],
typeName: ZodFirstPartyTypeKind.ZodString,
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
...processCreateParams(params),
});
};
// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
function floatSafeRemainder(val, step) {
const valDecCount = (val.toString().split(".")[1] || "").length;
const stepDecCount = (step.toString().split(".")[1] || "").length;
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
return (valInt % stepInt) / Math.pow(10, decCount);
}
class ZodNumber extends ZodType {
constructor() {
super(...arguments);
this.min = this.gte;
this.max = this.lte;
this.step = this.multipleOf;
}
_parse(input) {
if (this._def.coerce) {
input.data = Number(input.data);
}
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.number) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.number,
received: ctx.parsedType,
});
return INVALID;
}
let ctx = undefined;
const status = new ParseStatus();
for (const check of this._def.checks) {
if (check.kind === "int") {
if (!util.isInteger(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: "integer",
received: "float",
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "min") {
const tooSmall = check.inclusive
? input.data < check.value
: input.data <= check.value;
if (tooSmall) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: check.value,
type: "number",
inclusive: check.inclusive,
exact: false,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "max") {
const tooBig = check.inclusive
? input.data > check.value
: input.data >= check.value;
if (tooBig) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: check.value,
type: "number",
inclusive: check.inclusive,
exact: false,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "multipleOf") {
if (floatSafeRemainder(input.data, check.value) !== 0) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.not_multiple_of,
multipleOf: check.value,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "finite") {
if (!Number.isFinite(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.not_finite,
message: check.message,
});
status.dirty();
}
}
else {
util.assertNever(check);
}
}
return { status: status.value, value: input.data };
}
gte(value, message) {
return this.setLimit("min", value, true, errorUtil.toString(message));
}
gt(value, message) {
return this.setLimit("min", value, false, errorUtil.toString(message));
}
lte(value, message) {
return this.setLimit("max", value, true, errorUtil.toString(message));
}
lt(value, message) {
return this.setLimit("max", value, false, errorUtil.toString(message));
}
setLimit(kind, value, inclusive, message) {
return new ZodNumber({
...this._def,
checks: [
...this._def.checks,
{
kind,
value,
inclusive,
message: errorUtil.toString(message),
},
],
});
}
_addCheck(check) {
return new ZodNumber({
...this._def,
checks: [...this._def.checks, check],
});
}
int(message) {
return this._addCheck({
kind: "int",
message: errorUtil.toString(message),
});
}
positive(message) {
return this._addCheck({
kind: "min",
value: 0,
inclusive: false,
message: errorUtil.toString(message),
});
}
negative(message) {
return this._addCheck({
kind: "max",
value: 0,
inclusive: false,
message: errorUtil.toString(message),
});
}
nonpositive(message) {
return this._addCheck({
kind: "max",
value: 0,
inclusive: true,
message: errorUtil.toString(message),
});
}
nonnegative(message) {
return this._addCheck({
kind: "min",
value: 0,
inclusive: true,
message: errorUtil.toString(message),
});
}
multipleOf(value, message) {
return this._addCheck({
kind: "multipleOf",
value: value,
message: errorUtil.toString(message),
});
}
finite(message) {
return this._addCheck({
kind: "finite",
message: errorUtil.toString(message),
});
}
safe(message) {
return this._addCheck({
kind: "min",
inclusive: true,
value: Number.MIN_SAFE_INTEGER,
message: errorUtil.toString(message),
})._addCheck({
kind: "max",
inclusive: true,
value: Number.MAX_SAFE_INTEGER,
message: errorUtil.toString(message),
});
}
get minValue() {
let min = null;
for (const ch of this._def.checks) {
if (ch.kind === "min") {
if (min === null || ch.value > min)
min = ch.value;
}
}
return min;
}
get maxValue() {
let max = null;
for (const ch of this._def.checks) {
if (ch.kind === "max") {
if (max === null || ch.value < max)
max = ch.value;
}
}
return max;
}
get isInt() {
return !!this._def.checks.find((ch) => ch.kind === "int" ||
(ch.kind === "multipleOf" && util.isInteger(ch.value)));
}
get isFinite() {
let max = null, min = null;
for (const ch of this._def.checks) {
if (ch.kind === "finite" ||
ch.kind === "int" ||
ch.kind === "multipleOf") {
return true;
}
else if (ch.kind === "min") {
if (min === null || ch.value > min)
min = ch.value;
}
else if (ch.kind === "max") {
if (max === null || ch.value < max)
max = ch.value;
}
}
return Number.isFinite(min) && Number.isFinite(max);
}
}
ZodNumber.create = (params) => {
return new ZodNumber({
checks: [],
typeName: ZodFirstPartyTypeKind.ZodNumber,
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
...processCreateParams(params),
});
};
class ZodBigInt extends ZodType {
constructor() {
super(...arguments);
this.min = this.gte;
this.max = this.lte;
}
_parse(input) {
if (this._def.coerce) {
try {
input.data = BigInt(input.data);
}
catch (_a) {
return this._getInvalidInput(input);
}
}
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.bigint) {
return this._getInvalidInput(input);
}
let ctx = undefined;
const status = new ParseStatus();
for (const check of this._def.checks) {
if (check.kind === "min") {
const tooSmall = check.inclusive
? input.data < check.value
: input.data <= check.value;
if (tooSmall) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
type: "bigint",
minimum: check.value,
inclusive: check.inclusive,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "max") {
const tooBig = check.inclusive
? input.data > check.value
: input.data >= check.value;
if (tooBig) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
type: "bigint",
maximum: check.value,
inclusive: check.inclusive,
message: check.message,
});
status.dirty();
}
}
else if (check.kind === "multipleOf") {
if (input.data % check.value !== BigInt(0)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.not_multiple_of,
multipleOf: check.value,
message: check.message,
});
status.dirty();
}
}
else {
util.assertNever(check);
}
}
return { status: status.value, value: input.data };
}
_getInvalidInput(input) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.bigint,
received: ctx.parsedType,
});
return INVALID;
}
gte(value, message) {
return this.setLimit("min", value, true, errorUtil.toString(message));
}
gt(value, message) {
return this.setLimit("min", value, false, errorUtil.toString(message));
}
lte(value, message) {
return this.setLimit("max", value, true, errorUtil.toString(message));
}
lt(value, message) {
return this.setLimit("max", value, false, errorUtil.toString(message));
}
setLimit(kind, value, inclusive, message) {
return new ZodBigInt({
...this._def,
checks: [
...this._def.checks,
{
kind,
value,
inclusive,
message: errorUtil.toString(message),
},
],
});
}
_addCheck(check) {
return new ZodBigInt({
...this._def,
checks: [...this._def.checks, check],
});
}
positive(message) {
return this._addCheck({
kind: "min",
value: BigInt(0),
inclusive: false,
message: errorUtil.toString(message),
});
}
negative(message) {
return this._addCheck({
kind: "max",
value: BigInt(0),
inclusive: false,
message: errorUtil.toString(message),
});
}
nonpositive(message) {
return this._addCheck({
kind: "max",
value: BigInt(0),
inclusive: true,
message: errorUtil.toString(message),
});
}
nonnegative(message) {
return this._addCheck({
kind: "min",
value: BigInt(0),
inclusive: true,
message: errorUtil.toString(message),
});
}
multipleOf(value, message) {
return this._addCheck({
kind: "multipleOf",
value,
message: errorUtil.toString(message),
});
}
get minValue() {
let min = null;
for (const ch of this._def.checks) {
if (ch.kind === "min") {
if (min === null || ch.value > min)
min = ch.value;
}
}
return min;
}
get maxValue() {
let max = null;
for (const ch of this._def.checks) {
if (ch.kind === "max") {
if (max === null || ch.value < max)
max = ch.value;
}
}
return max;
}
}
ZodBigInt.create = (params) => {
var _a;
return new ZodBigInt({
checks: [],
typeName: ZodFirstPartyTypeKind.ZodBigInt,
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
...processCreateParams(params),
});
};
class ZodBoolean extends ZodType {
_parse(input) {
if (this._def.coerce) {
input.data = Boolean(input.data);
}
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.boolean) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.boolean,
received: ctx.parsedType,
});
return INVALID;
}
return OK(input.data);
}
}
ZodBoolean.create = (params) => {
return new ZodBoolean({
typeName: ZodFirstPartyTypeKind.ZodBoolean,
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
...processCreateParams(params),
});
};
class ZodDate extends ZodType {
_parse(input) {
if (this._def.coerce) {
input.data = new Date(input.data);
}
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.date) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.date,
received: ctx.parsedType,
});
return INVALID;
}
if (isNaN(input.data.getTime())) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_date,
});
return INVALID;
}
const status = new ParseStatus();
let ctx = undefined;
for (const check of this._def.checks) {
if (check.kind === "min") {
if (input.data.getTime() < check.value) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
message: check.message,
inclusive: true,
exact: false,
minimum: check.value,
type: "date",
});
status.dirty();
}
}
else if (check.kind === "max") {
if (input.data.getTime() > check.value) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
message: check.message,
inclusive: true,
exact: false,
maximum: check.value,
type: "date",
});
status.dirty();
}
}
else {
util.assertNever(check);
}
}
return {
status: status.value,
value: new Date(input.data.getTime()),
};
}
_addCheck(check) {
return new ZodDate({
...this._def,
checks: [...this._def.checks, check],
});
}
min(minDate, message) {
return this._addCheck({
kind: "min",
value: minDate.getTime(),
message: errorUtil.toString(message),
});
}
max(maxDate, message) {
return this._addCheck({
kind: "max",
value: maxDate.getTime(),
message: errorUtil.toString(message),
});
}
get minDate() {
let min = null;
for (const ch of this._def.checks) {
if (ch.kind === "min") {
if (min === null || ch.value > min)
min = ch.value;
}
}
return min != null ? new Date(min) : null;
}
get maxDate() {
let max = null;
for (const ch of this._def.checks) {
if (ch.kind === "max") {
if (max === null || ch.value < max)
max = ch.value;
}
}
return max != null ? new Date(max) : null;
}
}
ZodDate.create = (params) => {
return new ZodDate({
checks: [],
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
typeName: ZodFirstPartyTypeKind.ZodDate,
...processCreateParams(params),
});
};
class ZodSymbol extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.symbol) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.symbol,
received: ctx.parsedType,
});
return INVALID;
}
return OK(input.data);
}
}
ZodSymbol.create = (params) => {
return new ZodSymbol({
typeName: ZodFirstPartyTypeKind.ZodSymbol,
...processCreateParams(params),
});
};
class ZodUndefined extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.undefined) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.undefined,
received: ctx.parsedType,
});
return INVALID;
}
return OK(input.data);
}
}
ZodUndefined.create = (params) => {
return new ZodUndefined({
typeName: ZodFirstPartyTypeKind.ZodUndefined,
...processCreateParams(params),
});
};
class ZodNull extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.null) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.null,
received: ctx.parsedType,
});
return INVALID;
}
return OK(input.data);
}
}
ZodNull.create = (params) => {
return new ZodNull({
typeName: ZodFirstPartyTypeKind.ZodNull,
...processCreateParams(params),
});
};
class ZodAny extends ZodType {
constructor() {
super(...arguments);
// to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
this._any = true;
}
_parse(input) {
return OK(input.data);
}
}
ZodAny.create = (params) => {
return new ZodAny({
typeName: ZodFirstPartyTypeKind.ZodAny,
...processCreateParams(params),
});
};
class ZodUnknown extends ZodType {
constructor() {
super(...arguments);
// required
this._unknown = true;
}
_parse(input) {
return OK(input.data);
}
}
ZodUnknown.create = (params) => {
return new ZodUnknown({
typeName: ZodFirstPartyTypeKind.ZodUnknown,
...processCreateParams(params),
});
};
class ZodNever extends ZodType {
_parse(input) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.never,
received: ctx.parsedType,
});
return INVALID;
}
}
ZodNever.create = (params) => {
return new ZodNever({
typeName: ZodFirstPartyTypeKind.ZodNever,
...processCreateParams(params),
});
};
class ZodVoid extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.undefined) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.void,
received: ctx.parsedType,
});
return INVALID;
}
return OK(input.data);
}
}
ZodVoid.create = (params) => {
return new ZodVoid({
typeName: ZodFirstPartyTypeKind.ZodVoid,
...processCreateParams(params),
});
};
class ZodArray extends ZodType {
_parse(input) {
const { ctx, status } = this._processInputParams(input);
const def = this._def;
if (ctx.parsedType !== ZodParsedType.array) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.array,
received: ctx.parsedType,
});
return INVALID;
}
if (def.exactLength !== null) {
const tooBig = ctx.data.length > def.exactLength.value;
const tooSmall = ctx.data.length < def.exactLength.value;
if (tooBig || tooSmall) {
addIssueToContext(ctx, {
code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
minimum: (tooSmall ? def.exactLength.value : undefined),
maximum: (tooBig ? def.exactLength.value : undefined),
type: "array",
inclusive: true,
exact: true,
message: def.exactLength.message,
});
status.dirty();
}
}
if (def.minLength !== null) {
if (ctx.data.length < def.minLength.value) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: def.minLength.value,
type: "array",
inclusive: true,
exact: false,
message: def.minLength.message,
});
status.dirty();
}
}
if (def.maxLength !== null) {
if (ctx.data.length > def.maxLength.value) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: def.maxLength.value,
type: "array",
inclusive: true,
exact: false,
message: def.maxLength.message,
});
status.dirty();
}
}
if (ctx.common.async) {
return Promise.all([...ctx.data].map((item, i) => {
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
})).then((result) => {
return ParseStatus.mergeArray(status, result);
});
}
const result = [...ctx.data].map((item, i) => {
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
});
return ParseStatus.mergeArray(status, result);
}
get element() {
return this._def.type;
}
min(minLength, message) {
return new ZodArray({
...this._def,
minLength: { value: minLength, message: errorUtil.toString(message) },
});
}
max(maxLength, message) {
return new ZodArray({
...this._def,
maxLength: { value: maxLength, message: errorUtil.toString(message) },
});
}
length(len, message) {
return new ZodArray({
...this._def,
exactLength: { value: len, message: errorUtil.toString(message) },
});
}
nonempty(message) {
return this.min(1, message);
}
}
ZodArray.create = (schema, params) => {
return new ZodArray({
type: schema,
minLength: null,
maxLength: null,
exactLength: null,
typeName: ZodFirstPartyTypeKind.ZodArray,
...processCreateParams(params),
});
};
function deepPartialify(schema) {
if (schema instanceof ZodObject) {
const newShape = {};
for (const key in schema.shape) {
const fieldSchema = schema.shape[key];
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
}
return new ZodObject({
...schema._def,
shape: () => newShape,
});
}
else if (schema instanceof ZodArray) {
return new ZodArray({
...schema._def,
type: deepPartialify(schema.element),
});
}
else if (schema instanceof ZodOptional) {
return ZodOptional.create(deepPartialify(schema.unwrap()));
}
else if (schema instanceof ZodNullable) {
return ZodNullable.create(deepPartialify(schema.unwrap()));
}
else if (schema instanceof ZodTuple) {
return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
}
else {
return schema;
}
}
class ZodObject extends ZodType {
constructor() {
super(...arguments);
this._cached = null;
/**
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
* If you want to pass through unknown properties, use `.passthrough()` instead.
*/
this.nonstrict = this.passthrough;
// extend<
// Augmentation extends ZodRawShape,
// NewOutput extends util.flatten<{
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
// ? Augmentation[k]["_output"]
// : k extends keyof Output
// ? Output[k]
// : never;
// }>,
// NewInput extends util.flatten<{
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
// ? Augmentation[k]["_input"]
// : k extends keyof Input
// ? Input[k]
// : never;
// }>
// >(
// augmentation: Augmentation
// ): ZodObject<
// extendShape<T, Augmentation>,
// UnknownKeys,
// Catchall,
// NewOutput,
// NewInput
// > {
// return new ZodObject({
// ...this._def,
// shape: () => ({
// ...this._def.shape(),
// ...augmentation,
// }),
// }) as any;
// }
/**
* @deprecated Use `.extend` instead
* */
this.augment = this.extend;
}
_getCached() {
if (this._cached !== null)
return this._cached;
const shape = this._def.shape();
const keys = util.objectKeys(shape);
return (this._cached = { shape, keys });
}
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.object) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.object,
received: ctx.parsedType,
});
return INVALID;
}
const { status, ctx } = this._processInputParams(input);
const { shape, keys: shapeKeys } = this._getCached();
const extraKeys = [];
if (!(this._def.catchall instanceof ZodNever &&
this._def.unknownKeys === "strip")) {
for (const key in ctx.data) {
if (!shapeKeys.includes(key)) {
extraKeys.push(key);
}
}
}
const pairs = [];
for (const key of shapeKeys) {
const keyValidator = shape[key];
const value = ctx.data[key];
pairs.push({
key: { status: "valid", value: key },
value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
alwaysSet: key in ctx.data,
});
}
if (this._def.catchall instanceof ZodNever) {
const unknownKeys = this._def.unknownKeys;
if (unknownKeys === "passthrough") {
for (const key of extraKeys) {
pairs.push({
key: { status: "valid", value: key },
value: { status: "valid", value: ctx.data[key] },
});
}
}
else if (unknownKeys === "strict") {
if (extraKeys.length > 0) {
addIssueToContext(ctx, {
code: ZodIssueCode.unrecognized_keys,
keys: extraKeys,
});
status.dirty();
}
}
else if (unknownKeys === "strip") ;
else {
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
}
}
else {
// run catchall validation
const catchall = this._def.catchall;
for (const key of extraKeys) {
const value = ctx.data[key];
pairs.push({
key: { status: "valid", value: key },
value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
),
alwaysSet: key in ctx.data,
});
}
}
if (ctx.common.async) {
return Promise.resolve()
.then(async () => {
const syncPairs = [];
for (const pair of pairs) {
const key = await pair.key;
const value = await pair.value;
syncPairs.push({
key,
value,
alwaysSet: pair.alwaysSet,
});
}
return syncPairs;
})
.then((syncPairs) => {
return ParseStatus.mergeObjectSync(status, syncPairs);
});
}
else {
return ParseStatus.mergeObjectSync(status, pairs);
}
}
get shape() {
return this._def.shape();
}
strict(message) {
errorUtil.errToObj;
return new ZodObject({
...this._def,
unknownKeys: "strict",
...(message !== undefined
? {
errorMap: (issue, ctx) => {
var _a, _b, _c, _d;
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
if (issue.code === "unrecognized_keys")
return {
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
};
return {
message: defaultError,
};
},
}
: {}),
});
}
strip() {
return new ZodObject({
...this._def,
unknownKeys: "strip",
});
}
passthrough() {
return new ZodObject({
...this._def,
unknownKeys: "passthrough",
});
}
// const AugmentFactory =
// <Def extends ZodObjectDef>(def: Def) =>
// <Augmentation extends ZodRawShape>(
// augmentation: Augmentation
// ): ZodObject<
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
// Def["unknownKeys"],
// Def["catchall"]
// > => {
// return new ZodObject({
// ...def,
// shape: () => ({
// ...def.shape(),
// ...augmentation,
// }),
// }) as any;
// };
extend(augmentation) {
return new ZodObject({
...this._def,
shape: () => ({
...this._def.shape(),
...augmentation,
}),
});
}
/**
* Prior to zod@1.0.12 there was a bug in the
* inferred type of merged objects. Please
* upgrade if you are experiencing issues.
*/
merge(merging) {
const merged = new ZodObject({
unknownKeys: merging._def.unknownKeys,
catchall: merging._def.catchall,
shape: () => ({
...this._def.shape(),
...merging._def.shape(),
}),
typeName: ZodFirstPartyTypeKind.ZodObject,
});
return merged;
}
// merge<
// Incoming extends AnyZodObject,
// Augmentation extends Incoming["shape"],
// NewOutput extends {
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
// ? Augmentation[k]["_output"]
// : k extends keyof Output
// ? Output[k]
// : never;
// },
// NewInput extends {
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
// ? Augmentation[k]["_input"]
// : k extends keyof Input
// ? Input[k]
// : never;
// }
// >(
// merging: Incoming
// ): ZodObject<
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
// Incoming["_def"]["unknownKeys"],
// Incoming["_def"]["catchall"],
// NewOutput,
// NewInput
// > {
// const merged: any = new ZodObject({
// unknownKeys: merging._def.unknownKeys,
// catchall: merging._def.catchall,
// shape: () =>
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
// typeName: ZodFirstPartyTypeKind.ZodObject,
// }) as any;
// return merged;
// }
setKey(key, schema) {
return this.augment({ [key]: schema });
}
// merge<Incoming extends AnyZodObject>(
// merging: Incoming
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
// ZodObject<
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
// Incoming["_def"]["unknownKeys"],
// Incoming["_def"]["catchall"]
// > {
// // const mergedShape = objectUtil.mergeShapes(
// // this._def.shape(),
// // merging._def.shape()
// // );
// const merged: any = new ZodObject({
// unknownKeys: merging._def.unknownKeys,
// catchall: merging._def.catchall,
// shape: () =>
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
// typeName: ZodFirstPartyTypeKind.ZodObject,
// }) as any;
// return merged;
// }
catchall(index) {
return new ZodObject({
...this._def,
catchall: index,
});
}
pick(mask) {
const shape = {};
util.objectKeys(mask).forEach((key) => {
if (mask[key] && this.shape[key]) {
shape[key] = this.shape[key];
}
});
return new ZodObject({
...this._def,
shape: () => shape,
});
}
omit(mask) {
const shape = {};
util.objectKeys(this.shape).forEach((key) => {
if (!mask[key]) {
shape[key] = this.shape[key];
}
});
return new ZodObject({
...this._def,
shape: () => shape,
});
}
/**
* @deprecated
*/
deepPartial() {
return deepPartialify(this);
}
partial(mask) {
const newShape = {};
util.objectKeys(this.shape).forEach((key) => {
const fieldSchema = this.shape[key];
if (mask && !mask[key]) {
newShape[key] = fieldSchema;
}
else {
newShape[key] = fieldSchema.optional();
}
});
return new ZodObject({
...this._def,
shape: () => newShape,
});
}
required(mask) {
const newShape = {};
util.objectKeys(this.shape).forEach((key) => {
if (mask && !mask[key]) {
newShape[key] = this.shape[key];
}
else {
const fieldSchema = this.shape[key];
let newField = fieldSchema;
while (newField instanceof ZodOptional) {
newField = newField._def.innerType;
}
newShape[key] = newField;
}
});
return new ZodObject({
...this._def,
shape: () => newShape,
});
}
keyof() {
return createZodEnum(util.objectKeys(this.shape));
}
}
ZodObject.create = (shape, params) => {
return new ZodObject({
shape: () => shape,
unknownKeys: "strip",
catchall: ZodNever.create(),
typeName: ZodFirstPartyTypeKind.ZodObject,
...processCreateParams(params),
});
};
ZodObject.strictCreate = (shape, params) => {
return new ZodObject({
shape: () => shape,
unknownKeys: "strict",
catchall: ZodNever.create(),
typeName: ZodFirstPartyTypeKind.ZodObject,
...processCreateParams(params),
});
};
ZodObject.lazycreate = (shape, params) => {
return new ZodObject({
shape,
unknownKeys: "strip",
catchall: ZodNever.create(),
typeName: ZodFirstPartyTypeKind.ZodObject,
...processCreateParams(params),
});
};
class ZodUnion extends ZodType {
_parse(input) {
const { ctx } = this._processInputParams(input);
const options = this._def.options;
function handleResults(results) {
// return first issue-free validation if it exists
for (const result of results) {
if (result.result.status === "valid") {
return result.result;
}
}
for (const result of results) {
if (result.result.status === "dirty") {
// add issues from dirty option
ctx.common.issues.push(...result.ctx.common.issues);
return result.result;
}
}
// return invalid
const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_union,
unionErrors,
});
return INVALID;
}
if (ctx.common.async) {
return Promise.all(options.map(async (option) => {
const childCtx = {
...ctx,
common: {
...ctx.common,
issues: [],
},
parent: null,
};
return {
result: await option._parseAsync({
data: ctx.data,
path: ctx.path,
parent: childCtx,
}),
ctx: childCtx,
};
})).then(handleResults);
}
else {
let dirty = undefined;
const issues = [];
for (const option of options) {
const childCtx = {
...ctx,
common: {
...ctx.common,
issues: [],
},
parent: null,
};
const result = option._parseSync({
data: ctx.data,
path: ctx.path,
parent: childCtx,
});
if (result.status === "valid") {
return result;
}
else if (result.status === "dirty" && !dirty) {
dirty = { result, ctx: childCtx };
}
if (childCtx.common.issues.length) {
issues.push(childCtx.common.issues);
}
}
if (dirty) {
ctx.common.issues.push(...dirty.ctx.common.issues);
return dirty.result;
}
const unionErrors = issues.map((issues) => new ZodError(issues));
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_union,
unionErrors,
});
return INVALID;
}
}
get options() {
return this._def.options;
}
}
ZodUnion.create = (types, params) => {
return new ZodUnion({
options: types,
typeName: ZodFirstPartyTypeKind.ZodUnion,
...processCreateParams(params),
});
};
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
////////// //////////
////////// ZodDiscriminatedUnion //////////
////////// //////////
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
const getDiscriminator = (type) => {
if (type instanceof ZodLazy) {
return getDiscriminator(type.schema);
}
else if (type instanceof ZodEffects) {
return getDiscriminator(type.innerType());
}
else if (type instanceof ZodLiteral) {
return [type.value];
}
else if (type instanceof ZodEnum) {
return type.options;
}
else if (type instanceof ZodNativeEnum) {
// eslint-disable-next-line ban/ban
return util.objectValues(type.enum);
}
else if (type instanceof ZodDefault) {
return getDiscriminator(type._def.innerType);
}
else if (type instanceof ZodUndefined) {
return [undefined];
}
else if (type instanceof ZodNull) {
return [null];
}
else if (type instanceof ZodOptional) {
return [undefined, ...getDiscriminator(type.unwrap())];
}
else if (type instanceof ZodNullable) {
return [null, ...getDiscriminator(type.unwrap())];
}
else if (type instanceof ZodBranded) {
return getDiscriminator(type.unwrap());
}
else if (type instanceof ZodReadonly) {
return getDiscriminator(type.unwrap());
}
else if (type instanceof ZodCatch) {
return getDiscriminator(type._def.innerType);
}
else {
return [];
}
};
class ZodDiscriminatedUnion extends ZodType {
_parse(input) {
const { ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.object) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.object,
received: ctx.parsedType,
});
return INVALID;
}
const discriminator = this.discriminator;
const discriminatorValue = ctx.data[discriminator];
const option = this.optionsMap.get(discriminatorValue);
if (!option) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_union_discriminator,
options: Array.from(this.optionsMap.keys()),
path: [discriminator],
});
return INVALID;
}
if (ctx.common.async) {
return option._parseAsync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
}
else {
return option._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
}
}
get discriminator() {
return this._def.discriminator;
}
get options() {
return this._def.options;
}
get optionsMap() {
return this._def.optionsMap;
}
/**
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
* have a different value for each object in the union.
* @param discriminator the name of the discriminator property
* @param types an array of object schemas
* @param params
*/
static create(discriminator, options, params) {
// Get all the valid discriminator values
const optionsMap = new Map();
// try {
for (const type of options) {
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
if (!discriminatorValues.length) {
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
}
for (const value of discriminatorValues) {
if (optionsMap.has(value)) {
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
}
optionsMap.set(value, type);
}
}
return new ZodDiscriminatedUnion({
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
discriminator,
options,
optionsMap,
...processCreateParams(params),
});
}
}
function mergeValues(a, b) {
const aType = getParsedType(a);
const bType = getParsedType(b);
if (a === b) {
return { valid: true, data: a };
}
else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
const bKeys = util.objectKeys(b);
const sharedKeys = util
.objectKeys(a)
.filter((key) => bKeys.indexOf(key) !== -1);
const newObj = { ...a, ...b };
for (const key of sharedKeys) {
const sharedValue = mergeValues(a[key], b[key]);
if (!sharedValue.valid) {
return { valid: false };
}
newObj[key] = sharedValue.data;
}
return { valid: true, data: newObj };
}
else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
if (a.length !== b.length) {
return { valid: false };
}
const newArray = [];
for (let index = 0; index < a.length; index++) {
const itemA = a[index];
const itemB = b[index];
const sharedValue = mergeValues(itemA, itemB);
if (!sharedValue.valid) {
return { valid: false };
}
newArray.push(sharedValue.data);
}
return { valid: true, data: newArray };
}
else if (aType === ZodParsedType.date &&
bType === ZodParsedType.date &&
+a === +b) {
return { valid: true, data: a };
}
else {
return { valid: false };
}
}
class ZodIntersection extends ZodType {
_parse(input) {
const { status, ctx } = this._processInputParams(input);
const handleParsed = (parsedLeft, parsedRight) => {
if (isAborted(parsedLeft) || isAborted(parsedRight)) {
return INVALID;
}
const merged = mergeValues(parsedLeft.value, parsedRight.value);
if (!merged.valid) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_intersection_types,
});
return INVALID;
}
if (isDirty(parsedLeft) || isDirty(parsedRight)) {
status.dirty();
}
return { status: status.value, value: merged.data };
};
if (ctx.common.async) {
return Promise.all([
this._def.left._parseAsync({
data: ctx.data,
path: ctx.path,
parent: ctx,
}),
this._def.right._parseAsync({
data: ctx.data,
path: ctx.path,
parent: ctx,
}),
]).then(([left, right]) => handleParsed(left, right));
}
else {
return handleParsed(this._def.left._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
}), this._def.right._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
}));
}
}
}
ZodIntersection.create = (left, right, params) => {
return new ZodIntersection({
left: left,
right: right,
typeName: ZodFirstPartyTypeKind.ZodIntersection,
...processCreateParams(params),
});
};
class ZodTuple extends ZodType {
_parse(input) {
const { status, ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.array) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.array,
received: ctx.parsedType,
});
return INVALID;
}
if (ctx.data.length < this._def.items.length) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: this._def.items.length,
inclusive: true,
exact: false,
type: "array",
});
return INVALID;
}
const rest = this._def.rest;
if (!rest && ctx.data.length > this._def.items.length) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: this._def.items.length,
inclusive: true,
exact: false,
type: "array",
});
status.dirty();
}
const items = [...ctx.data]
.map((item, itemIndex) => {
const schema = this._def.items[itemIndex] || this._def.rest;
if (!schema)
return null;
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
})
.filter((x) => !!x); // filter nulls
if (ctx.common.async) {
return Promise.all(items).then((results) => {
return ParseStatus.mergeArray(status, results);
});
}
else {
return ParseStatus.mergeArray(status, items);
}
}
get items() {
return this._def.items;
}
rest(rest) {
return new ZodTuple({
...this._def,
rest,
});
}
}
ZodTuple.create = (schemas, params) => {
if (!Array.isArray(schemas)) {
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
}
return new ZodTuple({
items: schemas,
typeName: ZodFirstPartyTypeKind.ZodTuple,
rest: null,
...processCreateParams(params),
});
};
class ZodRecord extends ZodType {
get keySchema() {
return this._def.keyType;
}
get valueSchema() {
return this._def.valueType;
}
_parse(input) {
const { status, ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.object) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.object,
received: ctx.parsedType,
});
return INVALID;
}
const pairs = [];
const keyType = this._def.keyType;
const valueType = this._def.valueType;
for (const key in ctx.data) {
pairs.push({
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
alwaysSet: key in ctx.data,
});
}
if (ctx.common.async) {
return ParseStatus.mergeObjectAsync(status, pairs);
}
else {
return ParseStatus.mergeObjectSync(status, pairs);
}
}
get element() {
return this._def.valueType;
}
static create(first, second, third) {
if (second instanceof ZodType) {
return new ZodRecord({
keyType: first,
valueType: second,
typeName: ZodFirstPartyTypeKind.ZodRecord,
...processCreateParams(third),
});
}
return new ZodRecord({
keyType: ZodString.create(),
valueType: first,
typeName: ZodFirstPartyTypeKind.ZodRecord,
...processCreateParams(second),
});
}
}
class ZodMap extends ZodType {
get keySchema() {
return this._def.keyType;
}
get valueSchema() {
return this._def.valueType;
}
_parse(input) {
const { status, ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.map) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.map,
received: ctx.parsedType,
});
return INVALID;
}
const keyType = this._def.keyType;
const valueType = this._def.valueType;
const pairs = [...ctx.data.entries()].map(([key, value], index) => {
return {
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
};
});
if (ctx.common.async) {
const finalMap = new Map();
return Promise.resolve().then(async () => {
for (const pair of pairs) {
const key = await pair.key;
const value = await pair.value;
if (key.status === "aborted" || value.status === "aborted") {
return INVALID;
}
if (key.status === "dirty" || value.status === "dirty") {
status.dirty();
}
finalMap.set(key.value, value.value);
}
return { status: status.value, value: finalMap };
});
}
else {
const finalMap = new Map();
for (const pair of pairs) {
const key = pair.key;
const value = pair.value;
if (key.status === "aborted" || value.status === "aborted") {
return INVALID;
}
if (key.status === "dirty" || value.status === "dirty") {
status.dirty();
}
finalMap.set(key.value, value.value);
}
return { status: status.value, value: finalMap };
}
}
}
ZodMap.create = (keyType, valueType, params) => {
return new ZodMap({
valueType,
keyType,
typeName: ZodFirstPartyTypeKind.ZodMap,
...processCreateParams(params),
});
};
class ZodSet extends ZodType {
_parse(input) {
const { status, ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.set) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.set,
received: ctx.parsedType,
});
return INVALID;
}
const def = this._def;
if (def.minSize !== null) {
if (ctx.data.size < def.minSize.value) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_small,
minimum: def.minSize.value,
type: "set",
inclusive: true,
exact: false,
message: def.minSize.message,
});
status.dirty();
}
}
if (def.maxSize !== null) {
if (ctx.data.size > def.maxSize.value) {
addIssueToContext(ctx, {
code: ZodIssueCode.too_big,
maximum: def.maxSize.value,
type: "set",
inclusive: true,
exact: false,
message: def.maxSize.message,
});
status.dirty();
}
}
const valueType = this._def.valueType;
function finalizeSet(elements) {
const parsedSet = new Set();
for (const element of elements) {
if (element.status === "aborted")
return INVALID;
if (element.status === "dirty")
status.dirty();
parsedSet.add(element.value);
}
return { status: status.value, value: parsedSet };
}
const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
if (ctx.common.async) {
return Promise.all(elements).then((elements) => finalizeSet(elements));
}
else {
return finalizeSet(elements);
}
}
min(minSize, message) {
return new ZodSet({
...this._def,
minSize: { value: minSize, message: errorUtil.toString(message) },
});
}
max(maxSize, message) {
return new ZodSet({
...this._def,
maxSize: { value: maxSize, message: errorUtil.toString(message) },
});
}
size(size, message) {
return this.min(size, message).max(size, message);
}
nonempty(message) {
return this.min(1, message);
}
}
ZodSet.create = (valueType, params) => {
return new ZodSet({
valueType,
minSize: null,
maxSize: null,
typeName: ZodFirstPartyTypeKind.ZodSet,
...processCreateParams(params),
});
};
class ZodFunction extends ZodType {
constructor() {
super(...arguments);
this.validate = this.implement;
}
_parse(input) {
const { ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.function) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.function,
received: ctx.parsedType,
});
return INVALID;
}
function makeArgsIssue(args, error) {
return makeIssue({
data: args,
path: ctx.path,
errorMaps: [
ctx.common.contextualErrorMap,
ctx.schemaErrorMap,
getErrorMap(),
errorMap,
].filter((x) => !!x),
issueData: {
code: ZodIssueCode.invalid_arguments,
argumentsError: error,
},
});
}
function makeReturnsIssue(returns, error) {
return makeIssue({
data: returns,
path: ctx.path,
errorMaps: [
ctx.common.contextualErrorMap,
ctx.schemaErrorMap,
getErrorMap(),
errorMap,
].filter((x) => !!x),
issueData: {
code: ZodIssueCode.invalid_return_type,
returnTypeError: error,
},
});
}
const params = { errorMap: ctx.common.contextualErrorMap };
const fn = ctx.data;
if (this._def.returns instanceof ZodPromise) {
// Would love a way to avoid disabling this rule, but we need
// an alias (using an arrow function was what caused 2651).
// eslint-disable-next-line @typescript-eslint/no-this-alias
const me = this;
return OK(async function (...args) {
const error = new ZodError([]);
const parsedArgs = await me._def.args
.parseAsync(args, params)
.catch((e) => {
error.addIssue(makeArgsIssue(args, e));
throw error;
});
const result = await Reflect.apply(fn, this, parsedArgs);
const parsedReturns = await me._def.returns._def.type
.parseAsync(result, params)
.catch((e) => {
error.addIssue(makeReturnsIssue(result, e));
throw error;
});
return parsedReturns;
});
}
else {
// Would love a way to avoid disabling this rule, but we need
// an alias (using an arrow function was what caused 2651).
// eslint-disable-next-line @typescript-eslint/no-this-alias
const me = this;
return OK(function (...args) {
const parsedArgs = me._def.args.safeParse(args, params);
if (!parsedArgs.success) {
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
}
const result = Reflect.apply(fn, this, parsedArgs.data);
const parsedReturns = me._def.returns.safeParse(result, params);
if (!parsedReturns.success) {
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
}
return parsedReturns.data;
});
}
}
parameters() {
return this._def.args;
}
returnType() {
return this._def.returns;
}
args(...items) {
return new ZodFunction({
...this._def,
args: ZodTuple.create(items).rest(ZodUnknown.create()),
});
}
returns(returnType) {
return new ZodFunction({
...this._def,
returns: returnType,
});
}
implement(func) {
const validatedFunc = this.parse(func);
return validatedFunc;
}
strictImplement(func) {
const validatedFunc = this.parse(func);
return validatedFunc;
}
static create(args, returns, params) {
return new ZodFunction({
args: (args
? args
: ZodTuple.create([]).rest(ZodUnknown.create())),
returns: returns || ZodUnknown.create(),
typeName: ZodFirstPartyTypeKind.ZodFunction,
...processCreateParams(params),
});
}
}
class ZodLazy extends ZodType {
get schema() {
return this._def.getter();
}
_parse(input) {
const { ctx } = this._processInputParams(input);
const lazySchema = this._def.getter();
return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
}
}
ZodLazy.create = (getter, params) => {
return new ZodLazy({
getter: getter,
typeName: ZodFirstPartyTypeKind.ZodLazy,
...processCreateParams(params),
});
};
class ZodLiteral extends ZodType {
_parse(input) {
if (input.data !== this._def.value) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
received: ctx.data,
code: ZodIssueCode.invalid_literal,
expected: this._def.value,
});
return INVALID;
}
return { status: "valid", value: input.data };
}
get value() {
return this._def.value;
}
}
ZodLiteral.create = (value, params) => {
return new ZodLiteral({
value: value,
typeName: ZodFirstPartyTypeKind.ZodLiteral,
...processCreateParams(params),
});
};
function createZodEnum(values, params) {
return new ZodEnum({
values,
typeName: ZodFirstPartyTypeKind.ZodEnum,
...processCreateParams(params),
});
}
class ZodEnum extends ZodType {
constructor() {
super(...arguments);
_ZodEnum_cache.set(this, void 0);
}
_parse(input) {
if (typeof input.data !== "string") {
const ctx = this._getOrReturnCtx(input);
const expectedValues = this._def.values;
addIssueToContext(ctx, {
expected: util.joinValues(expectedValues),
received: ctx.parsedType,
code: ZodIssueCode.invalid_type,
});
return INVALID;
}
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
}
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
const ctx = this._getOrReturnCtx(input);
const expectedValues = this._def.values;
addIssueToContext(ctx, {
received: ctx.data,
code: ZodIssueCode.invalid_enum_value,
options: expectedValues,
});
return INVALID;
}
return OK(input.data);
}
get options() {
return this._def.values;
}
get enum() {
const enumValues = {};
for (const val of this._def.values) {
enumValues[val] = val;
}
return enumValues;
}
get Values() {
const enumValues = {};
for (const val of this._def.values) {
enumValues[val] = val;
}
return enumValues;
}
get Enum() {
const enumValues = {};
for (const val of this._def.values) {
enumValues[val] = val;
}
return enumValues;
}
extract(values, newDef = this._def) {
return ZodEnum.create(values, {
...this._def,
...newDef,
});
}
exclude(values, newDef = this._def) {
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
...this._def,
...newDef,
});
}
}
_ZodEnum_cache = new WeakMap();
ZodEnum.create = createZodEnum;
class ZodNativeEnum extends ZodType {
constructor() {
super(...arguments);
_ZodNativeEnum_cache.set(this, void 0);
}
_parse(input) {
const nativeEnumValues = util.getValidEnumValues(this._def.values);
const ctx = this._getOrReturnCtx(input);
if (ctx.parsedType !== ZodParsedType.string &&
ctx.parsedType !== ZodParsedType.number) {
const expectedValues = util.objectValues(nativeEnumValues);
addIssueToContext(ctx, {
expected: util.joinValues(expectedValues),
received: ctx.parsedType,
code: ZodIssueCode.invalid_type,
});
return INVALID;
}
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
}
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
const expectedValues = util.objectValues(nativeEnumValues);
addIssueToContext(ctx, {
received: ctx.data,
code: ZodIssueCode.invalid_enum_value,
options: expectedValues,
});
return INVALID;
}
return OK(input.data);
}
get enum() {
return this._def.values;
}
}
_ZodNativeEnum_cache = new WeakMap();
ZodNativeEnum.create = (values, params) => {
return new ZodNativeEnum({
values: values,
typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
...processCreateParams(params),
});
};
class ZodPromise extends ZodType {
unwrap() {
return this._def.type;
}
_parse(input) {
const { ctx } = this._processInputParams(input);
if (ctx.parsedType !== ZodParsedType.promise &&
ctx.common.async === false) {
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.promise,
received: ctx.parsedType,
});
return INVALID;
}
const promisified = ctx.parsedType === ZodParsedType.promise
? ctx.data
: Promise.resolve(ctx.data);
return OK(promisified.then((data) => {
return this._def.type.parseAsync(data, {
path: ctx.path,
errorMap: ctx.common.contextualErrorMap,
});
}));
}
}
ZodPromise.create = (schema, params) => {
return new ZodPromise({
type: schema,
typeName: ZodFirstPartyTypeKind.ZodPromise,
...processCreateParams(params),
});
};
class ZodEffects extends ZodType {
innerType() {
return this._def.schema;
}
sourceType() {
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
? this._def.schema.sourceType()
: this._def.schema;
}
_parse(input) {
const { status, ctx } = this._processInputParams(input);
const effect = this._def.effect || null;
const checkCtx = {
addIssue: (arg) => {
addIssueToContext(ctx, arg);
if (arg.fatal) {
status.abort();
}
else {
status.dirty();
}
},
get path() {
return ctx.path;
},
};
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
if (effect.type === "preprocess") {
const processed = effect.transform(ctx.data, checkCtx);
if (ctx.common.async) {
return Promise.resolve(processed).then(async (processed) => {
if (status.value === "aborted")
return INVALID;
const result = await this._def.schema._parseAsync({
data: processed,
path: ctx.path,
parent: ctx,
});
if (result.status === "aborted")
return INVALID;
if (result.status === "dirty")
return DIRTY(result.value);
if (status.value === "dirty")
return DIRTY(result.value);
return result;
});
}
else {
if (status.value === "aborted")
return INVALID;
const result = this._def.schema._parseSync({
data: processed,
path: ctx.path,
parent: ctx,
});
if (result.status === "aborted")
return INVALID;
if (result.status === "dirty")
return DIRTY(result.value);
if (status.value === "dirty")
return DIRTY(result.value);
return result;
}
}
if (effect.type === "refinement") {
const executeRefinement = (acc) => {
const result = effect.refinement(acc, checkCtx);
if (ctx.common.async) {
return Promise.resolve(result);
}
if (result instanceof Promise) {
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
}
return acc;
};
if (ctx.common.async === false) {
const inner = this._def.schema._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
if (inner.status === "aborted")
return INVALID;
if (inner.status === "dirty")
status.dirty();
// return value is ignored
executeRefinement(inner.value);
return { status: status.value, value: inner.value };
}
else {
return this._def.schema
._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
.then((inner) => {
if (inner.status === "aborted")
return INVALID;
if (inner.status === "dirty")
status.dirty();
return executeRefinement(inner.value).then(() => {
return { status: status.value, value: inner.value };
});
});
}
}
if (effect.type === "transform") {
if (ctx.common.async === false) {
const base = this._def.schema._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
if (!isValid(base))
return base;
const result = effect.transform(base.value, checkCtx);
if (result instanceof Promise) {
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
}
return { status: status.value, value: result };
}
else {
return this._def.schema
._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
.then((base) => {
if (!isValid(base))
return base;
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
});
}
}
util.assertNever(effect);
}
}
ZodEffects.create = (schema, effect, params) => {
return new ZodEffects({
schema,
typeName: ZodFirstPartyTypeKind.ZodEffects,
effect,
...processCreateParams(params),
});
};
ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
return new ZodEffects({
schema,
effect: { type: "preprocess", transform: preprocess },
typeName: ZodFirstPartyTypeKind.ZodEffects,
...processCreateParams(params),
});
};
class ZodOptional extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType === ZodParsedType.undefined) {
return OK(undefined);
}
return this._def.innerType._parse(input);
}
unwrap() {
return this._def.innerType;
}
}
ZodOptional.create = (type, params) => {
return new ZodOptional({
innerType: type,
typeName: ZodFirstPartyTypeKind.ZodOptional,
...processCreateParams(params),
});
};
class ZodNullable extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType === ZodParsedType.null) {
return OK(null);
}
return this._def.innerType._parse(input);
}
unwrap() {
return this._def.innerType;
}
}
ZodNullable.create = (type, params) => {
return new ZodNullable({
innerType: type,
typeName: ZodFirstPartyTypeKind.ZodNullable,
...processCreateParams(params),
});
};
class ZodDefault extends ZodType {
_parse(input) {
const { ctx } = this._processInputParams(input);
let data = ctx.data;
if (ctx.parsedType === ZodParsedType.undefined) {
data = this._def.defaultValue();
}
return this._def.innerType._parse({
data,
path: ctx.path,
parent: ctx,
});
}
removeDefault() {
return this._def.innerType;
}
}
ZodDefault.create = (type, params) => {
return new ZodDefault({
innerType: type,
typeName: ZodFirstPartyTypeKind.ZodDefault,
defaultValue: typeof params.default === "function"
? params.default
: () => params.default,
...processCreateParams(params),
});
};
class ZodCatch extends ZodType {
_parse(input) {
const { ctx } = this._processInputParams(input);
// newCtx is used to not collect issues from inner types in ctx
const newCtx = {
...ctx,
common: {
...ctx.common,
issues: [],
},
};
const result = this._def.innerType._parse({
data: newCtx.data,
path: newCtx.path,
parent: {
...newCtx,
},
});
if (isAsync(result)) {
return result.then((result) => {
return {
status: "valid",
value: result.status === "valid"
? result.value
: this._def.catchValue({
get error() {
return new ZodError(newCtx.common.issues);
},
input: newCtx.data,
}),
};
});
}
else {
return {
status: "valid",
value: result.status === "valid"
? result.value
: this._def.catchValue({
get error() {
return new ZodError(newCtx.common.issues);
},
input: newCtx.data,
}),
};
}
}
removeCatch() {
return this._def.innerType;
}
}
ZodCatch.create = (type, params) => {
return new ZodCatch({
innerType: type,
typeName: ZodFirstPartyTypeKind.ZodCatch,
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
...processCreateParams(params),
});
};
class ZodNaN extends ZodType {
_parse(input) {
const parsedType = this._getType(input);
if (parsedType !== ZodParsedType.nan) {
const ctx = this._getOrReturnCtx(input);
addIssueToContext(ctx, {
code: ZodIssueCode.invalid_type,
expected: ZodParsedType.nan,
received: ctx.parsedType,
});
return INVALID;
}
return { status: "valid", value: input.data };
}
}
ZodNaN.create = (params) => {
return new ZodNaN({
typeName: ZodFirstPartyTypeKind.ZodNaN,
...processCreateParams(params),
});
};
const BRAND = Symbol("zod_brand");
class ZodBranded extends ZodType {
_parse(input) {
const { ctx } = this._processInputParams(input);
const data = ctx.data;
return this._def.type._parse({
data,
path: ctx.path,
parent: ctx,
});
}
unwrap() {
return this._def.type;
}
}
class ZodPipeline extends ZodType {
_parse(input) {
const { status, ctx } = this._processInputParams(input);
if (ctx.common.async) {
const handleAsync = async () => {
const inResult = await this._def.in._parseAsync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
if (inResult.status === "aborted")
return INVALID;
if (inResult.status === "dirty") {
status.dirty();
return DIRTY(inResult.value);
}
else {
return this._def.out._parseAsync({
data: inResult.value,
path: ctx.path,
parent: ctx,
});
}
};
return handleAsync();
}
else {
const inResult = this._def.in._parseSync({
data: ctx.data,
path: ctx.path,
parent: ctx,
});
if (inResult.status === "aborted")
return INVALID;
if (inResult.status === "dirty") {
status.dirty();
return {
status: "dirty",
value: inResult.value,
};
}
else {
return this._def.out._parseSync({
data: inResult.value,
path: ctx.path,
parent: ctx,
});
}
}
}
static create(a, b) {
return new ZodPipeline({
in: a,
out: b,
typeName: ZodFirstPartyTypeKind.ZodPipeline,
});
}
}
class ZodReadonly extends ZodType {
_parse(input) {
const result = this._def.innerType._parse(input);
const freeze = (data) => {
if (isValid(data)) {
data.value = Object.freeze(data.value);
}
return data;
};
return isAsync(result)
? result.then((data) => freeze(data))
: freeze(result);
}
unwrap() {
return this._def.innerType;
}
}
ZodReadonly.create = (type, params) => {
return new ZodReadonly({
innerType: type,
typeName: ZodFirstPartyTypeKind.ZodReadonly,
...processCreateParams(params),
});
};
////////////////////////////////////////
////////////////////////////////////////
////////// //////////
////////// z.custom //////////
////////// //////////
////////////////////////////////////////
////////////////////////////////////////
function cleanParams(params, data) {
const p = typeof params === "function"
? params(data)
: typeof params === "string"
? { message: params }
: params;
const p2 = typeof p === "string" ? { message: p } : p;
return p2;
}
function custom(check, _params = {},
/**
* @deprecated
*
* Pass `fatal` into the params object instead:
*
* ```ts
* z.string().custom((val) => val.length > 5, { fatal: false })
* ```
*
*/
fatal) {
if (check)
return ZodAny.create().superRefine((data, ctx) => {
var _a, _b;
const r = check(data);
if (r instanceof Promise) {
return r.then((r) => {
var _a, _b;
if (!r) {
const params = cleanParams(_params, data);
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
}
});
}
if (!r) {
const params = cleanParams(_params, data);
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
}
return;
});
return ZodAny.create();
}
const late = {
object: ZodObject.lazycreate,
};
var ZodFirstPartyTypeKind;
(function (ZodFirstPartyTypeKind) {
ZodFirstPartyTypeKind["ZodString"] = "ZodString";
ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
const instanceOfType = (
// const instanceOfType = <T extends new (...args: any[]) => any>(
cls, params = {
message: `Input not instance of ${cls.name}`,
}) => custom((data) => data instanceof cls, params);
const stringType = ZodString.create;
const numberType = ZodNumber.create;
const nanType = ZodNaN.create;
const bigIntType = ZodBigInt.create;
const booleanType = ZodBoolean.create;
const dateType = ZodDate.create;
const symbolType = ZodSymbol.create;
const undefinedType = ZodUndefined.create;
const nullType = ZodNull.create;
const anyType = ZodAny.create;
const unknownType = ZodUnknown.create;
const neverType = ZodNever.create;
const voidType = ZodVoid.create;
const arrayType = ZodArray.create;
const objectType = ZodObject.create;
const strictObjectType = ZodObject.strictCreate;
const unionType = ZodUnion.create;
const discriminatedUnionType = ZodDiscriminatedUnion.create;
const intersectionType = ZodIntersection.create;
const tupleType = ZodTuple.create;
const recordType = ZodRecord.create;
const mapType = ZodMap.create;
const setType = ZodSet.create;
const functionType = ZodFunction.create;
const lazyType = ZodLazy.create;
const literalType = ZodLiteral.create;
const enumType = ZodEnum.create;
const nativeEnumType = ZodNativeEnum.create;
const promiseType = ZodPromise.create;
const effectsType = ZodEffects.create;
const optionalType = ZodOptional.create;
const nullableType = ZodNullable.create;
const preprocessType = ZodEffects.createWithPreprocess;
const pipelineType = ZodPipeline.create;
const ostring = () => stringType().optional();
const onumber = () => numberType().optional();
const oboolean = () => booleanType().optional();
const coerce = {
string: ((arg) => ZodString.create({ ...arg, coerce: true })),
number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
boolean: ((arg) => ZodBoolean.create({
...arg,
coerce: true,
})),
bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
};
const NEVER = INVALID;
var z = /*#__PURE__*/Object.freeze({
__proto__: null,
defaultErrorMap: errorMap,
setErrorMap: setErrorMap,
getErrorMap: getErrorMap,
makeIssue: makeIssue,
EMPTY_PATH: EMPTY_PATH,
addIssueToContext: addIssueToContext,
ParseStatus: ParseStatus,
INVALID: INVALID,
DIRTY: DIRTY,
OK: OK,
isAborted: isAborted,
isDirty: isDirty,
isValid: isValid,
isAsync: isAsync,
get util () { return util; },
get objectUtil () { return objectUtil; },
ZodParsedType: ZodParsedType,
getParsedType: getParsedType,
ZodType: ZodType,
datetimeRegex: datetimeRegex,
ZodString: ZodString,
ZodNumber: ZodNumber,
ZodBigInt: ZodBigInt,
ZodBoolean: ZodBoolean,
ZodDate: ZodDate,
ZodSymbol: ZodSymbol,
ZodUndefined: ZodUndefined,
ZodNull: ZodNull,
ZodAny: ZodAny,
ZodUnknown: ZodUnknown,
ZodNever: ZodNever,
ZodVoid: ZodVoid,
ZodArray: ZodArray,
ZodObject: ZodObject,
ZodUnion: ZodUnion,
ZodDiscriminatedUnion: ZodDiscriminatedUnion,
ZodIntersection: ZodIntersection,
ZodTuple: ZodTuple,
ZodRecord: ZodRecord,
ZodMap: ZodMap,
ZodSet: ZodSet,
ZodFunction: ZodFunction,
ZodLazy: ZodLazy,
ZodLiteral: ZodLiteral,
ZodEnum: ZodEnum,
ZodNativeEnum: ZodNativeEnum,
ZodPromise: ZodPromise,
ZodEffects: ZodEffects,
ZodTransformer: ZodEffects,
ZodOptional: ZodOptional,
ZodNullable: ZodNullable,
ZodDefault: ZodDefault,
ZodCatch: ZodCatch,
ZodNaN: ZodNaN,
BRAND: BRAND,
ZodBranded: ZodBranded,
ZodPipeline: ZodPipeline,
ZodReadonly: ZodReadonly,
custom: custom,
Schema: ZodType,
ZodSchema: ZodType,
late: late,
get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },
coerce: coerce,
any: anyType,
array: arrayType,
bigint: bigIntType,
boolean: booleanType,
date: dateType,
discriminatedUnion: discriminatedUnionType,
effect: effectsType,
'enum': enumType,
'function': functionType,
'instanceof': instanceOfType,
intersection: intersectionType,
lazy: lazyType,
literal: literalType,
map: mapType,
nan: nanType,
nativeEnum: nativeEnumType,
never: neverType,
'null': nullType,
nullable: nullableType,
number: numberType,
object: objectType,
oboolean: oboolean,
onumber: onumber,
optional: optionalType,
ostring: ostring,
pipeline: pipelineType,
preprocess: preprocessType,
promise: promiseType,
record: recordType,
set: setType,
strictObject: strictObjectType,
string: stringType,
symbol: symbolType,
transformer: effectsType,
tuple: tupleType,
'undefined': undefinedType,
union: unionType,
unknown: unknownType,
'void': voidType,
NEVER: NEVER,
ZodIssueCode: ZodIssueCode,
quotelessJson: quotelessJson,
ZodError: ZodError
});
},
},function(__webpack_require__) {
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
var __webpack_exports__ = (__webpack_exec__(6730));
}
]);
|