SceneView.js
2.24 MB
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
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.6/esri/copyright.txt for details.
//>>built
require({cache:{"esri/views/BreakpointsOwner":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper ../core/accessorSupport/decorators ../core/watchUtils ./DOMContainer ../core/Accessor ../core/ArrayPool ../core/HandleRegistry dojo/dom-class".split(" "),function(x,r,k,a,b,c,t,n,f,q,l,y){var B={widthBreakpoint:{getValue:function(a){var b=a.viewSize[0];a=a.breakpoints;var c=this.values;return b<=a.xsmall?c.xsmall:b<=
a.small?c.small:b<=a.medium?c.medium:b<=a.large?c.large:c.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",
large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue:function(a){var b=a.viewSize[1];a=a.breakpoints;var c=this.values;return b<=a.xsmall?c.xsmall:b<=a.small?c.small:b<=a.medium?c.medium:
b<=a.large?c.large:c.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",
large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue:function(a){a=a.viewSize;var b=this.values;return a[1]>=a[0]?b.portrait:b.landscape},values:{portrait:"portrait",landscape:"landscape"},
valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},v={xsmall:544,small:768,medium:992,large:1200};return function(f){function n(){var a=null!==f&&f.apply(this,arguments)||this;a._breakpointsHandles=new l;a.breakpoints=v;a.orientation=null;a.widthBreakpoint=null;a.heightBreakpoint=null;return a}k(n,f);n.prototype.initialize=function(){this._breakpointsHandles.add([t.init(this,["breakpoints","size"],this._updateClassNames)])};n.prototype.destroy=
function(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles.destroy(),this._breakpointsHandles=null)};n.prototype._updateClassNames=function(){if(this.container){var a=q.acquire(),b=q.acquire(),c=!1,f,l,n;for(f in B)l=this[f],n=B[f].getValue({viewSize:this.size,breakpoints:this.breakpoints}),l!==n&&(c=!0,this[f]=n,b.push(B[f].valueToClassName[l]),a.push(B[f].valueToClassName[n]));c&&(this._applyClassNameChanges(a,b),q.release(a),q.release(b))}};n.prototype._applyClassNameChanges=
function(a,b){var c=this.container;c&&(y.remove(c,b),y.add(c,a))};n.prototype._removeActiveClassNames=function(){var a=this.container;if(a)for(var b in B)y.remove(a,B[b].valueToClassName[this[b]])};a([c.property({set:function(a){var c=this._get("breakpoints");if(a!==c){c=(c=a)&&c.xsmall<c.small&&c.small<c.medium&&c.medium<c.large;if(!c){var p=JSON.stringify(v,null,2);console.warn("provided breakpoints are not valid, using defaults:"+p)}a=c?a:v;this._set("breakpoints",b({},a))}}})],n.prototype,"breakpoints",
void 0);a([c.property()],n.prototype,"orientation",void 0);a([c.property()],n.prototype,"widthBreakpoint",void 0);a([c.property()],n.prototype,"heightBreakpoint",void 0);return n=a([c.subclass("esri.views.BreakpointsOwner")],n)}(c.declared(f,n))})},"esri/views/DOMContainer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang dojo/on dojo/dom dojo/dom-construct ../core/Accessor ../core/Evented ../core/HandleRegistry ../core/Scheduler ../core/watchUtils ../widgets/Popup ./PopupManager ./overlay/ViewOverlay ./ui/DefaultUI ../core/accessorSupport/decorators".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G){var p=[0,0];return function(f){function q(){var a=f.call(this)||this;a._domHandles=new l;a._freqInfo={freq:16,time:750};a._overlayRenderTaskHandle=null;a.height=0;a.position=null;a.resizing=!1;a.root=null;a.surface=null;a.suspended=!0;a.width=0;a.watch("cursor",function(b){var c=a.surface;c&&c.setAttribute("data-cursor",b)});a.watch("interacting",function(b){var c=a.surface;c&&c.setAttribute("data-interacting",b.toString())});return a}k(q,f);q.prototype.getDefaults=
function(){return b.mixin(this.inherited(arguments),{popup:{},ui:{}})};q.prototype.destroy=function(){this.ui.destroy();this.popup&&this.popup.destroy();this.container=null;this._domHandles.destroy()};Object.defineProperty(q.prototype,"container",{set:function(a){var b=this,c=this._get("container");if(c!==a)if(this._stopMeasuring(),c&&(c.classList.remove("esri-view"),this.popupManager.destroy(),this._set("popupManager",null),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=
null),this.overlay.destroy(),this._set("overlay",null),n.destroy(this.root),this._set("root",null)),a){a.classList.add("esri-view");c=document.createElement("div");c.className="esri-view-root";a.insertBefore(c,a.firstChild);this._set("root",c);var p=document.createElement("div");p.className="esri-view-surface";t.setSelectable(p,!1);c.appendChild(p);this._set("surface",p);p=new D;c.appendChild(p.surface);this._set("overlay",p);p.watch("needsRender",function(a){a&&!b._overlayRenderTaskHandle?b._overlayRenderTaskHandle=
y.addFrameTask({render:function(){b.overlay.render()}}):b._overlayRenderTaskHandle&&(b._overlayRenderTaskHandle.remove(),b._overlayRenderTaskHandle=null)});this._forceReadyCycle();this._set("container",a);this._startMeasuring();a=new w({enabled:!0,view:this});this._set("popupManager",a)}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,
"popup",{set:function(a){var b=this._get("popup");a!==b&&(a||(a=new v({container:document.createElement("div")})),this._domHandles.remove("view-popup"),b&&b.destroy(),a&&(a.viewModel.view=this,this._domHandles.add([B.init(this,"root",function(b,c){var p=a.container;p||(a.container=document.createElement("div"));var f=p&&p.parentNode;t.isDescendant(f,c)&&f.removeChild(p);b&&!f&&n.place(a.container,b)})],"view-popup")),this._set("popup",a))},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,
"size",{get:function(){return[this.width,this.height]},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"ui",{set:function(a){var b=this._get("ui");a!==b&&(this._domHandles.remove("ui"),b&&b.destroy(),a&&(a.view=this,this._domHandles.add([B.init(this,"root",function(b){a.container=b?n.create("div",null,b):null})],"ui")),this._set("ui",a))},enumerable:!0,configurable:!0});q.prototype.focus=function(){this.surface&&this.surface.focus()};q.prototype.pageToContainer=function(a,b,c){var p=
this.position;a-=p[0];b-=p[1];c?(c[0]=a,c[1]=b):c=[a,b];return c};q.prototype.containerToPage=function(a,b,c){var p=this.position;a+=p[0];b+=p[1];c?(c[0]=a,c[1]=b):c=[a,b];return c};q.prototype._stopMeasuring=function(){this._domHandles.remove("measuring");this._get("resizing")&&this._set("resizing",!1)};q.prototype._startMeasuring=function(){var a=this,b=this._freqInfo;b.freq=16;b.time=750;this._domHandles.add([c(window,"resize",function(){b.freq=16;b.time=750}),y.addFrameTask({prepare:function(b){var c=
a._measure(),p=a._freqInfo;p.time+=b.deltaTime;c&&(p.freq=16,a._get("resizing")||a._set("resizing",!0));p.time<p.freq||(p.time=0,a._position()||c?p.freq=16:p.freq=Math.min(750,2*p.freq),!c&&512<=p.freq&&a._get("resizing")&&a._set("resizing",!1))}})],"measuring");this._measure();this._position()};q.prototype._measure=function(){var a=this.container,b=a?a.clientWidth:0,c=a?a.clientHeight:0;if(0===b||0===c||"hidden"===window.getComputedStyle(a).visibility)return this.suspended||this._set("suspended",
!0),!1;var a=this.width,p=this.height;if(b===a&&c===p)return this.suspended&&this._set("suspended",!1),!1;this._set("width",b);this._set("height",c);this.suspended&&this._set("suspended",!1);this.emit("resize",{oldWidth:a,oldHeight:p,width:b,height:c});return!0};q.prototype._position=function(){var a=this.container,b=this.position,c=(a.ownerDocument||window.document).defaultView,a=a.getBoundingClientRect();p[0]=a.left+c.pageXOffset;p[1]=a.top+c.pageYOffset;return b&&p[0]===b[0]&&p[1]===b[1]?!1:(this._set("position",
p.slice()),!0)};a([G.property({value:null,cast:function(a){return t.byId(a)}})],q.prototype,"container",null);a([G.property({readOnly:!0})],q.prototype,"height",void 0);a([G.property({type:v})],q.prototype,"popup",null);a([G.property({type:w})],q.prototype,"popupManager",void 0);a([G.property({type:D})],q.prototype,"overlay",void 0);a([G.property({readOnly:!0})],q.prototype,"position",void 0);a([G.property({readOnly:!0})],q.prototype,"resizing",void 0);a([G.property({readOnly:!0})],q.prototype,"root",
void 0);a([G.property({value:null,dependsOn:["width","height"],readOnly:!0})],q.prototype,"size",null);a([G.property({readOnly:!0})],q.prototype,"surface",void 0);a([G.property({readOnly:!0})],q.prototype,"suspended",void 0);a([G.property({type:F})],q.prototype,"ui",null);a([G.property({readOnly:!0})],q.prototype,"width",void 0);return q=a([G.subclass("esri.views.DOMContainer")],q)}(G.declared(f,q))})},"esri/widgets/Popup":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper ./support/widget ../core/accessorSupport/decorators ../core/lang ../core/Logger ../core/HandleRegistry ../core/watchUtils ./Widget ../widgets/support/widgetUtils ./Popup/PopupRenderer ./Popup/PopupViewModel dojo/i18n!./Popup/nls/Popup ./Spinner dojo/dom-geometry dojo/keys".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p){function z(a,b){return void 0===b?"esri-popup__"+a:"esri-popup__"+a+"-"+b}var A=x.toUrl("./Popup/images/default-action.svg"),J={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},I=f.getLogger("esri.widgets.Popup");return function(f){function L(a){a=f.call(this)||this;a._blurContainer=!1;a._containerNode=null;a._mainContainerNode=null;a._featureMenuNode=null;a._focusContainer=!1;a._focusDockButton=!1;a._focusFeatureMenuButton=!1;a._focusFirstFeature=
!1;a._handleRegistry=new q;a._displayActionTextLimit=2;a._pointerOffsetInPx=16;a._spinner=null;a._closeFeatureMenuHandle=null;a.actions=null;a.alignment="auto";a.autoCloseEnabled=null;a.content=null;a.collapsed=!1;a.collapseEnabled=!0;a.dockEnabled=!1;a.featureCount=null;a.featureMenuOpen=!1;a.features=null;a.featureNavigationEnabled=!0;a.highlightEnabled=null;a.location=null;a.popupRenderers=[];a.promises=null;a.selectedFeature=null;a.selectedFeatureIndex=null;a.selectedPopupRenderer=null;a.spinnerEnabled=
!0;a.title=null;a.updateLocationEnabled=null;a.view=null;a.viewModel=new w;a.visible=null;return a}k(L,f);L.prototype.postInitialize=function(){var a=this,b=l.pausable(this,"\n viewModel.visible,\n dockEnabled,\n viewModel.selectedFeature\n ",function(){return a._closeFeatureMenu()});this._closeFeatureMenuHandle=b;this.own(l.watch(this,"viewModel.screenLocation",function(){return a._positionContainer()}),l.watch(this,["viewModel.visible","dockEnabled"],function(){return a._toggleScreenLocationEnabled()}),
l.watch(this,"viewModel.screenLocation",function(b,c){!!b!==!!c&&a.reposition()}),l.watch(this,"viewModel.features",function(b){return a._createPopupRenderers(b)}),l.watch(this,"viewModel.view.padding viewModel.view.size viewModel.visible viewModel.waitingForResult viewModel.location alignment".split(" "),function(){return a.reposition()}),b,l.watch(this,"spinnerEnabled",function(b){return a._spinnerEnabledChange(b)}),l.watch(this,["title","content"],function(){return a._hasFeatureUpdated()}),l.watch(this,
"viewModel.view.size",function(b,c){return a._updateDockEnabledForViewSize(b,c)}),l.watch(this,"viewModel.view",function(b,c){return a._viewChange(b,c)}),l.watch(this,"viewModel.view.ready",function(b,c){return a._viewReadyChange(b,c)}),l.watch(this,["viewModel.waitingForResult","viewModel.location"],function(){return a._displaySpinner()}),l.watch(this,["popupRenderers","viewModel.selectedFeatureIndex"],function(){return a._updatePopupRenderer()}),l.watch(this,"selectedPopupRenderer.viewModel.title",
function(b){return a._setTitleFromPopupRenderer(b)}),l.watch(this,["selectedPopupRenderer.viewModel.content","selectedPopupRenderer.viewModel.waitingForContent"],function(){return a._setContentFromPopupRenderer()}),l.watch(this,"featureMenuOpen",function(b){return a._featureMenuOpenChanged(b)}),l.watch(this,"visible",function(b){return a._visibleChanged(b)}),l.on(this,"viewModel","trigger-action",function(b){return a._zoomToAction(b)}))};L.prototype.destroy=function(){this._destroyPopupRenderers();
this._destroySpinner();this._handleRegistry.destroy();this._handleRegistry=null};Object.defineProperty(L.prototype,"currentAlignment",{get:function(){return this._getCurrentAlignment()},enumerable:!0,configurable:!0});Object.defineProperty(L.prototype,"currentDockPosition",{get:function(){return this._getCurrentDockPosition()},enumerable:!0,configurable:!0});Object.defineProperty(L.prototype,"dockOptions",{get:function(){return this._get("dockOptions")||J},set:function(a){var c=b({},J),p=this.get("viewModel.view.breakpoints"),
f={};p&&(f.width=p.xsmall,f.height=p.xsmall);a=b({},c,a);c=b({},c.breakpoint,f);f=a.breakpoint;!0===f?a.breakpoint=c:"object"===typeof f&&(a.breakpoint=b({},c,f));this._set("dockOptions",a);this._setCurrentDockPosition();this.reposition()},enumerable:!0,configurable:!0});L.prototype.blur=function(){this.visible||I.warn("Popup cannot be blurred while visible is false");this._blurContainer=!0;this.scheduleRender()};L.prototype.clear=function(){};L.prototype.close=function(){this.visible=!1};L.prototype.focus=
function(){this.visible||I.warn("Popup cannot be focused while visible is false");this._focusContainer=!0;this.scheduleRender()};L.prototype.next=function(){return null};L.prototype.open=function(a){a=b({visible:!0},{featureMenuOpen:!1,updateLocationEnabled:!1,promises:[]},a);a.featureMenuOpen&&this._closeFeatureMenuHandle.pause();this.set(a);this._visibleChanged(!0)};L.prototype.previous=function(){return null};L.prototype.reposition=function(){this.renderNow();this._positionContainer();this._setCurrentAlignment()};
L.prototype.triggerAction=function(a){return null};L.prototype.render=function(){var a=this.collapsed,b=this.collapseEnabled,p=this.dockEnabled,f=this.actions,l=this.featureMenuOpen,q=this.featureNavigationEnabled,A=this.popupRenderers,v=this.visible,h=this.viewModel,k=h.featureCount,Q=h.promiseCount,e=h.pendingPromisesCount,d=h.selectedFeatureIndex,g=h.title,h=h.waitingForResult,m=1<k&&q,q=1<k&&l,u=b&&!q&&a,C=f&&f.length,M=m&&this._getPageText(k,d),Y=this._renderContent(),W=B.isRtl(),t=this.get("selectedPopupRenderer")?
this.get("selectedPopupRenderer.viewModel.waitingForContent")||this.get("selectedPopupRenderer.viewModel.content"):Y,y=p?D.undock:D.dock,f=this.currentAlignment,a=this.currentDockPosition,e=e?c.tsx("div",{key:z("loading-container"),role:"presentation",class:"esri-popup__loading-container","aria-label":D.loading,title:D.loading},c.tsx("span",{"aria-hidden":"true",class:c.join("esri-popup__icon","esri-icon-loading-indicator","esri-rotating")})):null,w=(F={},F["esri-icon-layer-list"]=!q,F["esri-icon-close"]=
q,F),F=c.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:w}),w=(J={},J["esri-icon-right-triangle-arrow"]=W,J["esri-popup__pagination-previous-icon--rtl"]=W,J["esri-icon-left-triangle-arrow"]=!W,J["esri-popup__pagination-previous-icon"]=!W,J),J=c.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:w}),J=c.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:c.join("esri-popup__button","esri-popup__pagination-previous"),
"aria-label":D.previous,title:D.previous},J),W=(G={},G["esri-icon-left-triangle-arrow"]=W,G["esri-popup__pagination-next-icon--rtl"]=W,G["esri-icon-right-triangle-arrow"]=!W,G["esri-popup__pagination-next-icon"]=!W,G),G=c.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:W}),W=c.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:c.join("esri-popup__button","esri-popup__pagination-next"),"aria-label":D.next,title:D.next},G),G=this.id+"-feature-menu",
l=c.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:c.join("esri-popup__button","esri-popup__feature-menu-button"),"aria-haspopup":"true","aria-controls":G,"aria-expanded":l,"aria-label":D.menu,title:D.menu},F),M=c.tsx("div",{class:"esri-popup__pagination-page-text"},M),l=m?c.tsx("div",{class:"esri-popup__navigation-buttons"},J,M,W,l):null,
M=this._wouldDockTo(),M=(L={},L["esri-icon-minimize"]=p,L["esri-popup__icon--dock-icon"]=!p,L["esri-icon-dock-right"]=!p&&("top-right"===M||"bottom-right"===M),L["esri-icon-dock-left"]=!p&&("top-left"===M||"bottom-left"===M),L["esri-icon-maximize"]=!p&&"top-center"===M,L["esri-icon-dock-bottom"]=!p&&"bottom-center"===M,L),L=c.tsx("span",{"aria-hidden":"true",classes:M,class:"esri-popup__icon"}),L=this.get("dockOptions.buttonEnabled")?c.tsx("div",{role:"button","aria-label":y,title:y,tabIndex:0,bind:this,
onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:c.join("esri-popup__button","esri-popup__button--dock")},L):null,b=b&&(t||C||m),y=(I={},I["esri-popup__header-title--button"]=b,I),M=b?u?D.expand:D.collapse:"",I=this.id+"-popup-title",g=g?c.tsx("h1",{class:"esri-popup__header-title",id:I,role:b?"button":"heading","aria-label":M,title:M,classes:y,bind:this,tabIndex:b?0:-1,onclick:this._toggleCollapsed,
onkeydown:this._toggleCollapsed,innerHTML:g}):null,b=c.tsx("span",{"aria-hidden":"true",class:c.join("esri-popup__icon","esri-icon-close")}),b=c.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:"esri-popup__button","aria-label":D.close,title:D.close},b),b=c.tsx("header",{class:"esri-popup__header"},g,c.tsx("div",{class:"esri-popup__header-buttons"},L,b)),L=this.id+"-popup-content",Y=t&&!u?c.tsx("article",{key:z("content-container"),id:L,class:"esri-popup__content"},
Y):null,t=!u&&("bottom-left"===f||"bottom-center"===f||"bottom-right"===f||"top-left"===a||"top-center"===a||"top-right"===a),u=!u&&("top-left"===f||"top-center"===f||"top-right"===f||"bottom-left"===a||"bottom-center"===a||"bottom-right"===a),y=q?null:c.tsx("div",{key:z("actions"),class:"esri-popup__actions"},this._renderActions()),e=c.tsx("section",{key:z("navigation"),class:"esri-popup__navigation"},e,l),m=m||C?c.tsx("div",{key:z("feature-buttons"),class:"esri-popup__feature-buttons"},y,e):null;
(d=this._renderFeatureMenuNode(A,d,q,G))&&this._closeFeatureMenuHandle.resume();A=n.substitute({total:A.length},D.selectedFeatures);d=c.tsx("section",{key:z("menu"),class:"esri-popup__feature-menu"},c.tsx("h2",{class:"esri-popup__feature-menu-header"},A),c.tsx("nav",{class:"esri-popup__feature-menu-viewport",afterCreate:this._featureMenuViewportNodeUpdated,afterUpdate:this._featureMenuViewportNodeUpdated},d));A=p?null:c.tsx("div",{key:z("pointer"),class:"esri-popup__pointer",role:"presentation"},
c.tsx("div",{class:c.join("esri-popup__pointer-direction","esri-popup--shadow")}));q=(r={},r["esri-popup--aligned-top-center"]="top-center"===f,r["esri-popup--aligned-bottom-center"]="bottom-center"===f,r["esri-popup--aligned-top-left"]="top-left"===f,r["esri-popup--aligned-bottom-left"]="bottom-left"===f,r["esri-popup--aligned-top-right"]="top-right"===f,r["esri-popup--aligned-bottom-right"]="bottom-right"===f,r["esri-popup--is-docked"]=p,r["esri-popup--shadow"]=!p,r["esri-popup--feature-updated"]=
v,r["esri-popup--is-docked-top-left"]="top-left"===a,r["esri-popup--is-docked-top-center"]="top-center"===a,r["esri-popup--is-docked-top-right"]="top-right"===a,r["esri-popup--is-docked-bottom-left"]="bottom-left"===a,r["esri-popup--is-docked-bottom-center"]="bottom-center"===a,r["esri-popup--is-docked-bottom-right"]="bottom-right"===a,r["esri-popup--feature-menu-open"]=q,r);r=this.get("selectedFeature.layer.title");f=this.get("selectedFeature.layer.id");p=(K={},K["esri-popup--shadow"]=p,K);K=t?d:
null;d=u?d:null;a=t?m:null;m=u?m:null;v=v&&!h&&(Q?k:1)?c.tsx("div",{key:z("container"),class:"esri-popup__position-container",classes:q,"data-layer-title":r,"data-layer-id":f,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},c.tsx("div",{class:c.join("esri-popup__main-container","esri-widget"),classes:p,tabIndex:-1,"aria-role":"dialog","aria-labelledby":g?I:"","aria-describedby":Y?L:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,
afterUpdate:this._mainContainerNodeUpdated},a,K,b,Y,m,d),A):null;return c.tsx("div",{key:z("base"),class:"esri-popup",role:"presentation"},v);var F,J,G,L,I,r,K};L.prototype._visibleChanged=function(a){a&&(this._focusContainer=!0,this.scheduleRender())};L.prototype._featureMenuOpenChanged=function(a){a?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0;this.scheduleRender()};L.prototype._setTitleFromPopupRenderer=function(a){this.viewModel.title=a||""};L.prototype._setContentFromPopupRenderer=
function(){this.viewModel.content=this.selectedPopupRenderer||null;this.scheduleRender()};L.prototype._handleFeatureMenuKeyup=function(a){a.keyCode===p.ESCAPE&&(a.stopPropagation(),this.featureMenuOpen=!1)};L.prototype._handleFeatureMenuItemKeyup=function(a){var b=a.keyCode,c=this._featureMenuNode,f=this.get("features.length"),l=a.currentTarget["data-feature-index"];c&&(c=c.querySelectorAll("li"),b===p.UP_ARROW?(a.stopPropagation(),c[(l-1+f)%f].focus()):b===p.DOWN_ARROW?(a.stopPropagation(),c[(l+
1+f)%f].focus()):b===p.HOME?(a.stopPropagation(),c[0].focus()):b===p.END&&(a.stopPropagation(),c[c.length-1].focus()))};L.prototype._handleMainKeyup=function(a){var b=a.keyCode;b===p.LEFT_ARROW&&(a.stopPropagation(),this.previous());b===p.RIGHT_ARROW&&(a.stopPropagation(),this.next())};L.prototype._zoomToAction=function(a){a.action&&"zoom-to"===a.action.id&&this.viewModel.zoomToLocation()};L.prototype._spinnerEnabledChange=function(a){this._destroySpinner();a&&(a=this.get("viewModel.view"),this._createSpinner(a))};
L.prototype._displaySpinner=function(){var a=this._spinner;if(a){var b=this.viewModel,c=b.location;b.waitingForResult?a.show({location:c}):a.hide()}};L.prototype._getIconStyles=function(a){return{"background-image":a?"url("+a+")":""}};L.prototype._renderAction=function(a,b,p,f){var q=this,v=l.watch(a,["id","className","title","image","visible"],function(){return q.scheduleRender()});this._handleRegistry.add(v,f);v=this.get("selectedFeature.attributes");"zoom-to"===a.id&&(a.title=D.zoom,this._handleRegistry.add(l.init(this,
"view.animation.state",function(h){a.className="waiting-for-target"===h?c.join("esri-popup__icon","esri-icon-loading-indicator","esri-rotating"):c.join("esri-popup__icon","esri-icon-zoom-in-magnifying-glass")}),f));f=a.title;var t=a.className,k=a.image||t?a.image:A;f=f&&v?n.substitute(v,f):f;t=t&&v?n.substitute(v,t):t;v=k&&v?n.substitute(v,k):k;k=t||"esri-popup__icon";t=(h={},h["esri-popup__action-image"]=!!v,h);h=(y={},y["esri-disabled"]=-1!==k.indexOf("esri-icon-loading-indicator"),y);p=p<=this._displayActionTextLimit?
c.tsx("span",{key:z("action-text-"+b+"-"+a.uid),class:"esri-popup__action-text"},f):null;return a.visible?c.tsx("div",{key:z("action-"+b+"-"+a.uid),role:"button",tabIndex:0,title:f,"aria-label":f,classes:h,class:c.join("esri-popup__button","esri-popup__action"),bind:this,"data-action-index":b,onclick:this._triggerAction,onkeydown:this._triggerAction},c.tsx("span",{key:z("action-icon-"+b+"-"+a.uid+"-"+k),"aria-hidden":"true",class:k,classes:t,styles:this._getIconStyles(v)}),p):null;var h,y};L.prototype._renderActions=
function(){var a=this;this._handleRegistry.remove("actions");var b=this.actions;if(b){var c=b.length;return b.toArray().map(function(b,p){return a._renderAction(b,p,c,"actions")})}};L.prototype._updatePopupRenderer=function(){var a=this.popupRenderers[this.viewModel.selectedFeatureIndex]||null;a&&!a.contentEnabled&&(a.contentEnabled=!0);this._set("selectedPopupRenderer",a)};L.prototype._destroyPopupRenderers=function(){this.popupRenderers.forEach(function(a){return a.destroy()});this._set("popupRenderers",
[])};L.prototype._createPopupRenderers=function(a){var b=this;this._destroyPopupRenderers();var c=[];a&&a.forEach(function(a){a=new v({contentEnabled:!1,graphic:a,view:b.get("viewModel.view")});c.push(a)});this._set("popupRenderers",c)};L.prototype._isScreenLocationWithinView=function(a,b){return-1<a.x&&-1<a.y&&a.x<=b.width&&a.y<=b.height};L.prototype._isOutsideView=function(a){var b=a.popupHeight,c=a.popupWidth,p=a.screenLocation,f=a.side;a=a.view;if(isNaN(c)||isNaN(b)||!a||!p)return!1;var l=a.padding;
return"right"===f&&p.x+c/2>a.width-l.right||"left"===f&&p.x-c/2<l.left||"top"===f&&p.y-b<l.top||"bottom"===f&&p.y+b>a.height-l.bottom?!0:!1};L.prototype._determineCurrentAlignment=function(){var a=this._pointerOffsetInPx,b=this._containerNode,c=this._mainContainerNode,p=this.viewModel,f=p.screenLocation,p=p.view;if(!f||!p||!b)return"top-center";if(!this._isScreenLocationWithinView(f,p))return this._get("currentAlignment")||"top-center";var l=c?window.getComputedStyle(c,null):null,c=l?parseInt(l.getPropertyValue("max-height").replace(/[^-\d\.]/g,
""),10):0,l=l?parseInt(l.getPropertyValue("height").replace(/[^-\d\.]/g,""),10):0,q=G.getContentBox(b),b=q.w+a,q=Math.max(q.h,c,l)+a,a=this._isOutsideView({popupHeight:q,popupWidth:b,screenLocation:f,side:"right",view:p}),c=this._isOutsideView({popupHeight:q,popupWidth:b,screenLocation:f,side:"left",view:p}),l=this._isOutsideView({popupHeight:q,popupWidth:b,screenLocation:f,side:"top",view:p}),f=this._isOutsideView({popupHeight:q,popupWidth:b,screenLocation:f,side:"bottom",view:p});return c?l?"bottom-right":
"top-right":a?l?"bottom-left":"top-left":l?f?"top-center":"bottom-center":"top-center"};L.prototype._getCurrentAlignment=function(){var a=this.alignment;return this.dockEnabled?null:"auto"===a?this._determineCurrentAlignment():"function"===typeof a?a.call(this):a};L.prototype._setCurrentAlignment=function(){this._set("currentAlignment",this._getCurrentAlignment())};L.prototype._setCurrentDockPosition=function(){this._set("currentDockPosition",this._getCurrentDockPosition())};L.prototype._getDockPosition=
function(){var a=this.get("dockOptions.position");return"auto"===a?this._determineCurrentDockPosition():"function"===typeof a?a.call(this):a};L.prototype._getCurrentDockPosition=function(){return this.dockEnabled?this._getDockPosition():null};L.prototype._wouldDockTo=function(){return this.dockEnabled?null:this._getDockPosition()};L.prototype._renderFeatureMenuItemNode=function(a,b,p,f){var l=b===p;f=(q={},q["esri-popup__feature-menu-item--selected"]=l,q);a=a.title||D.untitled;l=l?c.tsx("span",{key:z("feature-menu-selected-feature-"+
p),title:D.selectedFeature,"aria-label":D.selectedFeature,class:"esri-icon-check-mark"}):null;return c.tsx("li",{role:"menuitem",tabIndex:-1,key:z("feature-menu-feature-"+p),classes:f,class:"esri-popup__feature-menu-item",title:a,"aria-label":a,bind:this,"data-feature-index":b,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature},c.tsx("span",{class:"esri-popup__feature-menu-title"},a,l));var q};L.prototype._renderFeatureMenuNode=function(a,b,p,f){var l=
this;return 1<a.length?c.tsx("ol",{class:"esri-popup__feature-menu-list",id:f,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},a.map(function(a,c){return l._renderFeatureMenuItemNode(a,c,b,p)})):null};L.prototype._determineCurrentDockPosition=function(){var a=this.get("viewModel.view"),b=B.isRtl()?"top-left":"top-right";if(!a)return b;var c=a.padding||{left:0,right:0,top:0,bottom:0},c=a.width-c.left-c.right;
return(a=a.get("breakpoints"))&&c<=a.xsmall?"bottom-center":b};L.prototype._renderContent=function(){var a=this.get("viewModel.content");if("string"===typeof a)return c.tsx("div",{key:z("content-string"),innerHTML:a});if(a&&a.isInstanceOf&&a.isInstanceOf(y))return c.tsx("div",{key:z("content-widget")},a.render());if(a instanceof HTMLElement)return c.tsx("div",{key:z("content-html-element"),bind:a,afterUpdate:this._attachToNode,afterCreate:this._attachToNode});if(a&&"function"===typeof a.postMixInProperties&&
"function"===typeof a.buildRendering&&"function"===typeof a.postCreate&&"function"===typeof a.startup)return c.tsx("div",{key:z("content-dijit"),bind:a.domNode,afterUpdate:this._attachToNode,afterCreate:this._attachToNode})};L.prototype._attachToNode=function(a){a.appendChild(this)};L.prototype._positionContainer=function(a){void 0===a&&(a=this._containerNode);a&&(this._containerNode=a);if(a){var b=this.viewModel.screenLocation,c=G.getContentBox(a);if(b=this._calculatePositionStyle(b,c))a.style.top=
b.top,a.style.left=b.left,a.style.bottom=b.bottom,a.style.right=b.right}};L.prototype._calculateFullWidth=function(a){var b=this.currentAlignment,c=this._pointerOffsetInPx;return"top-left"===b||"bottom-left"===b||"top-right"===b||"bottom-right"===b?a+c:a};L.prototype._calculateAlignmentPosition=function(a,b,c,p){var f=this.currentAlignment,l=this._pointerOffsetInPx;p/=2;var q=c.height-b;c=c.width-a;if("bottom-center"===f)return{top:b+l,left:a-p};if("top-left"===f)return{bottom:q+l,right:c+l};if("bottom-left"===
f)return{top:b+l,right:c+l};if("top-right"===f)return{bottom:q+l,left:a+l};if("bottom-right"===f)return{top:b+l,left:a+l};if("top-center"===f)return{bottom:q+l,left:a-p}};L.prototype._calculatePositionStyle=function(a,b){var c=this.view;if(c){var p=c.padding;if(this.dockEnabled)return{left:p.left?p.left+"px":"",top:p.top?p.top+"px":"",right:p.right?p.right+"px":"",bottom:p.bottom?p.bottom+"px":""};if(a&&b&&(b=this._calculateFullWidth(b.w),a=this._calculateAlignmentPosition(a.x,a.y,c,b)))return{top:void 0!==
a.top?a.top+"px":"auto",left:void 0!==a.left?a.left+"px":"auto",bottom:void 0!==a.bottom?a.bottom+"px":"auto",right:void 0!==a.right?a.right+"px":"auto"}}};L.prototype._viewChange=function(a,b){a&&b&&(this.close(),this.clear())};L.prototype._viewReadyChange=function(a,b){a?(a=this.get("viewModel.view"),this._wireUpView(a)):b&&(this.close(),this.clear())};L.prototype._wireUpView=function(a){this._destroySpinner();a&&(this.spinnerEnabled&&this._createSpinner(a),this._setDockEnabledForViewSize(this.dockOptions))};
L.prototype._dockingThresholdCrossed=function(a,b,c){var p=a[0];a=a[1];var f=b[0];b=b[1];var l=c.width;c=c.height;return p<=l&&f>l||p>l&&f<=l||a<=c&&b>c||a>c&&b<=c};L.prototype._updateDockEnabledForViewSize=function(a,b){if(a&&b){var c=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},p=c.left+c.right,f=c.top+c.bottom,c=[],l=[];c[0]=a[0]-p;c[1]=a[1]-f;l[0]=b[0]-p;l[1]=b[1]-f;a=this.dockOptions;this._dockingThresholdCrossed(c,l,a.breakpoint)&&this._setDockEnabledForViewSize(a);this._setCurrentDockPosition()}};
L.prototype._hasFeatureUpdated=function(){var a=this._containerNode,b=this.viewModel.pendingPromisesCount,c=this.get("selectedPopupRenderer.viewModel.waitingForContent");!a||b||c||(a.classList.remove("esri-popup--feature-updated"),a.offsetHeight,a.classList.add("esri-popup--feature-updated"))};L.prototype._focusDockButtonNode=function(a){this._focusDockButton&&(this._focusDockButton=!1,a.focus())};L.prototype._mainContainerNodeUpdated=function(a){this._mainContainerNode=a;this._focusContainer?(this._focusContainer=
!1,a.focus()):this._blurContainer&&(this._blurContainer=!1,a.blur())};L.prototype._featureMenuNodeUpdated=function(a){(this._featureMenuNode=a)&&this._focusFirstFeature&&(this._focusFirstFeature=!1,a=a.querySelectorAll("li"),a.length&&a[0].focus())};L.prototype._focusFeatureMenuButtonNode=function(a){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,a.focus())};L.prototype._featureMenuViewportNodeUpdated=function(a){a&&(a.scrollTop=0)};L.prototype._toggleScreenLocationEnabled=function(){var a=
this.dockEnabled,b=this.viewModel;b&&(b.screenLocationEnabled=this.visible&&!a)};L.prototype._shouldDockAtCurrentViewSize=function(a){a=a.breakpoint;var b=this.get("viewModel.view.ui"),c=b.width,b=b.height;if(isNaN(c)||isNaN(b))return!1;c=a.hasOwnProperty("width")&&c<=a.width;a=a.hasOwnProperty("height")&&b<=a.height;return c||a};L.prototype._setDockEnabledForViewSize=function(a){a.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(a))};L.prototype._getPageText=function(a,b){return n.substitute({index:b+
1,total:a},D.pageText)};L.prototype._destroySpinner=function(){this._spinner&&(this._spinner.destroy(),this._spinner=null)};L.prototype._createSpinner=function(a){a&&(this._spinner=new F({container:document.createElement("div"),view:a}),a.root.appendChild(this._spinner.container))};L.prototype._closeFeatureMenu=function(){this.featureMenuOpen=!1};L.prototype._toggleCollapsed=function(){this.collapsed=!this.collapsed};L.prototype._close=function(){this.close();this.view&&this.view.focus()};L.prototype._toggleDockEnabled=
function(){this.dockEnabled=!this.dockEnabled;this._focusDockButton=!0;this.scheduleRender()};L.prototype._toggleFeatureMenu=function(){this.featureMenuOpen=!this.featureMenuOpen};L.prototype._triggerAction=function(a){this.viewModel.triggerAction(a.currentTarget["data-action-index"])};L.prototype._selectFeature=function(a){a=a.currentTarget["data-feature-index"];isNaN(a)||(this.viewModel.selectedFeatureIndex=a);this._closeFeatureMenu()};L.prototype._next=function(){this.next()};L.prototype._previous=
function(){this.previous()};a([t.aliasOf("viewModel.actions"),c.renderable()],L.prototype,"actions",void 0);a([t.property()],L.prototype,"alignment",void 0);a([t.aliasOf("viewModel.autoCloseEnabled")],L.prototype,"autoCloseEnabled",void 0);a([t.aliasOf("viewModel.content"),c.renderable()],L.prototype,"content",void 0);a([t.property(),c.renderable()],L.prototype,"collapsed",void 0);a([t.property(),c.renderable()],L.prototype,"collapseEnabled",void 0);a([t.property({readOnly:!0,dependsOn:["dockEnabled",
"alignment"]}),c.renderable()],L.prototype,"currentAlignment",null);a([t.property({readOnly:!0,dependsOn:["dockEnabled","dockOptions"]}),c.renderable()],L.prototype,"currentDockPosition",null);a([t.property(),c.renderable()],L.prototype,"dockOptions",null);a([t.property(),c.renderable()],L.prototype,"dockEnabled",void 0);a([t.aliasOf("viewModel.featureCount"),c.renderable()],L.prototype,"featureCount",void 0);a([t.property(),c.renderable()],L.prototype,"featureMenuOpen",void 0);a([t.aliasOf("viewModel.features"),
c.renderable()],L.prototype,"features",void 0);a([t.property(),c.renderable()],L.prototype,"featureNavigationEnabled",void 0);a([t.aliasOf("viewModel.highlightEnabled")],L.prototype,"highlightEnabled",void 0);a([t.aliasOf("viewModel.location"),c.renderable()],L.prototype,"location",void 0);a([t.property({readOnly:!0}),c.renderable()],L.prototype,"popupRenderers",void 0);a([t.aliasOf("viewModel.promises")],L.prototype,"promises",void 0);a([t.aliasOf("viewModel.selectedFeature"),c.renderable()],L.prototype,
"selectedFeature",void 0);a([t.aliasOf("viewModel.selectedFeatureIndex"),c.renderable()],L.prototype,"selectedFeatureIndex",void 0);a([t.property({readOnly:!0}),c.renderable()],L.prototype,"selectedPopupRenderer",void 0);a([t.property()],L.prototype,"spinnerEnabled",void 0);a([t.aliasOf("viewModel.title"),c.renderable()],L.prototype,"title",void 0);a([t.aliasOf("viewModel.updateLocationEnabled")],L.prototype,"updateLocationEnabled",void 0);a([t.aliasOf("viewModel.view")],L.prototype,"view",void 0);
a([t.property({type:w}),c.renderable("viewModel.screenLocation viewModel.screenLocationEnabled viewModel.state viewModel.pendingPromisesCount viewModel.promiseCount viewModel.waitingForResult".split(" ")),c.vmEvent(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0);a([t.aliasOf("viewModel.visible"),c.renderable()],L.prototype,"visible",void 0);a([t.aliasOf("viewModel.clear")],L.prototype,"clear",null);a([t.aliasOf("viewModel.next")],L.prototype,"next",null);a([t.aliasOf("viewModel.previous")],
L.prototype,"previous",null);a([t.aliasOf("viewModel.triggerAction")],L.prototype,"triggerAction",null);a([c.accessibleHandler()],L.prototype,"_toggleCollapsed",null);a([c.accessibleHandler()],L.prototype,"_close",null);a([c.accessibleHandler()],L.prototype,"_toggleDockEnabled",null);a([c.accessibleHandler()],L.prototype,"_toggleFeatureMenu",null);a([c.accessibleHandler()],L.prototype,"_triggerAction",null);a([c.accessibleHandler()],L.prototype,"_selectFeature",null);a([c.accessibleHandler()],L.prototype,
"_next",null);a([c.accessibleHandler()],L.prototype,"_previous",null);return L=a([t.subclass("esri.widgets.Popup")],L)}(t.declared(y))})},"esri/widgets/Widget":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ../core/Accessor ../core/Evented ../core/HandleRegistry ../core/Logger ../core/watchUtils dojo/_base/lang dojo/dom ./libs/maquette/maquette ../core/Collection".split(" "),function(x,r,k,a,b,c,t,n,f,q,
l,y,B,v){var w=f.getLogger("esri.widgets.Widget"),D=0;return function(c){function f(a,b){a=c.call(this)||this;a._attached=!1;a.className="";a.destroyed=!1;a.domNode=null;a.visible=!0;a._handles=new n;a.render=a.render.bind(a);return a}k(f,c);f.prototype.normalizeCtorArgs=function(a,b){a=l.mixin({},a);b&&(a.container=b);return a};f.prototype.initialize=function(){var a=this;this._handles.add(this._renderableProps.map(function(b){return q.init(a,b,function(a,c){var p=this;v.isCollection(c)&&this._handles.remove(this.declaredClass+
":"+b+"-collection-change-event-listener");v.isCollection(a)&&(a=a.on("change",function(){return p.scheduleRender()}),this._handles.add(a,this.declaredClass+":"+b+"-collection-change-event-listener"));this.scheduleRender()})}));this._delegatedEventNames.length&&this._handles.add(q.init(this,"viewModel",function(){a._get("viewModel")&&a._handles.remove("delegated-events");a._delegatedEventNames.map(function(b){return a.viewModel.on(b,function(c){a.emit(b,c)})})}),"delegated-events");this.postInitialize();
this._handles.add(q.whenOnce(this,"container",function(b){return a._attach(b)}))};f.prototype.postInitialize=function(){};f.prototype.destroy=function(){this.destroyed||(this.viewModel&&this.viewModel.destroy(),this._detach(this.container),this._handles.destroy(),this._set("destroyed",!0))};f.prototype.startup=function(){w.warn("Widget.startup() is deprecated and no longer needed")};Object.defineProperty(f.prototype,"container",{set:function(a){this._get("container")||this._set("container",a)},enumerable:!0,
configurable:!0});f.prototype.castContainer=function(a){return y.byId(a)};Object.defineProperty(f.prototype,"id",{get:function(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+D++},set:function(a){a&&this._set("id",a)},enumerable:!0,configurable:!0});f.prototype.scheduleRender=function(){this._projector.scheduleRender()};f.prototype.on=function(a,b){var c=this.inherited(arguments);this._handles.add(c);return c};f.prototype.own=function(a){1<arguments.length&&
(a=Array.prototype.slice.call(arguments));this._handles.add(a)};f.prototype.renderNow=function(){this._projector.renderNow()};f.prototype._attach=function(a){a&&(this._projector.merge(a,this.render),this._attached=!0)};f.prototype._detach=function(a){a&&this._attached&&(this._projector.detach(this.render),a.parentNode&&a.parentNode.removeChild(a),this._attached=!1)};a([b.shared(B.createProjector())],f.prototype,"_projector",void 0);a([b.shared([])],f.prototype,"_renderableProps",void 0);a([b.shared([])],
f.prototype,"_delegatedEventNames",void 0);a([b.property({value:null})],f.prototype,"container",null);a([b.cast("container")],f.prototype,"castContainer",null);a([b.property({readOnly:!0})],f.prototype,"destroyed",void 0);a([b.property({aliasOf:"container"})],f.prototype,"domNode",void 0);a([b.property({dependsOn:["container"]})],f.prototype,"id",null);a([b.property()],f.prototype,"viewModel",void 0);a([b.property()],f.prototype,"visible",void 0);return f=a([b.subclass("esri.widgets.Widget")],f)}(b.declared(c,
t))})},"esri/widgets/Popup/PopupRenderer":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../support/widget ../Widget ./PopupRendererViewModel ../../core/requireUtils ../support/uriUtils dojo/i18n!./nls/PopupRenderer ../../core/watchUtils dojo/keys".split(" "),function(x,r,k,a,b,c,t,n,f,q,l,y,B){function v(a,b){return void 0===b?"esri-popup-renderer__"+a:"esri-popup-renderer__"+a+"-"+b}return function(w){function D(a){a=
w.call(this)||this;a._chartMap=new Map;a._activeMediaMap=new Map;a._chartRequirePromise=null;a._refreshTimers=new Map;a._mediaInfo=new Map;a.contentEnabled=null;a.graphic=null;a.title=null;a.view=null;a.viewModel=new n;return a}k(D,w);D.prototype.postInitialize=function(){var a=this;this.own(y.init(this,"viewModel.content",function(){return a._setupMediaRefreshTimers()}))};D.prototype.destroy=function(){this._clearMediaRefreshTimers();this._activeMediaMap.clear();this._activeMediaMap=null;this._cancelChartModules();
this._destroyCharts()};D.prototype.render=function(){var a=c.tsx("div",{key:v("loading-container"),class:"esri-popup-renderer__loading-container"},c.tsx("span",{class:c.join("esri-icon-loading-indicator esri-rotating","esri-popup-renderer__loading-spinner")})),a=this.viewModel.waitingForContent?a:this._renderContent();return c.tsx("div",{class:"esri-popup-renderer"},c.tsx("div",{class:"esri-popup-renderer__size-container"},c.tsx("div",{class:"esri-popup-renderer__main-container"},a)))};D.prototype.goToMedia=
function(a,b){this._setContentElementMedia(a,b)};D.prototype.nextMedia=function(a){this._pageContentElementMedia(a,"next")};D.prototype.previousMedia=function(a){this._pageContentElementMedia(a,"previous")};D.prototype._cancelChartModules=function(){this._chartRequirePromise&&this._chartRequirePromise.cancel()};D.prototype._destroyChart=function(a){var b=this._chartMap.get(a);b&&(b.chart.destroy(),b.tooltip.destroy());this._chartMap.delete(a)};D.prototype._destroyCharts=function(){this._chartMap.forEach(function(a){a.chart.destroy();
a.tooltip.destroy()});this._chartMap.clear()};D.prototype._renderContent=function(){this._destroyCharts();var a=this.viewModel.content;if("string"===typeof a)return c.tsx("div",{key:v("content-string"),innerHTML:a});if(a&&a.isInstanceOf&&a.isInstanceOf(t))return c.tsx("div",{key:v("content-widget")},a.render());if(a instanceof HTMLElement)return c.tsx("div",{key:v("content-html-element"),bind:a,afterUpdate:this._attachToNode,afterCreate:this._attachToNode});if(a&&"function"===typeof a.postMixInProperties&&
"function"===typeof a.buildRendering&&"function"===typeof a.postCreate&&"function"===typeof a.startup)return c.tsx("div",{key:v("content-dijit"),bind:a.domNode,afterUpdate:this._attachToNode,afterCreate:this._attachToNode});if(Array.isArray(a))return a.length?c.tsx("div",{key:v("content-content-elements")},a.map(this._renderContentElement,this)):null};D.prototype._renderContentElement=function(a,b){var c=this.viewModel.contentTypes;switch(a.type){case c.attachments:return this._renderAttachments(a,
b);case c.fields:return this._renderFields(a,b);case c.media:return this._renderMedia(a,b);case c.text:return this._renderText(a,b);default:return null}};D.prototype._renderAttachmentInfo=function(a,b){return c.tsx("li",{class:"esri-popup-renderer__attachments-item",key:v("attachment",b)},c.tsx("a",{class:"esri-popup-renderer__attachments-item-link",href:a.url,target:"_blank"},c.tsx("span",{class:c.join("esri-icon-download","esri-popup-renderer__attachments-item-icon")}),c.tsx("span",{class:"esri-popup-renderer__attachments-item-title"},
a.name||l.noTitle)))};D.prototype._renderAttachments=function(a,b){return(a=a.attachmentInfos)&&a.length?c.tsx("div",{key:v("attachments-element"),class:c.join("esri-popup-renderer__attachments","esri-popup-renderer__content-element")},c.tsx("div",{class:"esri-popup-renderer__attachments-title"},l.attach),c.tsx("ul",{class:"esri-popup-renderer__attachments-items"},a.map(this._renderAttachmentInfo))):null};D.prototype._renderFieldInfo=function(a,b){var p=this.viewModel,f=p.formattedAttributes.content[b]||
p.formattedAttributes.global,l=a.fieldName,p=a.label||l;a=!(!a.format||!a.format.dateFormat);f=q.autoLink(null==f[l]?"":f[l]);a=(n={},n["esri-popup-renderer__field-data--date"]=a,n);return c.tsx("tr",{key:v("fields-element-info-row",b)},c.tsx("th",{key:v("fields-element-info-row-header",b),class:"esri-popup-renderer__field-header",innerHTML:p}),c.tsx("td",{key:v("fields-element-info-row-data",b),class:"esri-popup-renderer__field-data",classes:a,innerHTML:f}));var n};D.prototype._renderFields=function(a,
b){var p=this;return(a=a.fieldInfos)?c.tsx("div",{key:v("fields-element",b),class:c.join("esri-popup-renderer__fields","esri-popup-renderer__content-element")},c.tsx("table",{summary:l.fieldsSummary,key:v("fields-element-table",b)},c.tsx("tbody",{key:v("fields-element-table-body",b)},a.map(function(a){return p._renderFieldInfo(a,b)})))):null};D.prototype._shouldOpenInNewTab=function(a){void 0===a&&(a="");return!/^(?:mailto:|tel:)/.test(a.trim().toLowerCase())};D.prototype._clearMediaRefreshTimers=
function(){this._refreshTimers.forEach(function(a){return clearTimeout(a)});this._refreshTimers.clear()};D.prototype._clearMediaRefreshTimer=function(a){var b=this._refreshTimers.get(a);b&&(clearTimeout(b),this._refreshTimers.delete(a))};D.prototype._getImageSource=function(a,b){var c=-1!==a.indexOf("?")?"\x26":"?";a=a.split("#");var f=a[1],f=void 0===f?"":f;return""+a[0]+c+"timestamp\x3d"+b+(f?"#":"")+f};D.prototype._setupMediaRefreshTimer=function(a){var b=this.get("viewModel.content");if(Array.isArray(b)&&
(b=b[a])&&"media"===b.type){var c=this._activeMediaMap.get(a);isNaN(c)&&(c=0);(b=b.mediaInfos[c])&&"image"===b.type&&b.refreshInterval&&this._setRefreshTimeout(a,b)}};D.prototype._setupMediaRefreshTimers=function(){var a=this;this._clearMediaRefreshTimers();var b=this.get("viewModel.content");Array.isArray(b)&&b.forEach(function(b,c){return a._setupMediaRefreshTimer(c)})};D.prototype._updateMediaInfoTimestamp=function(a,b){var c=Date.now();this._mediaInfo.set(b,{timestamp:c,sourceURL:this._getImageSource(a,
c)});this.scheduleRender()};D.prototype._setRefreshTimeout=function(a,b){var c=this,f=b.refreshInterval,l=b.value;f&&(b=6E4*f,this._updateMediaInfoTimestamp(l.sourceURL,a),b=setInterval(function(){c._updateMediaInfoTimestamp(l.sourceURL,a)},b),this._refreshTimers.set(a,b))};D.prototype._renderMediaInfoType=function(a,b){var p=a.value,f=a.title,f=void 0===f?"":f,l=a.type,q=a.refreshInterval,n=p.sourceURL,p=p.linkURL;if("image"===l)return a=this._shouldOpenInNewTab(p)?"_self":"_blank",n=(q=q?this._mediaInfo.get(b):
null)?q.sourceURL:n,b=c.tsx("img",{alt:f,key:v("media-image-"+(q?q.timestamp:0),b),src:n}),(f=p?c.tsx("a",{title:f,href:p,target:a},b):null)?f:b;if(-1!==l.indexOf("chart"))return c.tsx("div",{key:v("chart",b),bind:this,"data-media-info":a,"data-content-element-index":b,class:"esri-popup-renderer__media-chart",afterCreate:this._getChartDependencies,afterUpdate:this._getChartDependencies})};D.prototype._getChartDependencies=function(a){var b=this,c=a["data-media-info"],l=a["data-content-element-index"],
q=c.value,n=q.theme||"Claro",v=c.type,c=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"],t=n;"string"===typeof n&&(t=n.replace(/\./g,"/"),-1===t.indexOf("/")&&(t="dojox/charting/themes/"+t));c.push(t);this._cancelChartModules();this._chartRequirePromise=f.when(x,c).then(function(c){b._renderChart(a,l,v,q,c[0],c[1],c[2]);b._chartRequirePromise=null})};D.prototype._renderChart=function(a,b,c,f,l,q,n){a=new l(a,{margins:{l:4,t:4,r:4,b:4}});n&&a.setTheme(n);switch(c){case "pie-chart":a.addPlot("default",
{type:"Pie",labels:!1});a.addSeries("Series A",f.fields);break;case "line-chart":a.addPlot("default",{type:"Markers"});a.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});a.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});f.fields.forEach(function(a,b){a.x=b+1});a.addSeries("Series A",f.fields);break;case "column-chart":a.addPlot("default",{type:"Columns",gap:3});a.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});a.addSeries("Series A",f.fields);break;
case "bar-chart":a.addPlot("default",{type:"Bars",gap:3}),a.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),a.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),a.addSeries("Series A",f.fields)}c=new q(a);a.render();this._chartMap.set(b,{chart:a,tooltip:c})};D.prototype._renderMediaInfo=function(a,b){this._destroyChart(b);var p=this._renderMediaInfoType(a,b),f=a.title?c.tsx("div",{key:v("media-title",b),class:"esri-popup-renderer__media-item-title",
innerHTML:a.title}):null;a=a.caption?c.tsx("div",{key:v("media-caption",b),class:"esri-popup-renderer__media-item-caption",innerHTML:a.caption}):null;return c.tsx("div",{key:v("media-container",b),class:"esri-popup-renderer__media-item-container"},c.tsx("div",{key:v("media-item-container",b),class:"esri-popup-renderer__media-item"},p),f,a)};D.prototype._renderMediaStatsItem=function(a,b,p){p="chart"===p?c.join("esri-popup-renderer__media-chart-icon","esri-icon-chart"):c.join("esri-popup-renderer__media-image-icon",
"esri-icon-media");return c.tsx("li",{class:"esri-popup-renderer__media-image-summary"},c.tsx("span",{class:"esri-popup-renderer__media-count","aria-label":a},"("+b+")"),c.tsx("span",{"aria-hidden":"true",class:p}))};D.prototype._renderMediaPageButton=function(a,b){var p=(a="previous"===a)?l.previous:l.next,f=a?c.join("esri-popup-renderer__button","esri-popup-renderer__media-previous"):c.join("esri-popup-renderer__button","esri-popup-renderer__media-next"),q=a?c.join("esri-popup-renderer__icon","esri-popup-renderer__media-previous-icon",
"esri-icon-left-triangle-arrow"):c.join("esri-popup-renderer__icon","esri-popup-renderer__media-next-icon","esri-icon-right-triangle-arrow"),n=a?c.join("esri-popup-renderer__icon","esri-popup-renderer__media-previous-icon--rtl","esri-icon-right-triangle-arrow"):c.join("esri-popup-renderer__icon","esri-popup-renderer__media-next-icon--rtl","esri-icon-left-triangle-arrow"),t=a?this._previousClick:this._nextClick;return c.tsx("div",{key:v(a?"previous":"next",b),title:p,tabIndex:0,role:"button",class:f,
"data-content-element-index":b,bind:this,onkeydown:t,onclick:t},c.tsx("span",{"aria-hidden":"true",class:q}),c.tsx("span",{"aria-hidden":"true",class:n}),c.tsx("span",{class:"esri-icon-font-fallback-text"},p))};D.prototype._handleMediaKeyup=function(a){var b=a.currentTarget["data-content-element-index"],c=a.keyCode;c===B.LEFT_ARROW&&(a.stopPropagation(),this.previousMedia(b));c===B.RIGHT_ARROW&&(a.stopPropagation(),this.nextMedia(b))};D.prototype._renderMedia=function(a,b){a=a.mediaInfos;var p=this._getMediaStats(a),
f=p.total,q=(n={},n["esri-popup-renderer--media-pagination-visible"]=1<p.total,n),n=this._renderMediaStatsItem(l.numImages,p.images,"image"),p=this._renderMediaStatsItem(l.numCharts,p.charts,"chart"),t=this._renderMediaPageButton("previous",b),k=this._renderMediaPageButton("next",b),y=this._activeMediaMap.get(b);isNaN(y)&&(this._activeMediaMap.set(b,0),y=0);return f?c.tsx("div",{key:v("media-element",b),"data-content-element-index":b,bind:this,onkeyup:this._handleMediaKeyup,class:c.join("esri-popup-renderer__media",
"esri-popup-renderer__content-element"),classes:q},c.tsx("ul",{class:"esri-popup-renderer__media-summary"},n,p),c.tsx("div",{key:v("media-element-container",b),class:"esri-popup-renderer__media-container"},t,this._renderMediaInfo(a[y],b),k)):null;var n};D.prototype._renderText=function(a,b){return a.text?c.tsx("div",{key:v("text-element",b),innerHTML:a.text,class:c.join("esri-popup-renderer__text","esri-popup-renderer__content-element")}):null};D.prototype._attachToNode=function(a){a.appendChild(this)};
D.prototype._getMediaStats=function(a){var b=0,c=0;a.forEach(function(a){a=a.type;"image"===a?b++:-1!==a.indexOf("chart")&&c++});return{total:c+b,images:b,charts:c}};D.prototype._setContentElementMedia=function(a,b){this._clearMediaRefreshTimer(a);var c=this.viewModel.content;(c=(c=c&&c[a])&&c.mediaInfos)&&c.length&&(this._activeMediaMap.set(a,(b+c.length)%c.length),this._setupMediaRefreshTimer(a),this.scheduleRender())};D.prototype._pageContentElementMedia=function(a,b){b="previous"===b?-1:1;b=this._activeMediaMap.get(a)+
b;this._setContentElementMedia(a,b)};D.prototype._previousClick=function(a){this.previousMedia(a.currentTarget["data-content-element-index"])};D.prototype._nextClick=function(a){this.nextMedia(a.currentTarget["data-content-element-index"])};a([b.aliasOf("viewModel.contentEnabled")],D.prototype,"contentEnabled",void 0);a([b.aliasOf("viewModel.graphic")],D.prototype,"graphic",void 0);a([b.aliasOf("viewModel.title")],D.prototype,"title",void 0);a([b.aliasOf("viewModel.view")],D.prototype,"view",void 0);
a([b.property({type:n}),c.renderable(["viewModel.waitingForContent","viewModel.content"])],D.prototype,"viewModel",void 0);a([c.accessibleHandler()],D.prototype,"_previousClick",null);a([c.accessibleHandler()],D.prototype,"_nextClick",null);return D=a([b.subclass("esri.widgets.Popup.PopupRenderer")],D)}(b.declared(t))})},"esri/widgets/Popup/PopupRendererViewModel":function(){define("../Widget ../../core/Accessor ../../core/date ../../core/Error ../../core/HandleRegistry ../../core/lang ../../core/Logger ../../core/urlUtils ../../core/promiseUtils ../../core/watchUtils ../../request ../../support/arcadeUtils ../../tasks/support/StatisticDefinition ../../tasks/support/Query ../../tasks/QueryTask dojo/promise/all dojo/i18n!dojo/cldr/nls/number dojox/html/entities".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G){var p=/\'/g,z=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/ig,A=/^\s*expression\//i,J=/(\{([^\{\r\n]+)\})/g,I={attachments:"attachments",fields:"fields",media:"media",text:"text"},K=t.getLogger("esri.widgets.Popup.PopupRendererViewModel");return r.createSubclass({declaredClass:"esri.widgets.Popup.PopupRendererViewModel",properties:{content:{readOnly:!0},contentEnabled:!0,contentTypes:{readOnly:!0},formattedAttributes:{readOnly:!0},graphic:{},title:{readOnly:!0},
view:{},waitingForContent:{readOnly:!0}},constructor:function(){this._handles=new b},initialize:function(){this._handles.add([q.watch(this,["graphic","graphic.popupTemplate.title","graphic.popupTemplate.content","graphic.popupTemplate.fieldInfos","contentEnabled"],function(){this._updateGraphic(this.graphic,this.contentEnabled)}.bind(this))]);this._updateGraphic(this.graphic,this.contentEnabled)},destroy:function(){this._handles.destroy();this._handles=null;this._clearRelatedInfo();this._cancelPromises();
this.graphic=null;this._set("title",null);this._set("content",null);this._set("waitingForContent",null)},content:null,contentEnabled:!0,contentTypes:I,formattedAttributes:null,graphic:null,title:"",view:null,waitingForContent:!1,_handles:null,_contentPromise:null,_contentElementPromises:null,_relatedRecordsPromise:null,_relatedRecordsQueryPromises:[],_relatedLayersInfo:null,_relatedInfo:null,_addValuesToHref:function(a,b,p,f){b=this._trimString(b);return c.substitute(b&&"{"===b[0]?p:f,a)},_cancelPromises:function(){this._contentElementPromises&&
(this._contentElementPromises.forEach(function(a){a.cancel()},this),this._contentElementPromises=null);this._contentPromise&&(this._contentPromise.cancel(),this._contentPromise=null);this._relatedRecordsQueryPromises.forEach(function(a){a.cancel()});this._relatedRecordsQueryPromises.length=0;this._relatedRecordsPromise&&(this._relatedRecordsPromise.cancel(),this._relatedRecordsPromise=null)},_clearRelatedInfo:function(){this._relatedInfo=this._relatedLayersInfo=null},_compileContent:function(b,c){var p=
b.content;if(p&&(p.nodeName||p&&p&&"function"===typeof p.postMixInProperties&&"function"===typeof p.buildRendering&&"function"===typeof p.postCreate&&"function"===typeof p.startup||p&&p.isInstanceOf&&p.isInstanceOf(x)))return p;if("string"===typeof p)return this._compileText(b,{type:I.text,text:p}).text;if(Array.isArray(p))return p.map(function(a,p){p=(p=c&&c[p])&&p.value;switch(a.type){case I.attachments:return this._proxyAttachments(a,p);case I.fields:return this._compileFields(b,a);case I.media:return this._compileMedia(b,
a);case I.text:return this._compileText(b,a)}},this);if(p)try{throw new a(this.declaredClass+"::invalid content type.");}catch(U){K.warn(U.stack)}},_compileFields:function(a,b){b=c.clone(b);var p=(a=a.template)&&a.expressionInfos;a=a&&c.clone(a.fieldInfos);a=b.fieldInfos||a;var f=[];a&&a.forEach(function(a){var b=a.fieldName.toLowerCase();if(!a.hasOwnProperty("visible")||a.visible)b=this._isExpressionField(b)?this._getExpressionInfo(p,b):null,a.label=b?b.title:a.label,f.push(a)},this);b.fieldInfos=
f;return b},_compileMedia:function(a,b){b=c.clone(b);var p=b.mediaInfos,f=a.attributes,l=a.layer,q=this.formattedAttributes.global,n=a.substOptions,z,A;p&&(z=[],p.forEach(function(h){A=0;var b=h.value;switch(h.type){case "image":var p=b.sourceURL,p=p&&this._trimString(c.substitute(f,this._fixTokens(p,l)));A=!!p;break;case "pie-chart":case "line-chart":case "column-chart":case "bar-chart":var e,p=b.normalizeField;b.fields=b.fields.map(function(d){return(e=this._getLayerFieldInfo(l,d))?e.name:d},this);
p&&(e=this._getLayerFieldInfo(l,p),b.normalizeField=e?e.name:p);A=b.fields.some(function(d){return c.isDefined(f[d])||-1!==d.indexOf("relationships/")&&this._relatedInfo},this);break;default:return}if(A){h=c.clone(h);var b=h.value,p=h.title?this._processFieldsInLinks(this._fixTokens(h.title,l),f):"",d=h.caption?this._processFieldsInLinks(this._fixTokens(h.caption,l),f):"";h.title=p?this._trimString(c.substitute(q,p,n)):"";h.caption=d?this._trimString(c.substitute(q,d,n)):"";if("image"===h.type)b.sourceURL=
c.substitute(f,this._fixTokens(b.sourceURL,l)),b.linkURL&&(b.linkURL=this._trimString(c.substitute(f,this._fixTokens(b.linkURL,l))));else{var g,m=(p=a.template)&&p.fieldInfos;b.fields.forEach(function(d,e){if(-1!==d.indexOf("relationships/"))d=this._getRelatedChartInfos(l,m,d,b,f,n),Array.isArray(d)?b.fields=d:b.fields[e]=d;else{var u=f[d],u=void 0===u?null:u;g=f[b.normalizeField]||0;u&&g&&(u/=g);var C=m&&this._getFieldInfo(m,d);b.fields[e]={y:u,tooltip:(C&&C.label||d)+":"+this._formatValue(u,{fieldInfos:m,
fieldName:d,layer:l,substOptions:n,preventPlacesFormatting:!!g})}}},this)}z.push(h)}},this));b.mediaInfos=z;return b},_compileText:function(a,b){if((b=c.clone(b))&&b.text){var p=a.attributes,f=this.formattedAttributes.global,l=a.substOptions;a=this._processFieldsInLinks(this._fixTokens(b.text,a.layer),p);b.text=this._trimString(c.substitute(f,a,l))}return b},_compileTitle:function(a){var b="",p=a.title,f=a.layer,l=a.attributes,q=a.substOptions,n=this.formattedAttributes.global;p&&("function"===typeof p&&
(p=p.call(null,{graphic:a.graphic})),"string"===typeof p&&(a=this._processFieldsInLinks(this._fixTokens(p,f),l),b=this._trimString(c.substitute(n,a,q))));return b},_getExpressionInfo:function(a,b){if(this._isExpressionField(b)){b=b.replace(A,"");b=b.toLowerCase();var c;a.some(function(a){a.name.toLowerCase()===b&&(c=a);return!!c});return c}},_createGraphicInfo:function(a,b){var p=a.popupTemplate,f=p&&p.title,l=p&&p.content,q=a.layer,n=q&&q._getDateOpts&&q._getDateOpts().properties,z=c.clone(a.attributes)||
{},A={dateFormat:{properties:n,formatter:"DateFormat"+k.getFormat("short-date-short-time")}};return{graphic:a,template:p,title:f,content:l,contentEnabled:b,layer:q,attributes:z,properties:n,substOptions:A}},_fixTokens:function(a,b){return a.replace(J,function(a,c,p){return(a=this._getLayerFieldInfo(b,p))?"{"+a.name+"}":c}.bind(this))},_encodeAttributes:function(a){var b=c.clone(a)||{};Object.keys(b).forEach(function(a){var c=b[a];"string"===typeof c&&(c=encodeURIComponent(c).replace(p,"\x26apos;"),
b[a]=c)});return b},_formatAttributesToFieldInfos:function(a,b,c,p,f){a.forEach(function(l){var q=l.fieldName,n=this._getLayerFieldInfo(b,q);n&&(q=l.fieldName=n.name);f[q]=this._formatValue(f[q],{fieldInfos:a,fieldName:q,layer:b,substOptions:c});p&&l.format&&l.format.dateFormat&&(l=p.indexOf(q),-1<l&&p.splice(l,1))},this)},_getArcadeViewingMode:function(a){return a&&"local"===a.viewingMode?"localScene":"globalScene"},_formatAttributes:function(a,b,p,f,l,q,n,z){var A=c.clone(l);n&&n.forEach(function(h){var a=
"expression/"+h.name;h=z[h.name];var e=this.view,e=e&&y.getViewInfo({viewingMode:"3d"===e.type?this._getArcadeViewingMode(e):"map",scale:e.scale,spatialReference:e.spatialReference});h=y.executeFunction(h&&h.compiledFunc,y.createExecContext(q,e));"string"===typeof h&&(h=G.encode(h));A[a]=h},this);this._relatedInfo&&Object.keys(this._relatedInfo).forEach(function(h){var a=this._relatedInfo[h];h=this._relatedLayersInfo[h];a&&(a.relatedFeatures.forEach(this._relatedFeaturesAttributes.bind(this,h,l,A)),
a.relatedStatsFeatures.forEach(this._relatedStatsAttributes.bind(this,h,l,A)))},this);a&&this._formatAttributesToFieldInfos(a,b,p,f,A);if(b){var h=b.typeIdField;Object.keys(l).forEach(function(a){if(-1===a.indexOf("relationships/")){var p=l[a];if(c.isDefined(p)){var e=this._getDomainName(b,q,a,p);c.isDefined(e)?A[a]=e:a===h&&(p=this._getTypeName(b,q,p),c.isDefined(p)&&(A[a]=p))}}},this)}return A},_formatValue:function(a,b){var p=b.fieldInfos,f=b.fieldName,l=b.substOptions,p=p&&this._getFieldInfo(p,
f),q=c.clone(p),p=b.preventPlacesFormatting;(b=this._getLayerFieldInfo(b.layer,f))&&"date"===b.type&&(b=q.format||{},b.dateFormat=b.dateFormat||"short-date-short-time",q.format=b);b=q&&q.format;f="number"===typeof a&&l.dateFormat.properties&&-1===l.dateFormat.properties.indexOf(f)&&(!b||!b.dateFormat);if(!c.isDefined(a)||!q||!c.isDefined(b))return f?this._forceLTR(a):a;var n="",z=[],q=b.hasOwnProperty("places")||b.hasOwnProperty("digitSeparator"),A=b.hasOwnProperty("digitSeparator")?b.digitSeparator:
!0;if(q)n="NumberFormat",c.isDefined(b.places)&&(!p||0<b.places)&&(z.push("places: "+Number(b.places)),n+="("+z.join(",")+")");else if(b.dateFormat)n="DateFormat"+k.getFormat(b.dateFormat)||k.getFormat("short-date-short-time");else return f?this._forceLTR(a):a;a=c.substitute({myKey:a},"{myKey:"+n+"}",l)||"";q&&!A&&F.group&&(a=a.replace(new RegExp("\\"+F.group,"g"),""));return f?this._forceLTR(a):a},_forceLTR:function(a){return"\x26lrm;"+a},_getDomainName:function(a,b,c,p){return(a=a.getFieldDomain&&
a.getFieldDomain(c,{feature:b}))&&a.codedValues?a.getName(p):null},_getFieldInfo:function(a,b){b=b.toLowerCase();for(var c,p=0;p<a.length;p++){var f=a[p];if(f.fieldName&&f.fieldName.toLowerCase()===b){c=f;break}}return c},_getLayerFieldInfo:function(a,b){return b&&a&&a.getField?a.getField(b):null},_getTypeName:function(a,b){return(a=a.getType&&a.getType(b))&&a.name},_processFieldsInLinks:function(a,b){var c=this._encodeAttributes(b);a&&(a=a.replace(z,function(a,p,f){return this._addValuesToHref(a,
p||f,b,c)}.bind(this)));return a},_proxyAttachments:function(b,p){b=c.clone(b);p&&!(p instanceof a)&&p.attachmentInfos&&p.attachmentInfos.length&&(p=p.attachmentInfos.map(function(a){a.url=n.addProxy(a.url);return a},this),b.attachmentInfos=p);return b},_queryAttachments:function(a){var b=a.layer;if(!b)return f.resolve();"scene"===b.type&&b.associatedLayer&&(b=b.associatedLayer);var c=a.attributes;a=b&&b.objectIdField;c=c&&a&&c[a];if(a&&b.get("capabilities.data.supportsAttachment")&&c)return this._queryAttachmentInfos(b,
c)},_queryAttachmentInfos:function(a,b){var c=a.url+"/"+a.layerId+"/"+b+"/attachments",p=a.token||"";return l(c,{query:{f:"json",token:p},callbackParamName:"callback"}).then(function(a){a=a.data;a.attachmentInfos.forEach(function(a){a.url=c+"/"+a.id;p&&(a.url+="?token\x3d"+p);a.objectId=b});return a})},_queryContentElements:function(a){var b=a.content;if(!b||!Array.isArray(b))return f.resolve();var c=[],p={};b.forEach(function(b,f){b.type===I.attachments&&(b=this._queryAttachments(a))&&(p[f]=b,c.push(b))},
this);this._contentElementPromises=c;return 0===c.length?f.resolve():f.eachAlways(p).always(function(a){this._contentElementPromises=null;return a}.bind(this))},_trimString:function(a){return(a||"").trim()},_getContent:function(a){var b=a.template,b=b&&b.content;"function"===typeof b&&(b=b.call(null,{graphic:a.graphic}));return b&&"function"===typeof b.then?b:f.resolve(b)},_updateContent:function(a){var b;return a.contentEnabled?this._contentPromise=b=this._getContent(a).then(function(b){a.content=
b;return this._queryContentElements(a)}.bind(this)).then(function(b){this._set("content",this._compileContent(a,b))}.bind(this)).otherwise(function(a){K.log("error loading template",a)}.bind(this)).then(function(){this._contentPromise=null}.bind(this)):b=f.resolve()},_isExpressionField:function(a){return A.test(a)},_compileExpressions:function(a){if(a){var b={};a.forEach(function(a){b[a.name]={compiledFunc:y.createFunction(a.expression)}});return b}},_createFormattedAttributes:function(a){var b=a.graphic,
c=a.attributes,p=a.layer,f=a.template,l=f&&f.fieldInfos,q=f&&f.expressionInfos,n=this._compileExpressions(q),z=a.substOptions,h=a.properties,A={global:this._formatAttributes(l,p,z,h,c,b,q,n),content:[]};a=f&&f.content;Array.isArray(a)&&a.forEach(function(a,e){a.type===I.fields&&a.fieldInfos&&(A.content[e]=this._formatAttributes(a.fieldInfos,p,z,h,c,b,q,n))},this);return A},_queryGraphicInfo:function(a,b){var c=this._createGraphicInfo(a,b);return this._checkForRelatedRecords(c).then(function(){this._set("formattedAttributes",
this._createFormattedAttributes(c));this._set("title",this._compileTitle(c));return this._updateContent(c)}.bind(this))},_updateGraphic:function(a,b){this._handles&&(this._clearRelatedInfo(),this._cancelPromises(),this._set("title",""),this._set("content",null),this._set("formattedAttributes",null),this._set("waitingForContent",!1),a&&(this._set("waitingForContent",!0),this._relatedRecordsPromise=this._queryGraphicInfo(a,b).always(function(){this._relatedRecordsPromise=null;this._relatedRecordsQueryPromises.length=
0;this._set("waitingForContent",!1)}.bind(this))))},_getAllFieldInfos:function(a){var b=[],c=a.template,p=c&&c.fieldInfos;a=a.contentEnabled;p&&(b=b.concat(p));a&&(c=c&&c.content,Array.isArray(c)&&c.forEach(function(a){b=b.concat(a&&a.fieldInfos)},this));return b},_checkForRelatedRecords:function(a){var b=this._getAllFieldInfos(a).filter(function(a){return a&&a.fieldName&&-1!==a.fieldName.indexOf("relationships/")},this);return a.layer&&b&&0<b.length?this._getRelatedRecords({graphic:a.graphic,fieldsInfo:b}):
f.resolve()},_relatedFeaturesAttributes:function(a,b,c,p){Object.keys(p.attributes).forEach(function(f){if("esriRelCardinalityOneToOne"===a.relation.cardinality){var l=this._toRelatedFieldName([a.relation.id,f]);b[l]=c[l]=p.attributes[f]}},this)},_relatedStatsAttributes:function(a,b,c,p){Object.keys(p.attributes).forEach(function(f){var l=this._toRelatedFieldName([a.relation.id,f]);b[l]=c[l]=p.attributes[f]},this)},_getRelatedChartInfos:function(a,b,c,p,f,l){var q,n,z,h,A,t;q=[];t=this._fromRelatedFieldName(c);
A=t[0];n=this._relatedInfo[A];A=this._relatedLayersInfo[A];n&&n.relatedFeatures.forEach(function(e){var d=e.attributes,g;Object.keys(d).forEach(function(m){if(m===t[1]){g={};h=d[m];p.normalizeField&&(z=-1!==p.normalizeField.indexOf("relationships/")?d[this._fromRelatedFieldName(p.normalizeField)[1]]:f[p.normalizeField]);h&&z&&(h/=z);if(p.tooltipField)if(-1!==p.tooltipField.indexOf("relationships/"))m=this._fromRelatedFieldName(p.tooltipField)[1],m=d[m],g.tooltip=m+": "+this._formatValue(h,{fieldInfos:b,
fieldName:m,layer:a,substOptions:l,preventPlacesFormatting:!!z});else{if(m=this._getLayerFieldInfo(a,c))c=m.name;g.tooltip=c+": "+this._formatValue(h,{fieldInfos:b,fieldName:p.tooltipField,layer:a,substOptions:l,preventPlacesFormatting:!!z})}else g.tooltip=h;g.y=h;q.push(g)}},this)},this);return"esriRelCardinalityOneToMany"===A.relation.cardinality||"esriRelCardinalityManyToMany"===A.relation.cardinality?q:q[0]},_getRelatedRecords:function(a){var b=a.graphic;return this._relatedLayersInfo?this._queryRelatedLayers(b).then(function(a){this._setRelatedRecords(a);
return a}.bind(this)):this._getRelatedLayersInfo(a).then(function(a){Object.keys(a).forEach(function(b){a[b]&&(this._relatedLayersInfo[b].relatedLayerInfo=a[b].data)},this);return this._queryRelatedLayers(b).then(function(a){this._setRelatedRecords(a);return a}.bind(this))}.bind(this))},_getRelatedLayersInfo:function(a){var b=a.fieldsInfo,c,p={};c=a.graphic.layer;this._relatedLayersInfo||(this._relatedLayersInfo={});b.forEach(function(a){var b,p,f;b=this._fromRelatedFieldName(a.fieldName);p=b[0];
b=b[1];if(p){if(!this._relatedLayersInfo[p]){var l=c&&c.relationships;l&&l.some(function(h){if(h.id==p)return f=h,!0});f&&(this._relatedLayersInfo[p]={relation:f,relatedFields:[],outStatistics:[]})}this._relatedLayersInfo[p]&&(this._relatedLayersInfo[p].relatedFields.push(b),a.statisticType&&(a=new B({statisticType:a.statisticType,onStatisticField:b,outStatisticFieldName:b}),this._relatedLayersInfo[p].outStatistics.push(a)))}},this);Object.keys(this._relatedLayersInfo).forEach(function(a){var b;this._relatedLayersInfo[a]&&
(b=this._relatedLayersInfo[a].relation,b=c.url+"/"+b.relatedTableId,this._relatedLayersInfo[a].relatedLayerUrl=b,p[a]=l(b,{query:{f:"json"},callbackParamName:"callback"}))},this);return D(p)},_queryRelatedLayers:function(a){var b={};Object.keys(this._relatedLayersInfo).forEach(function(c){b[c]=this._queryRelatedLayer({graphic:a,relatedInfo:this._relatedLayersInfo[c]})},this);return D(b)},_queryRelatedLayer:function(a){var b,c,p,f,l,q,n,z,h;b=a.graphic;c=b.layer.layerId;n=a.relatedInfo;a=n.relatedLayerInfo;
z=n.relatedLayerUrl;h=n.relation;a&&a.relationships&&a.relationships.some(function(h){if(h.relatedTableId===parseInt(c,10))return p=h,!0});p&&(a.fields.some(function(h){if(h.name===p.keyField)return f=-1!==["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"].indexOf(h.type)?"number":"string",!0}),l="string"===f?p.keyField+"\x3d'"+b.attributes[h.keyField]+"'":p.keyField+"\x3d"+b.attributes[h.keyField],l=new v({where:l,outFields:n.relatedFields}),n.outStatistics&&
0<n.outStatistics.length&&a.supportsStatistics&&(q=new v({where:l.where,outFields:l.outFields,outStatistics:n.outStatistics})),a=new w({url:z}),l=[a.execute(l)],q&&l.push(a.execute(q)));this._relatedRecordsQueryPromises=this._relatedRecordsQueryPromises.concat(l);return D(l)},_setRelatedRecords:function(a){this._relatedInfo=[];Object.keys(a).forEach(function(b){if(a[b]){var p=a[b];this._relatedInfo[b]={relatedFeatures:p[0].features};c.isDefined(p[1])&&(this._relatedInfo[b].relatedStatsFeatures=p[1].features)}},
this)},_fromRelatedFieldName:function(a){return-1!==a.indexOf("relationships/")?a.split("/").slice(1):[]},_toRelatedFieldName:function(a){return a&&0<a.length?"relationships/"+a[0]+"/"+a[1]:""}})})},"dojox/html/entities":function(){define(["dojo/_base/lang"],function(x){var r=x.getObject("dojox.html.entities",!0),k=function(a,c){var b,n;if(c._encCache&&c._encCache.regexp&&c._encCache.mapper&&c.length==c._encCache.length)b=c._encCache.mapper,n=c._encCache.regexp;else{b={};n=["["];var f;for(f=0;f<c.length;f++)b[c[f][0]]=
"\x26"+c[f][1]+";",n.push(c[f][0]);n.push("]");n=new RegExp(n.join(""),"g");c._encCache={mapper:b,regexp:n,length:c.length}}return a=a.replace(n,function(a){return b[a]})},a=function(a,c){var b,n;if(c._decCache&&c._decCache.regexp&&c._decCache.mapper&&c.length==c._decCache.length)b=c._decCache.mapper,n=c._decCache.regexp;else{b={};n=["("];var f;for(f=0;f<c.length;f++){var q="\x26"+c[f][1]+";";f&&n.push("|");b[q]=c[f][0];n.push(q)}n.push(")");n=new RegExp(n.join(""),"g");c._decCache={mapper:b,regexp:n,
length:c.length}}return a=a.replace(n,function(a){return b[a]})};r.html=[["\x26","amp"],['"',"quot"],["\x3c","lt"],["\x3e","gt"],["\u00a0","nbsp"]];r.latin=[["\u00a1","iexcl"],["\u00a2","cent"],["\u00a3","pound"],["\u20ac","euro"],["\u00a4","curren"],["\u00a5","yen"],["\u00a6","brvbar"],["\u00a7","sect"],["\u00a8","uml"],["\u00a9","copy"],["\u00aa","ordf"],["\u00ab","laquo"],["\u00ac","not"],["\u00ad","shy"],["\u00ae","reg"],["\u00af","macr"],["\u00b0","deg"],["\u00b1","plusmn"],["\u00b2","sup2"],
["\u00b3","sup3"],["\u00b4","acute"],["\u00b5","micro"],["\u00b6","para"],["\u00b7","middot"],["\u00b8","cedil"],["\u00b9","sup1"],["\u00ba","ordm"],["\u00bb","raquo"],["\u00bc","frac14"],["\u00bd","frac12"],["\u00be","frac34"],["\u00bf","iquest"],["\u00c0","Agrave"],["\u00c1","Aacute"],["\u00c2","Acirc"],["\u00c3","Atilde"],["\u00c4","Auml"],["\u00c5","Aring"],["\u00c6","AElig"],["\u00c7","Ccedil"],["\u00c8","Egrave"],["\u00c9","Eacute"],["\u00ca","Ecirc"],["\u00cb","Euml"],["\u00cc","Igrave"],["\u00cd",
"Iacute"],["\u00ce","Icirc"],["\u00cf","Iuml"],["\u00d0","ETH"],["\u00d1","Ntilde"],["\u00d2","Ograve"],["\u00d3","Oacute"],["\u00d4","Ocirc"],["\u00d5","Otilde"],["\u00d6","Ouml"],["\u00d7","times"],["\u00d8","Oslash"],["\u00d9","Ugrave"],["\u00da","Uacute"],["\u00db","Ucirc"],["\u00dc","Uuml"],["\u00dd","Yacute"],["\u00de","THORN"],["\u00df","szlig"],["\u00e0","agrave"],["\u00e1","aacute"],["\u00e2","acirc"],["\u00e3","atilde"],["\u00e4","auml"],["\u00e5","aring"],["\u00e6","aelig"],["\u00e7","ccedil"],
["\u00e8","egrave"],["\u00e9","eacute"],["\u00ea","ecirc"],["\u00eb","euml"],["\u00ec","igrave"],["\u00ed","iacute"],["\u00ee","icirc"],["\u00ef","iuml"],["\u00f0","eth"],["\u00f1","ntilde"],["\u00f2","ograve"],["\u00f3","oacute"],["\u00f4","ocirc"],["\u00f5","otilde"],["\u00f6","ouml"],["\u00f7","divide"],["\u00f8","oslash"],["\u00f9","ugrave"],["\u00fa","uacute"],["\u00fb","ucirc"],["\u00fc","uuml"],["\u00fd","yacute"],["\u00fe","thorn"],["\u00ff","yuml"],["\u0192","fnof"],["\u0391","Alpha"],["\u0392",
"Beta"],["\u0393","Gamma"],["\u0394","Delta"],["\u0395","Epsilon"],["\u0396","Zeta"],["\u0397","Eta"],["\u0398","Theta"],["\u0399","Iota"],["\u039a","Kappa"],["\u039b","Lambda"],["\u039c","Mu"],["\u039d","Nu"],["\u039e","Xi"],["\u039f","Omicron"],["\u03a0","Pi"],["\u03a1","Rho"],["\u03a3","Sigma"],["\u03a4","Tau"],["\u03a5","Upsilon"],["\u03a6","Phi"],["\u03a7","Chi"],["\u03a8","Psi"],["\u03a9","Omega"],["\u03b1","alpha"],["\u03b2","beta"],["\u03b3","gamma"],["\u03b4","delta"],["\u03b5","epsilon"],
["\u03b6","zeta"],["\u03b7","eta"],["\u03b8","theta"],["\u03b9","iota"],["\u03ba","kappa"],["\u03bb","lambda"],["\u03bc","mu"],["\u03bd","nu"],["\u03be","xi"],["\u03bf","omicron"],["\u03c0","pi"],["\u03c1","rho"],["\u03c2","sigmaf"],["\u03c3","sigma"],["\u03c4","tau"],["\u03c5","upsilon"],["\u03c6","phi"],["\u03c7","chi"],["\u03c8","psi"],["\u03c9","omega"],["\u03d1","thetasym"],["\u03d2","upsih"],["\u03d6","piv"],["\u2022","bull"],["\u2026","hellip"],["\u2032","prime"],["\u2033","Prime"],["\u203e",
"oline"],["\u2044","frasl"],["\u2118","weierp"],["\u2111","image"],["\u211c","real"],["\u2122","trade"],["\u2135","alefsym"],["\u2190","larr"],["\u2191","uarr"],["\u2192","rarr"],["\u2193","darr"],["\u2194","harr"],["\u21b5","crarr"],["\u21d0","lArr"],["\u21d1","uArr"],["\u21d2","rArr"],["\u21d3","dArr"],["\u21d4","hArr"],["\u2200","forall"],["\u2202","part"],["\u2203","exist"],["\u2205","empty"],["\u2207","nabla"],["\u2208","isin"],["\u2209","notin"],["\u220b","ni"],["\u220f","prod"],["\u2211","sum"],
["\u2212","minus"],["\u2217","lowast"],["\u221a","radic"],["\u221d","prop"],["\u221e","infin"],["\u2220","ang"],["\u2227","and"],["\u2228","or"],["\u2229","cap"],["\u222a","cup"],["\u222b","int"],["\u2234","there4"],["\u223c","sim"],["\u2245","cong"],["\u2248","asymp"],["\u2260","ne"],["\u2261","equiv"],["\u2264","le"],["\u2265","ge"],["\u2282","sub"],["\u2283","sup"],["\u2284","nsub"],["\u2286","sube"],["\u2287","supe"],["\u2295","oplus"],["\u2297","otimes"],["\u22a5","perp"],["\u22c5","sdot"],["\u2308",
"lceil"],["\u2309","rceil"],["\u230a","lfloor"],["\u230b","rfloor"],["\u2329","lang"],["\u232a","rang"],["\u25ca","loz"],["\u2660","spades"],["\u2663","clubs"],["\u2665","hearts"],["\u2666","diams"],["\u0152","OElig"],["\u0153","oelig"],["\u0160","Scaron"],["\u0161","scaron"],["\u0178","Yuml"],["\u02c6","circ"],["\u02dc","tilde"],["\u2002","ensp"],["\u2003","emsp"],["\u2009","thinsp"],["\u200c","zwnj"],["\u200d","zwj"],["\u200e","lrm"],["\u200f","rlm"],["\u2013","ndash"],["\u2014","mdash"],["\u2018",
"lsquo"],["\u2019","rsquo"],["\u201a","sbquo"],["\u201c","ldquo"],["\u201d","rdquo"],["\u201e","bdquo"],["\u2020","dagger"],["\u2021","Dagger"],["\u2030","permil"],["\u2039","lsaquo"],["\u203a","rsaquo"]];r.encode=function(a,c){a&&(c?a=k(a,c):(a=k(a,r.html),a=k(a,r.latin)));return a};r.decode=function(b,c){b&&(c?b=a(b,c):(b=a(b,r.html),b=a(b,r.latin)));return b};return r})},"esri/widgets/support/uriUtils":function(){define(["require","exports","../../core/lang","dojo/i18n!./nls/uriUtils"],function(x,
r,k,a){function b(a){var b=null;c.some(function(c){c.pattern.test(a)&&(b=c);return!!b});return b}Object.defineProperty(r,"__esModule",{value:!0});var c=[{id:"http",pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:a.view},{id:"tel",pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{id:"mailto",pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{id:"arcgis-appstudio-player",pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"App Studio Player"},
{id:"arcgis-collector",pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Collector"},{id:"arcgis-explorer",pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Explorer"},{id:"arcgis-navigator",pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Navigator"},{id:"arcgis-survey123",pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Survey123"},{id:"arcgis-trek2there",pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,
label:a.openInApp,appName:"Trek2There"},{id:"arcgis-workforce",pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:a.workforce},{id:"iform",pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"iForm"},{id:"flow",pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"FlowFinity"},{id:"lfmobile",pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Laserfische"},{id:"mspbi",pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:a.openInApp,appName:"Microsoft Power Bi"}];
r.autoLink=function(a){if("string"!==typeof a||!a)return a;var c=b(a);if(!c)return a;var f=a.match(c.pattern),f=k.substitute({appName:c.appName,hierPart:f&&f[2]},c.label);return a.replace(c.pattern,"\x3ca "+(c.target?'target\x3d"'+c.target+'"':"")+'" href\x3d"$1"\x3e'+f+"\x3c/a\x3e")}})},"esri/widgets/Popup/PopupViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/assignHelper ../../core/Collection ../../core/Error ../../core/HandleRegistry ../../core/promiseUtils ../../core/watchUtils ../../geometry/geometryEngine ../../geometry/support/webMercatorUtils ../../support/Action ../support/AnchorElementViewModel ../../core/accessorSupport/decorators".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){function D(a,b){return b.allLayerViews.find(function(b){return b.layer===a})}x=new B({id:"zoom-to"});var F=new (c.ofType(B))([x]);return function(b){function p(a){a=b.call(this)||this;a._handles=new n;a._originalActions=null;a.actions=F;a.goToOptions=null;a.autoCloseEnabled=!1;a.content=null;a.highlightEnabled=!0;a.title=null;a.updateLocationEnabled=!0;a.view=null;a.visible=!1;a.zoomFactor=4;return a}k(p,b);p.prototype.initialize=function(){this._handles.add([this.on("view-change",
this._autoClose),q.watch(this,["highlightEnabled","selectedFeature","visible","view"],this._highlightFeature),q.watch(this,"selectedFeature.popupTemplate.actions",this._getSelectedFeatureActions),q.watch(this,"selectedFeature.popupTemplate.overwriteActions",this._getSelectedFeatureActions)])};p.prototype.destroy=function(){this._handles.destroy();this.view=this._handles=null};Object.defineProperty(p.prototype,"featureCount",{get:function(){return this.features.length},enumerable:!0,configurable:!0});
Object.defineProperty(p.prototype,"features",{get:function(){return this._get("features")||[]},set:function(a){a=a||[];this._set("features",a);var b=this.pendingPromisesCount,c=this.selectedFeatureIndex,p=this.promiseCount&&a.length;p&&b&&-1===c?this.selectedFeatureIndex=0:p&&-1!==c||(this.selectedFeatureIndex=a.length?0:-1)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"location",{get:function(){return this._get("location")||null},set:function(a){var b=this.get("location"),c=
this.get("view.spatialReference.isWebMercator");a&&a.get("spatialReference.isWGS84")&&c&&(a=y.geographicToWebMercator(a));this._set("location",a);a!==b&&this._centerAtLocation()},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"pendingPromisesCount",{get:function(){return this.promises.filter(function(a){return a&&!a.isFulfilled()}).length},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"waitingForResult",{get:function(){return 0<this.pendingPromisesCount&&0===
this.featureCount},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"promiseCount",{get:function(){return this.promises.length},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"promises",{get:function(){return this._get("promises")||[]},set:function(a){var b=this;this._get("promises").forEach(function(a){a.cancel()});this.features=[];this._set("promises",a);a.length&&(a=a.slice(0),a.forEach(function(a){a.always(function(c){b.notifyChange("pendingPromisesCount");
b._updateFeatures(a,c)})}),f.eachAlways(a).then(function(){b.featureCount||(b.visible=!1)}))},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"selectedFeature",{get:function(){var a=this.selectedFeatureIndex;if(-1===a)return null;a=this.features[a];if(!a)return null;this.updateLocationEnabled&&(this.location=this._getPointFromGeometry(a.geometry));return a},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"selectedFeatureIndex",{get:function(){var a=this._get("selectedFeatureIndex");
return"number"===typeof a?a:-1},set:function(a){var b=this.featureCount;a=isNaN(a)||-1>a||!b?-1:(a+b)%b;this._set("selectedFeatureIndex",a)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0});p.prototype.centerAtLocation=function(){var a=this.location,b=this.view;return a&&b?b.goTo({target:a,scale:b.scale},this.goToOptions):f.reject(new t(this.declaredClass+"::Cannot center at location without a location and view."))};
p.prototype.clear=function(){this.set({promises:[],features:[],content:null,title:null,location:null})};p.prototype.triggerAction=function(a){(a=this.actions.getItemAt(a))&&this.emit("trigger-action",{action:a})};p.prototype.next=function(){this.selectedFeatureIndex+=1;return this};p.prototype.previous=function(){--this.selectedFeatureIndex;return this};p.prototype.zoomToLocation=function(){var a=this,b=this.location,c=this.selectedFeature,p=this.view,l=this.zoomFactor;if(!b||!p)return f.reject(new t(this.declaredClass+
"::Cannot zoom to location without a location and view."));var l=p.scale/l,q=this.get("selectedFeature.geometry"),n=c&&"3d"===p.type,b=(n=q||n)?c:b,v=n&&q&&"point"===q.type&&this._isScreenSize(c);return p.goTo({target:b,scale:v?l:void 0},this.goToOptions).then(function(){v&&"point"===q.type&&(a.location=q)})};p.prototype._autoClose=function(){this.autoCloseEnabled&&(this.visible=!1)};p.prototype._isScreenSize=function(a){var b=this.view;return"3d"!==b.type||"esri.Graphic"!==a.declaredClass?!0:(b=
b.getViewForGraphic(a))&&b.whenGraphicBounds?b.whenGraphicBounds(a).then(function(a){return!a||a[0]===a[3]&&a[1]===a[4]&&a[2]===a[5]}):!0};p.prototype._getSelectedFeatureActions=function(){this._originalActions&&(this.actions=this._originalActions,this._originalActions=null);var a=this.actions.filter(function(a){return!a.temporary}),b=this.get("selectedFeature.popupTemplate");b&&b.overwriteActions&&(this._originalActions=a);this.actions=this._getNewActions(b,a)};p.prototype._getNewActions=function(a,
b){if(!a||!a.actions)return b;var c=a.actions;c.forEach(function(a){a.temporary=!0});return a.overwriteActions?c:b.concat(c)};p.prototype._getPointFromGeometry=function(a){return a?"point"===a.type?a:"extent"===a.type?a.center:"polygon"===a.type?a.centroid:"multipoint"===a.type||"polyline"===a.type?a.extent.center:null:null};p.prototype._centerAtLocation=function(){var a=this.location,b=this.updateLocationEnabled,c=this.get("view.extent");b&&c&&a&&!l.contains(c,a)&&this.centerAtLocation()};p.prototype._highlightFeature=
function(){this._handles.remove("highlight");var a=this.selectedFeature,b=this.highlightEnabled,c=this.view,p=this.visible;a&&c&&b&&p&&(b=a.layer)&&(c=D(b,c))&&"function"===typeof c.highlight&&(b=b.objectIdField,p=a.attributes,a=c.highlight(p&&p[b]||a,{}),this._handles.add(a,"highlight"))};p.prototype._updateFeatures=function(a,b){var c=this.features;a&&b&&b.length&&!(!this._validatePromise(a)||b instanceof t||b instanceof Error)&&(c.length?(a=b.filter(function(a){return-1===c.indexOf(a)}),this.features=
c.concat(a)):this.features=b)};p.prototype._validatePromise=function(a){return!a.isCanceled()&&-1<this.promises.indexOf(a)};a([w.property({type:c.ofType(B)})],p.prototype,"actions",void 0);a([w.property()],p.prototype,"goToOptions",void 0);a([w.property()],p.prototype,"autoCloseEnabled",void 0);a([w.property()],p.prototype,"content",void 0);a([w.property({readOnly:!0,dependsOn:["features"]})],p.prototype,"featureCount",null);a([w.property()],p.prototype,"features",null);a([w.property()],p.prototype,
"highlightEnabled",void 0);a([w.property()],p.prototype,"location",null);a([w.property({readOnly:!0,dependsOn:["promises"]})],p.prototype,"pendingPromisesCount",null);a([w.property({readOnly:!0,dependsOn:["featureCount","pendingPromisesCount"]})],p.prototype,"waitingForResult",null);a([w.property({readOnly:!0,dependsOn:["promises"]})],p.prototype,"promiseCount",null);a([w.property()],p.prototype,"promises",null);a([w.property({value:null,readOnly:!0,dependsOn:["features","selectedFeatureIndex","updateLocationEnabled"]})],
p.prototype,"selectedFeature",null);a([w.property({value:-1})],p.prototype,"selectedFeatureIndex",null);a([w.property({readOnly:!0,dependsOn:["view.ready"]})],p.prototype,"state",null);a([w.property()],p.prototype,"title",void 0);a([w.property()],p.prototype,"updateLocationEnabled",void 0);a([w.property()],p.prototype,"view",void 0);a([w.property()],p.prototype,"visible",void 0);a([w.property()],p.prototype,"zoomFactor",void 0);a([w.property()],p.prototype,"centerAtLocation",null);a([w.property()],
p.prototype,"clear",null);a([w.property()],p.prototype,"triggerAction",null);a([w.property()],p.prototype,"next",null);a([w.property()],p.prototype,"previous",null);a([w.property()],p.prototype,"zoomToLocation",null);return p=a([w.subclass("esri.widgets.Popup.PopupViewModel")],p)}(w.declared(v))})},"esri/geometry/geometryEngine":function(){define("require exports ../kernel ./Geometry ./Polygon ./Polyline ./Point ./Extent ./Multipoint dojo/_base/lang".split(" "),function(x,r,k,a,b,c,t,n,f,q){function l(h){if(void 0===
t.fromJson){if(void 0!==h.x&&void 0!==h.y)return new t(h);if(void 0!==h.paths)return new c(h);if(void 0!==h.rings)return new b(h);if(void 0!==h.points)return new f(h);if(void 0!==h.xmin&&void 0!==h.ymin&&void 0!==h.xmax&&void 0!==h.ymax)return new n(h)}else{if(void 0!==h.x&&void 0!==h.y)return t.fromJson(h);if(void 0!==h.paths)return c.fromJson(h);if(void 0!==h.rings)return b.fromJson(h);if(void 0!==h.points)return f.fromJson(h);if(void 0!==h.xmin&&void 0!==h.ymin&&void 0!==h.xmax&&void 0!==h.ymax)return n.fromJson(h)}}
function y(h){if(void 0===t.fromJson){if(void 0!==h.x&&void 0!==h.y)return new t(h);if(void 0!==h.paths)return new c(h);if(void 0!==h.rings)return new b(h);if(void 0!==h.points)return new f(h);if(void 0!==h.xmin&&void 0!==h.ymin&&void 0!==h.xmax&&void 0!==h.ymax)return new n(h)}else{if(void 0!==h.x&&void 0!==h.y)return t.fromJSON(h);if(void 0!==h.paths)return c.fromJSON(h);if(void 0!==h.rings)return b.fromJSON(h);if(void 0!==h.points)return f.fromJSON(h);if(void 0!==h.xmin&&void 0!==h.ymin&&void 0!==
h.xmax&&void 0!==h.ymax)return n.fromJSON(h)}}function B(h,a){var b;if(null==h||void 0===h||"number"===typeof h)return h;var e=h.toString();if(""===e)return null;if(2==a){if(b=R[e],void 0!==b)return b}else if(0==a){b=N[e];if(void 0!==b)return b;b=S[h];if(void 0!==b)return b}else if(3==a&&(b=N[e],void 0!==b))return b;if(1==a&&(b=S[h],void 0!==b))return b;if(!0===/^\d+$/.test(e))return parseInt(e);throw Error("Unrecognised Unit Type");}function v(h){if(void 0!==h&&null!==h)switch(h){case "loxodrome":return 1;
case "great-elliptic":return 2;case "normal-section":return 3;case "shape-preserving":return 4}return 0}function w(h,a){if(null===h||void 0===h||h.s())return null;switch(h.D()){case A.Xn.Point:var p=new t(h.lk(),h.mk(),a);if(P){var e=h.hasAttribute(A.xf.M);h.hasAttribute(A.xf.Z)&&p.set("z",h.lO());e&&p.set("m",h.NN())}return p;case A.Xn.Polygon:var p=h.hasAttribute(A.xf.Z),e=h.hasAttribute(A.xf.M),d=D(h,p,e),p=new b({rings:d,hasZ:p,hasM:e});P?p.set("spatialReference",a):p.setSpatialReference(a);p.setCacheValue("_geVersion",
h);return p;case A.Xn.Polyline:return p=h.hasAttribute(A.xf.Z),e=h.hasAttribute(A.xf.M),d=D(h,p,e),p=new c({paths:d,hasZ:p,hasM:e}),P?p.set("spatialReference",a):p.setSpatialReference(a),p.setCacheValue("_geVersion",h),p;case A.Xn.MultiPoint:var p=h.hasAttribute(A.xf.Z),e=h.hasAttribute(A.xf.M),g=d=null;p&&(d=h.mc(A.xf.Z));e&&(g=h.mc(A.xf.M));var m=new A.b,u=h.F();a=new f(a);P&&(a.set("hasZ",p),a.set("hasM",e));for(var C=0;C<u;C++){h.w(C,m);var M=[m.x,m.y];p&&M.push(d.get(C));e&&M.push(g.get(C));
a.addPoint(M)}a.setCacheValue("_geVersion",h);return a;case A.Xn.Envelope:return d=h.hasAttribute(A.xf.Z),p=h.hasAttribute(A.xf.M),e=new n(h.R.v,h.R.C,h.R.B,h.R.G,a),P&&(d&&(d=h.Ah(A.xf.Z,0),e.set("zmin",d.qa),e.set("zmax",d.va)),p&&(d=h.Ah(A.xf.M,0),e.set("mmin",d.qa),e.set("mmax",d.va))),e.setCacheValue("_geVersion",h),e}return null}function D(h,a,b){var e=[],d=h.ea(),g=null,m=null;a&&(g=h.mc(A.xf.Z));b&&(m=h.mc(A.xf.M));for(var u=new A.b,C=0;C<d;C++){for(var M=h.Ea(C),c=h.Ha(C),p=0,f=0,l=NaN,q=
NaN,n=NaN,z=NaN,v=h.vc(C),k=[],t=M;t<M+c;t++){h.w(t,u);var z=n=NaN,Q=[u.x,u.y];a&&(n=g.get(t),Q.push(n));b&&(z=m.get(t),Q.push(z));t==M&&v&&(p=u.x,f=u.y,l=n,q=z);k.push(Q)}!v||p==u.x&&f==u.y&&(!a||isNaN(l)&&isNaN(n)||l==n)&&(!b||isNaN(q)&&isNaN(z)||q==z)||k.push(k[0].slice(0));e.push(k)}return e}function F(h){var a=h._geVersion;if(null==a||void 0==a){if(Object.freeze&&Object.isFrozen(h))return 102100===h.wkid?V:4326===h.wkid?T:a=A.Nf.create(h.wkid);-1!=h.wkid&&null!==h.wkid&&void 0!==h.wkid?(a=A.Nf.create(h.wkid),
h._geVersion=a):""!==h.wkt&&void 0!==h.wkt&&null!==h.wkt&&(a=A.Nf.NL(h.wkt),h._geVersion=a)}return a}function G(h){if(null==h)return null;var a=h.getCacheValue("_geVersion");if(null==a||void 0==a)a=A.Pb.IL(h),h.setCacheValue("_geVersion",a);return a}function p(h){return null===h.spatialReference?null:F(h.spatialReference)}var z=this&&this.__extends||function(h,a){function b(){this.constructor=h}for(var e in a)a.hasOwnProperty(e)&&(h[e]=a[e]);h.prototype=null===a?Object.create(a):(b.prototype=a.prototype,
new b)},A;(function(h){var a=function(){function e(){}e.Sk=!1;e.it=!1;e.$v="";return e}();h.ah=a;if("undefined"!==typeof window)h.ah.$v="browser","Float64Array"in window&&(h.ah.it=!0),"ArrayBuffer"in window&&(h.ah.Sk=!0);else if("undefined"!==typeof process)a.$v="node",h.ah.Sk=!0,h.ah.it=!0;else{a.$v="browser";try{var b=new ArrayBuffer(0);new Uint8Array(b);h.ah.Sk=!0;h.ah.it=!0}catch(e){h.ah.Sk=!1}}})(A||(A={}));(function(h){(function(h){h[h.Unknown=0]="Unknown";h[h.Point=33]="Point";h[h.Line=322]=
"Line";h[h.Envelope=197]="Envelope";h[h.MultiPoint=550]="MultiPoint";h[h.Polyline=1607]="Polyline";h[h.Polygon=1736]="Polygon"})(h.Xn||(h.Xn={}));(function(h){h[h.enumMild=0]="enumMild";h[h.enumMedium=1]="enumMedium";h[h.enumHot=2]="enumHot"})(h.rH||(h.rH={}));var a=function(){function a(){this.description=null;this.Ux=0}a.prototype.D=function(){return 0};a.prototype.fb=function(){return-1};a.prototype.Qf=function(e){this.qc();e!=this.description&&this.nm(e)};a.prototype.nm=function(){};a.prototype.Ik=
function(e){this.qc();e!=this.description&&(e=h.Od.QN(this.description,e),e!=this.description&&this.nm(e))};a.prototype.hasAttribute=function(e){return this.description.hasAttribute(e)};a.prototype.Ne=function(e){this.qc();this.description.hasAttribute(e)||(e=h.Od.PN(this.description,e),this.nm(e))};a.prototype.Ah=function(){return null};a.prototype.Fp=function(){};a.prototype.o=function(){};a.prototype.Cn=function(){};a.prototype.dd=function(e){this.o(e)};a.prototype.s=function(){return!0};a.prototype.Ja=
function(){};a.prototype.Oe=function(){};a.prototype.Pa=function(){return null};a.prototype.copyTo=function(){};a.prototype.Mh=function(){return 0};a.prototype.$b=function(){return 0};a.prototype.WC=function(){return this.hasAttribute(1)};a.ve=function(e){return((e&192)>>6)+1>>1};a.Km=function(e){return 0!=(e&32)};a.qT=function(e){return 0!=(e&64)};a.SO=function(e){return 0!=(e&128)};a.Lc=function(e){return 0!=(e&256)};a.Th=function(e){return 0!=(e&512)};a.Kc=function(e){return 0!=(e&1024)};a.prototype.vm=
function(){var e=this.Pa();this.copyTo(e);return e};a.prototype.Rf=function(){return null};a.Yj=function(e){var d=e.Pa();e.copyTo(d);return d};a.prototype.qc=function(){0<=this.Ux&&(this.Ux+=2147483649)};a.Vu=function(e){var d=e.D();if(a.Th(d))return e.F();if(e.s())return 0;if(197==d)return 4;if(33==d)return 1;if(a.Lc(d))return 2;throw h.g.ra("missing type");};return a}();h.T=a})(A||(A={}));(function(h){var a=function(){function a(){this.y=this.x=0}a.Oa=function(e,d){var g=new a;g.x=e;g.y=d;return g};
a.prototype.ma=function(e,d){this.x=e;this.y=d};a.prototype.J=function(e){this.x=e.x;this.y=e.y};a.prototype.Cq=function(e,d){return this.x===e&&this.y===d};a.prototype.Ww=function(e){return 2.220446049250313E-16>=Math.abs(this.x-e.x)&&2.220446049250313E-16>=Math.abs(this.y-e.y)};a.prototype.ub=function(e){return this.x===e.x&&this.y===e.y};a.prototype.lc=function(e){return e==this?!0:e instanceof a?this.x==e.x&&this.y==e.y:!1};a.prototype.sub=function(e){this.x-=e.x;this.y-=e.y};a.prototype.pc=function(e,
d){this.x=e.x-d.x;this.y=e.y-d.y};a.prototype.add=function(e,d){void 0!==d?(this.x=e.x+d.x,this.y=e.y+d.y):(this.x+=e.x,this.y+=e.y)};a.prototype.Bp=function(){this.x=-this.x;this.y=-this.y};a.prototype.qr=function(e){this.x=-e.x;this.y=-e.y};a.prototype.OO=function(e,d,g){this.x=e.x*(1-g)+d.x*g;this.y=e.y*(1-g)+d.y*g};a.prototype.Fr=function(e,d){this.x=this.x*e+d.x;this.y=this.y*e+d.y};a.prototype.DR=function(e,d,g){this.x=d.x*e+g.x;this.y=d.y*e+g.y};a.prototype.scale=function(e){this.x*=e;this.y*=
e};a.prototype.compare=function(e){return this.y<e.y?-1:this.y>e.y?1:this.x<e.x?-1:this.x>e.x?1:0};a.prototype.normalize=function(){var e=this.length();0==e&&(this.x=1,this.y=0);this.x/=e;this.y/=e};a.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};a.prototype.Up=function(){return this.x*this.x+this.y*this.y};a.Fb=function(e,d){return Math.sqrt(this.Zb(e,d))};a.Yv=function(e,d,g,m){e-=g;d-=m;return Math.sqrt(e*e+d*d)};a.prototype.ml=function(e){return this.x*e.x+this.y*
e.y};a.prototype.uA=function(e){return Math.abs(this.x*e.x)+Math.abs(this.y*e.y)};a.prototype.Ai=function(e){return this.x*e.y-this.y*e.x};a.prototype.Er=function(e,d){var g=-this.x*d+this.y*e;this.x=this.x*e+this.y*d;this.y=g};a.prototype.tt=function(){var e=this.x;this.x=-this.y;this.y=e};a.prototype.zD=function(e){this.x=-e.y;this.y=e.x};a.prototype.Kp=function(){var e=this.x;this.x=this.y;this.y=-e};a.prototype.FA=function(){this.y=this.x=NaN};a.prototype.pv=function(){return isNaN(this.x)};a.prototype.ps=
function(){return 0<this.x?0<=this.y?1:4:0<this.y?2:0==this.x?4:3};a.cq=function(e,d){var g=e.ps(),m=d.ps();return m==g?(g=e.Ai(d),0>g?1:0<g?-1:0):g<m?-1:1};a.HT=function(e,d){return a.cq(e,d)};a.Zb=function(e,d){var g=e.x-d.x;e=e.y-d.y;return g*g+e*e};a.prototype.toString=function(){return"("+this.x+" , "+this.y+")"};a.prototype.Eh=function(){this.y=this.x=NaN};a.prototype.yJ=function(){return this.pv()?NaN:Math.abs(this.x)>=Math.abs(this.y)?Math.abs(this.x):Math.abs(this.y)};a.prototype.offset=
function(e,d){var g=a.Fb(e,d),m=a.Oa(this.x,this.y);if(0==g)return a.Fb(m,e);var u=new a;u.J(d);u.sub(e);m.sub(e);return m.Ai(u)/g};a.yn=function(e,d,g){var m=new h.$k;m.set(d.x);m.sub(e.x);var u=new h.$k;u.set(g.y);u.sub(e.y);var C=new h.$k;C.set(d.y);C.sub(e.y);var a=new h.$k;a.set(g.x);a.sub(e.x);m.Ap(u);C.Ap(a);m.sub(C);if(!m.Dq())return g=m.value(),0>g?-1:0<g?1:0;m=new h.Tn(d.x);u=new h.Tn(e.x);C=new h.Tn(e.y);m=m.nr(u);e=new h.Tn(g.y);e=e.nr(C);d=new h.Tn(d.y);d=d.nr(C);g=new h.Tn(g.x);g=g.nr(u);
m=m.Wp(e);d=d.Wp(g);m=m.Wp(d);return m.vP()?-1:m.nO()?1:0};a.prototype.hc=function(){return h.I.Rh(h.I.Rh())};return a}();h.b=a})(A||(A={}));(function(h){var a=function(){function h(e){this.Ov=this.Or=0;this.ES=e}h.prototype.reset=function(){this.Ov=this.Or=0};h.prototype.add=function(e){e-=this.Ov;var d=this.Or+e;this.Ov=d-this.Or-e;this.Or=d};h.prototype.sub=function(e){this.add(-e)};h.prototype.rl=function(){return this.ES+this.Or};return h}();h.av=a;a=function(){function h(){}h.LT=function(e,
d){return 0<=d?Math.abs(e):-Math.abs(e)};h.sign=function(e){return 0>e?-1:0<e?1:0};h.gH=function(e){return e-360*Math.floor(e/360)};h.round=function(e){return Math.floor(e+.5)};h.Ty=function(e){return e*e};h.ut=function(e,d,g){var m;.5>=g?m=e+(d-e)*g:m=d-(d-e)*(1-g);return m};h.BD=function(e,d,g,m){.5>=g?(m.x=e.x+(d.x-e.x)*g,m.y=e.y+(d.y-e.y)*g):(m.x=d.x-(d.x-e.x)*(1-g),m.y=d.y-(d.y-e.y)*(1-g))};h.tP=function(e,d,g,m,u,C){.5>=u?(C.x=e+(g-e)*u,C.y=d+(m-d)*u):(C.x=g-(g-e)*(1-u),C.y=m-(m-d)*(1-u))};
return h}();h.vi=a})(A||(A={}));(function(h){var a=function(a){function e(){a.call(this);this.ha=this.la=this.ja=this.na=0;this.fa=null}z(e,a);e.prototype.Mb=function(){return h.b.Oa(this.na,this.ja)};e.prototype.ht=function(d){d.x=this.na;d.y=this.ja};e.prototype.ed=function(d){this.gl(0,d)};e.prototype.Ny=function(d,g){this.gl(0,h.b.Oa(d,g))};e.prototype.En=function(d){this.wA(0,d)};e.prototype.setStart=function(d){this.CA(0,d)};e.prototype.gt=function(d,g){return this.yd(0,d,g)};e.prototype.My=
function(d,g,m){this.om(0,d,g,m)};e.prototype.oc=function(){return h.b.Oa(this.la,this.ha)};e.prototype.uw=function(d){d.x=this.la;d.y=this.ha};e.prototype.vd=function(d){this.gl(1,d)};e.prototype.Ok=function(d,g){this.gl(1,h.b.Oa(d,g))};e.prototype.Bn=function(d){this.wA(1,d)};e.prototype.setEnd=function(d){this.CA(1,d)};e.prototype.Ws=function(d,g){return this.yd(1,d,g)};e.prototype.Cy=function(d,g,m){this.om(1,d,g,m)};e.prototype.fb=function(){return 1};e.prototype.s=function(){return this.sc()};
e.prototype.Ja=function(){};e.prototype.Mh=function(){return 0};e.prototype.Ga=function(d,g,m,e,C){return this.wJ(d,g,m,e,C)};e.prototype.jc=function(d,g){return 0!=this.fq(d,g,!1)};e.prototype.Eq=function(d,g){return this.qs(d,g,!1)};e.prototype.qs=function(){return null};e.prototype.sc=function(){return!1};e.prototype.rv=function(d){this.qc();if(null==this.fa&&0<d)this.fa=h.I.Lh(2*d);else if(null!=this.fa&&this.fa.length<2*d){for(var g=this.fa.slice(0),m=this.fa.length;m<2*d;m++)g[m]=0;this.fa=
g}};e.KI=function(d,g,m){if(0<m)var e=0;for(var C=0;C<m;C++)g[0+e]=d[0],e++};e.prototype.gl=function(d,g){0!=d?(this.la=g.x,this.ha=g.y):(this.na=g.x,this.ja=g.y)};e.prototype.nm=function(d){if(null!=this.fa){for(var g=h.Od.iu(d,this.description),m=[],u=e.Xk(this.description,0),C=e.Xk(this.description,1),a=e.Xk(d,0),b=e.Xk(d,1),c=0,p=1,f=d.Aa;p<f;p++){var l=d.Hd(p),q=h.pa.Wa(l);if(-1==g[p])for(var n=h.pa.ue(l),l=0;l<q;l++)m[a+c]=n,m[b+c]=n,c++;else for(n=this.description.fj(g[p])-2,l=0;l<q;l++)m[a+
c]=this.fa[u+n],m[b+c]=this.fa[C+n],c++,n++}this.fa=m}this.description=d};e.prototype.wA=function(d,g){if(this.sc())throw h.g.ra("empty geometry");g.Qf(this.description);g.sc()&&g.ko();for(var m=0;m<this.description.Aa;m++)for(var e=this.description.Fd(m),C=0,a=h.pa.Wa(e);C<a;C++){var b=this.yd(d,e,C);g.setAttribute(e,C,b)}};e.prototype.CA=function(d,g){this.qc();if(g.sc())throw h.g.ra("empty geometry");for(var m=g.description,e=0,C=m.Aa;e<C;e++)for(var a=m.Fd(e),b=h.pa.Wa(a),c=0;c<b;c++){var p=g.ld(a,
c);this.om(d,a,c,p)}};e.prototype.yd=function(d,g,m){if(this.sc())throw h.g.ra("This operation was performed on an Empty Geometry.");if(0==g)return 0!=d?0!=m?this.ha:this.la:0!=m?this.ja:this.na;if(m>=h.pa.Wa(g))throw h.g.Uc();var u=this.description.zf(g);return 0<=u?(null!=this.fa&&this.rv(this.description.le.length-2),this.fa[e.Xk(this.description,d)+this.description.fj(u)-2+m]):h.pa.ue(g)};e.prototype.om=function(d,g,m,u){this.qc();if(m>=h.pa.Wa(g))throw h.g.Uc();var C=this.description.zf(g);0>
C&&(this.Ne(g),C=this.description.zf(g));0==g?0!=d?0!=m?this.ha=u:this.la=u:0!=m?this.ja=u:this.na=u:(null==this.fa&&this.rv(this.description.le.length-2),this.fa[e.Xk(this.description,d)+this.description.fj(C)-2+m]=u)};e.prototype.copyTo=function(d){if(d.D()!=this.D())throw h.g.N();d.description=this.description;d.rv(this.description.le.length-2);e.KI(this.fa,d.fa,2*(this.description.le.length-2));d.na=this.na;d.ja=this.ja;d.la=this.la;d.ha=this.ha;d.qc();this.eo(d)};e.prototype.Ah=function(d,g){var m=
new h.Nd;if(this.sc())return m.Ja(),m;m.qa=this.yd(0,d,g);m.va=m.qa;m.Oj(this.yd(1,d,g));return m};e.prototype.XE=function(d){this.sc()?d.Ja():(d.qa=this.yd(0,0,0),d.va=d.qa,d.Oj(this.yd(1,0,0)))};e.prototype.uu=function(d,g){g.Qf(this.description);g.ic(this.Kb(d));for(var m=1,e=this.description.Aa;m<e;m++)for(var C=this.description.Fd(m),a=h.pa.Wa(C),b=0;b<a;b++){var c=this.ld(d,C,b);g.setAttribute(C,b,c)}};e.prototype.sJ=function(d){if(this.description!=d.description||this.na!=d.na||this.la!=d.la||
this.ja!=d.ja||this.ha!=d.ha)return!1;for(var g=0;g<2*(this.description.le.length-2);g++)if(this.fa[g]!=d.fa[g])return!1;return!0};e.prototype.kD=function(){return this.na==this.la&&this.ja==this.ha};e.prototype.reverse=function(){var d=this.na;this.na=this.la;this.la=d;d=this.ja;this.ja=this.ha;this.ha=d;for(var d=1,g=this.description.Aa;d<g;d++)for(var m=this.description.Hd(d),e=0,C=h.pa.Wa(m);e<C;e++){var a=this.yd(0,m,e),b=this.yd(1,m,e);this.om(0,m,e,b);this.om(1,m,e,a)}};e.prototype.fq=function(d,
g,m){var e=d.D();switch(this.D()){case 322:if(322==e)return h.yb.xJ(this,d,g,m);throw h.g.wa();default:throw h.g.wa();}};e.prototype.wJ=function(d,g,m,e,C){var u=d.D();switch(this.D()){case 322:if(322==u)return h.yb.ov(this,d,g,m,e,C);throw h.g.wa();default:throw h.g.wa();}};e.prototype.kv=function(){return null};e.Xk=function(d,g){return g*(d.le.length-2)};e.prototype.Kb=function(d,g){if(void 0===g)return g=new h.b,this.Kb(d,g),g;h.vi.tP(this.na,this.ja,this.la,this.ha,d,g)};e.prototype.Gd=function(){return null};
e.prototype.TC=function(){return null};e.prototype.nt=function(){return null};e.prototype.mg=function(){return null};e.prototype.mD=function(){return null};e.prototype.Pf=function(){return null};e.prototype.rA=function(d,g){return void 0!==g?this.Ru(g)-this.Ru(d):this.Ru(d)};e.prototype.eo=function(){};e.prototype.xm=function(){return null};e.prototype.Bi=function(){};e.prototype.ld=function(){return null};e.prototype.xe=function(){return null};e.prototype.Ru=function(){return null};e.prototype.AD=
function(){return null};e.prototype.Fb=function(d,g){if(!g&&0!=this.fq(d,0,!1))return 0;g=1.7976931348623157E308;var m,e;m=this.Mb();e=d.Gd(m,!1);m.sub(d.Kb(e));m=m.length();m<g&&(g=m);m=this.oc();e=d.Gd(m,!1);m.sub(d.Kb(e));m=m.length();m<g&&(g=m);m=d.Mb();e=this.Gd(m,!1);m.sub(this.Kb(e));m=m.length();m<g&&(g=m);m=d.oc();e=this.Gd(m,!1);m.sub(this.Kb(e));m=m.length();m<g&&(g=m);return g};e.prototype.Rf=function(){return h.Hh.il(this,null)};return e}(h.T);h.fA=a})(A||(A={}));new A.b;(function(h){(function(h){h[h.Unknown=
-1]="Unknown";h[h.Not=0]="Not";h[h.Weak=1]="Weak";h[h.Strong=2]="Strong"})(h.tH||(h.tH={}));(function(h){h[h.DirtyIsKnownSimple=1]="DirtyIsKnownSimple";h[h.IsWeakSimple=2]="IsWeakSimple";h[h.IsStrongSimple=4]="IsStrongSimple";h[h.DirtyOGCFlags=8]="DirtyOGCFlags";h[h.DirtyVerifiedStreams=32]="DirtyVerifiedStreams";h[h.DirtyExactIntervals=64]="DirtyExactIntervals";h[h.DirtyLooseIntervals=128]="DirtyLooseIntervals";h[h.DirtyIntervals=192]="DirtyIntervals";h[h.DirtyIsEnvelope=256]="DirtyIsEnvelope";h[h.DirtyLength2D=
512]="DirtyLength2D";h[h.DirtyRingAreas2D=1024]="DirtyRingAreas2D";h[h.DirtyCoordinates=1993]="DirtyCoordinates";h[h.DirtyAllInternal=65535]="DirtyAllInternal";h[h.DirtyAll=16777215]="DirtyAll"})(h.cH||(h.cH={}));var a=function(a){function e(){a.call(this);this.El=65535;this.ta=0;this.rg=-1;this.pb=null}z(e,a);e.prototype.eo=function(){};e.prototype.qv=function(){};e.prototype.xv=function(){};e.prototype.F=function(){return this.ta};e.prototype.s=function(){return this.sc()};e.prototype.sc=function(){return 0==
this.ta};e.prototype.gj=function(d){return 0!=(this.El&d)};e.prototype.yf=function(d,g){this.El=g?this.El|d:this.El&~d};e.prototype.kc=function(){this.gj(32)&&this.FJ()};e.prototype.Su=function(){if(this.sc())throw h.g.ra("This operation was performed on an Empty Geometry.");};e.prototype.Sd=function(d,g){if(0>d||d>=this.ta)throw h.g.ra("index out of bounds");this.kc();g.Qf(this.description);g.s()&&g.ko();for(var m=0;m<this.description.Aa;m++)for(var e=this.description.Fd(m),C=0,a=h.pa.Wa(e);C<a;C++){var b=
this.Ba[m].Bh(a*d+C);g.setAttribute(e,C,b)}};e.prototype.Iu=function(d,g){this.kc();for(var m=g.description,e=0;e<m.Aa;e++)for(var C=m.Fd(e),a=h.pa.Wa(C),b=0;b<a;b++){var c=g.ld(C,b);this.setAttribute(C,d,b,c)}};e.prototype.w=function(d,g){if(0>d||d>=this.F())throw h.g.Uc();this.kc();this.Ba[0].ec(2*d,g)};e.prototype.Fa=function(d){var g=new h.b;this.w(d,g);return g};e.prototype.uc=function(d,g){this.Ba[0].ec(2*d,g)};e.prototype.ic=function(d,g,m){if(0>d||d>=this.ta)throw h.g.Uc();this.kc();var e=
this.Ba[0];void 0!==m?(e.write(2*d,g),e.write(2*d+1,m)):e.Rn(2*d,g);this.ce(1993)};e.prototype.Lw=function(d){if(0>d||d>=this.F())throw h.g.Uc();this.kc();var g=this.Ba[0],m=new h.ee;m.x=g.read(2*d);m.y=g.read(2*d+1);m.z=this.hasAttribute(1)?this.Ba[1].Bh(d):h.pa.ue(1);return m};e.prototype.Py=function(d,g){if(0>d||d>=this.F())throw h.g.Uc();this.Ne(1);this.kc();this.ce(1993);var m=this.Ba[0];m.write(2*d,g.x);m.write(2*d+1,g.y);this.Ba[1].Uk(d,g.z)};e.prototype.ld=function(d,g,m){if(0>g||g>=this.ta)throw h.g.Uc();
var e=h.pa.Wa(d);if(m>=e)throw h.g.Uc();this.kc();var C=this.description.zf(d);return 0<=C?this.Ba[C].Bh(g*e+m):h.pa.ue(d)};e.prototype.nC=function(d,g,m){return this.ld(d,g,m)};e.prototype.setAttribute=function(d,g,m,e){if(0>g||g>=this.ta)throw h.g.Uc();var u=h.pa.Wa(d);if(m>=u)throw h.g.Uc();this.Ne(d);this.kc();d=this.description.zf(d);this.ce(1993);this.Ba[d].Uk(g*u+m,e)};e.prototype.mc=function(d){this.Su();this.Ne(d);this.kc();return this.Ba[this.description.zf(d)]};e.prototype.bm=function(d,
g){if(null!=g&&h.pa.Qh(d)!=g.Qh())throw h.g.N();this.Ne(d);d=this.description.zf(d);null==this.Ba&&(this.Ba=h.Ac.ay(this.description.Aa));this.Ba[d]=g;this.ce(16777215)};e.prototype.nm=function(d){var g=null;if(null!=this.Ba)for(var m=h.Od.iu(d,this.description),g=[],e=0,C=d.Aa;e<C;e++)-1!=m[e]&&(g[e]=this.Ba[m[e]]);this.description=d;this.Ba=g;this.rg=-1;this.ce(16777215)};e.prototype.IA=function(d){this.ss(!0);d instanceof h.i?this.R.o(d):this.R.Cn(d)};e.prototype.EJ=function(d){this.ss(!1);d instanceof
h.i?this.R.o(d):this.R.Cn(d)};e.prototype.Fp=function(d){this.ss(!0);this.R.copyTo(d)};e.prototype.o=function(d){this.IA(d)};e.prototype.Cn=function(d){this.IA(d)};e.prototype.dd=function(d){this.EJ(d)};e.prototype.Ah=function(d,g){var m=new h.Nd;if(this.sc())return m.Ja(),m;this.ss(!0);return this.R.Ah(d,g)};e.prototype.hc=function(){var d=this.description.hc();if(!this.sc())for(var g=this.F(),m=0,e=this.description.Aa;m<e;m++)d=this.Ba[m].jj(d,0,g*h.pa.Wa(this.description.Fd(m)));return d};e.prototype.lc=
function(d){if(d==this)return!0;if(!(d instanceof e&&this.description.lc(d.description))||this.sc()!=d.sc())return!1;if(this.sc())return!0;var g=this.F();if(g!=d.F())return!1;for(var m=0;m<this.description.Aa;m++){var u=this.description.Hd(m),C=this.mc(u),a=d.mc(u);if(!C.lc(a,0,g*h.pa.Wa(u)))return!1}return!0};e.prototype.copyTo=function(d){if(d.D()!=this.D())throw h.g.N();this.tA(d)};e.prototype.tA=function(d){this.kc();d.description=this.description;d.Ba=null;var g=this.description.Aa,m=null;if(null!=
this.Ba)for(var m=[],e=0;e<g;e++)null!=this.Ba[e]&&(m[e]=this.Ba[e].Ip(this.F()*h.pa.Wa(this.description.Fd(e))));null!=this.R?(d.R=this.R.Pa(),this.R.copyTo(d.R)):d.R=null;d.ta=this.ta;d.El=this.El;d.Ba=m;try{this.eo(d)}catch(C){throw d.Ja(),h.g.BI();}};e.prototype.EA=function(){this.ta=0;this.rg=-1;this.Ba=null;this.ce(16777215)};e.prototype.ce=function(d){16777215==d&&(this.rg=-1,this.qv());this.El|=d;this.kJ();this.qc()};e.prototype.ss=function(d){this.kc();if(this.gj(192))if(null==this.R?this.R=
new h.Vj(this.description):this.R.Qf(this.description),this.s())this.R.Ja();else{this.wv(d);for(var g=1;g<this.description.Aa;g++)for(var m=this.description.Fd(g),e=h.pa.Wa(m),C=this.Ba[g],a=0;a<e;a++){var b=new h.Nd;b.Ja();for(var c=0;c<this.ta;c++){var p=C.Bh(c*e+a);b.Db(p)}this.R.setInterval(m,a,b)}d&&this.yf(192,!1)}};e.prototype.wv=function(){this.R.Ja();for(var d=this.Ba[0],g=new h.b,m=0;m<this.ta;m++)d.ec(2*m,g),this.R.Db(g)};e.prototype.tm=function(d){d.Ja();for(var g=this.Ba[0],m=new h.b,
e=0;e<this.ta;e++)g.ec(2*e,m),d.Db(m)};e.prototype.FJ=function(){if(this.rg<this.ta){null==this.Ba&&(this.Ba=h.Ac.ay(this.description.Aa));this.rg=2147483647;for(var d=0;d<this.description.Aa;d++){var g=this.description.Fd(d);if(null!=this.Ba[d]){var m=h.pa.Wa(g),e=h.I.truncate(this.Ba[d].size/m);e<this.ta&&(e=h.I.truncate(this.rg>this.ta+5?(5*this.ta+3)/4:this.ta),this.Ba[d].resize(e*m,h.pa.ue(g)));e<this.rg&&(this.rg=e)}else this.Ba[d]=h.Ac.Tv(g,this.ta),this.rg=this.ta}}this.xv();this.yf(32,!1)};
e.prototype.jo=function(d){if(0>d)throw h.g.N();d!=this.ta&&(this.ta=d,this.ce(65535))};e.prototype.rj=function(d){if(!this.gj(1)){if(!this.gj(2))return 0;if(this.TP>=d)return this.gj(8)?1:2}return-1};e.prototype.hg=function(d,g){this.TP=g;if(-1==d)this.yf(1,!0),this.yf(8,!0);else if(this.yf(1,!1),this.yf(8,!0),0==d)this.yf(2,!1),this.yf(4,!1);else if(1==d)this.yf(2,!0),this.yf(4,!1);else if(2==d)this.yf(2,!0),this.yf(4,!0);else throw h.g.ra("internal error.");};e.prototype.kJ=function(){null!=this.pb&&
(this.pb=null)};e.prototype.vJ=function(d,g,m,e){if(0>d||d>=this.ta)throw h.g.ra("index out of bounds");if(0>g||g>=this.ta)throw h.g.ra("index out of bounds");this.kc();e.Qf(this.description);e.s()&&e.ko();for(var u=0;u<this.description.Aa;u++)for(var a=this.description.Fd(u),b=0,c=h.pa.Wa(a);b<c;b++){var p=this.Ba[u].Bh(c*d+b),f=this.Ba[u].Bh(c*g+b);e.setAttribute(a,b,h.vi.ut(p,f,m))}};e.prototype.mv=function(d,g){var m=this.Ba[0].f,e=m[2*d]-m[2*g],m=m[2*d+1]-m[2*g+1];return Math.sqrt(e*e+m*m)};
e.prototype.bh=function(d,g){if(0>d||d>=this.ta)throw h.g.Uc();if(g.s())throw h.g.N();this.kc();for(var m=g.description,e=0;e<m.Aa;e++)for(var C=m.Hd(e),a=h.pa.Wa(C),b=0;b<a;b++){var c=g.ld(C,b);this.setAttribute(C,d,b,c)}};e.prototype.jv=function(){return null};e.prototype.dj=function(){return null};return e}(h.T);h.Wr=a})(A||(A={}));(function(h){var a=function(){function a(){this.cb=this.Qm=null;this.Ol=124234251;this.Ct=!0;this.Ae=-1;this.cb=new h.Fc(7);this.Qm=null}a.prototype.Hn=function(e){this.Qm=
e};a.prototype.lM=function(){this.Ct=!1};a.prototype.de=function(e){this.cb.de(e)};a.prototype.nq=function(e){var d=this.cb.be();this.mS(d);this.oS(e,d);return d};a.prototype.fM=function(e){this.cb.Jc(e)};a.prototype.addElement=function(e,d){var g;-1==d?(-1==this.Ae&&(this.Ae=this.nq(-1)),g=this.Ae):g=d;return this.MA(e,0,g)};a.prototype.PA=function(e){-1==this.Ae&&(this.Ae=this.nq(-1));return this.MA(e,1,this.Ae)};a.prototype.qm=function(e){var d;-1==this.Ae&&(this.Ae=this.nq(-1));d=this.Ae;var g=
this.cb.f;if(-1==d||-1==g[7*d])return e=this.cb.Pj([-1,-1,-1,e,this.ck(),-1,-1]),g=this.cb.f,g[7*d]=e,this.mo(-1,e,d,g),e;var m=-1==d?-1:g[7*d+2];e=this.cb.Pj([-1,-1,m,e,this.ck(),-1,-1]);g=this.cb.f;g[7*m+1]=e;this.Fv(e,g);-1===g[7*e+2]&&(g[7*d]=e);this.mo(-1,e,d,g);return e};a.prototype.vs=function(e,d,g,m){var u=-1;-1==u&&(-1==this.Ae&&(this.Ae=this.nq(-1)),u=this.Ae);var C=this.cb.f;if(-1==u||-1==C[7*u])return g=this.cb.Pj([-1,-1,-1,g,this.ck(),-1,-1]),C=this.cb.f,C[7*u]=g,this.mo(-1,g,u,C),g;
var a;m?(m=-1!=d?this.Qm.compare(this,g,d):-1,a=-1!=e?this.Qm.compare(this,g,e):1):(m=-1,a=1);if(0==m||0==a)return C[7*u+3]=0==m?d:e,-1;(-1!=d&&-1!=e?this.Ol>h.I.$x(this.Ol)>>1:-1!=d)?e=d:m=a;for(d=!0;;){if(0>m)if(a=C[7*e],-1!=a)e=a;else{m=e;g=this.cb.Pj([-1,-1,e,g,this.ck(),-1,-1]);C=this.cb.f;C[7*e]=g;break}else if(a=C[7*e+1],-1!=a)e=a;else{m=C[7*e+6];g=this.cb.Pj([-1,-1,e,g,this.ck(),-1,-1]);C=this.cb.f;C[7*e+1]=g;break}d&&(m*=-1,d=!1)}this.Fv(g,C);-1===C[7*g+2]&&(C[7*u]=g);this.mo(m,g,u,C);return g};
a.prototype.tC=function(){return this.xN(this.Ae)};a.prototype.kd=function(e,d){d=-1==d?this.Ae:d;this.Ct?this.eM(e,d):this.$S(e,d)};a.prototype.search=function(e,d){for(d=this.dt(d);-1!=d;){var g=this.Qm.compare(this,e,d);if(0==g)return d;d=0>g?this.ik(d):this.Jo(d)}return-1};a.prototype.GR=function(e){for(var d=this.dt(-1),g=-1;-1!=d;){var m=e.compare(this,d);if(0==m)return d;0>m?d=this.ik(d):(g=d,d=this.Jo(d))}return g};a.prototype.sF=function(e){for(var d=this.dt(-1),g=-1;-1!=d;){var m=e.compare(this,
d);if(0==m)return d;0>m?(g=d,d=this.ik(d)):d=this.Jo(d)}return g};a.prototype.da=function(e){return this.cb.O(e,3)};a.prototype.ik=function(e){return this.cb.O(e,0)};a.prototype.Jo=function(e){return this.cb.O(e,1)};a.prototype.getParent=function(e){return this.cb.O(e,2)};a.prototype.bb=function(e){return this.cb.O(e,6)};a.prototype.ge=function(e){return this.cb.O(e,5)};a.prototype.gc=function(e){return-1==e?this.gk(this.Ae):this.gk(e)};a.prototype.tc=function(e){return-1==e?this.uq(this.Ae):this.uq(e)};
a.prototype.hO=function(e){return-1==e?this.QC(this.Ae):this.QC(e)};a.prototype.Vi=function(e,d){this.By(e,d)};a.prototype.dt=function(e){return-1==e?this.MC(this.Ae):this.MC(e)};a.prototype.clear=function(){this.cb.Nh(!1);this.Ae=-1};a.prototype.size=function(e){return-1==e?this.OC(this.Ae):this.OC(e)};a.prototype.pK=function(e,d){for(var g=d[7*e],m=d[7*e+1],u=d[7*e+4];-1!=g||-1!=m;){var C=-1!=g?d[7*g+4]:2147483647,m=-1!=m?d[7*m+4]:2147483647;if(u<=Math.min(C,m))break;C<=m?this.oF(g,d):this.nF(e,
d);g=d[7*e];m=d[7*e+1]}};a.prototype.Fv=function(e,d){if(this.Ct)for(var g=d[7*e+4],m=d[7*e+2];-1!=m&&d[7*m+4]>g;)d[7*m]==e?this.oF(e,d):this.nF(m,d),m=d[7*e+2]};a.prototype.nF=function(e,d){var g=d[7*e+1],m;d[7*g+2]=d[7*e+2];d[7*e+2]=g;m=d[7*g];d[7*e+1]=m;-1!=m&&(d[7*m+2]=e);d[7*g]=e;m=d[7*g+2];-1!=m&&(d[7*m]==e?d[7*m]=g:d[7*m+1]=g)};a.prototype.oF=function(e,d){var g=d[7*e+2],m;d[7*e+2]=d[7*g+2];d[7*g+2]=e;m=d[7*e+1];d[7*g]=m;-1!=m&&(d[7*m+2]=g);d[7*e+1]=g;m=d[7*e+2];-1!=m&&(d[7*m]===g?d[7*m]=e:
d[7*m+1]=e)};a.prototype.Tj=function(e,d){this.cb.L(e,2,d)};a.prototype.Gy=function(e,d){this.cb.L(e,0,d)};a.prototype.Ky=function(e,d){this.cb.L(e,1,d)};a.prototype.Jy=function(e,d){this.cb.L(e,5,d)};a.prototype.Gu=function(e,d){this.cb.L(e,6,d)};a.prototype.VF=function(e,d){this.cb.L(d,0,e)};a.prototype.mS=function(e){this.cb.L(e,4,0)};a.prototype.oS=function(e,d){this.cb.L(d,5,e)};a.prototype.MC=function(e){return-1==e?-1:this.cb.O(e,0)};a.prototype.gk=function(e){return-1==e?-1:this.cb.O(e,1)};
a.prototype.uq=function(e){return-1==e?-1:this.cb.O(e,2)};a.prototype.xN=function(e){return-1==e?-1:this.cb.O(e,3)};a.prototype.OC=function(e){return-1==e?0:this.cb.O(e,4)};a.prototype.QC=function(e){return this.cb.O(e,5)};a.prototype.ou=function(e){return this.cb.Pj([-1,-1,-1,e,this.ck(),-1,-1])};a.prototype.bk=function(e){-1!=e&&this.cb.Jc(e)};a.prototype.ck=function(){this.Ol=h.I.$x(this.Ol);return this.Ol&1073741823};a.prototype.MA=function(e,d,g){var m=this.cb.f;if(-1==g||-1==m[7*g])return e=
this.cb.Pj([-1,-1,-1,e,this.ck(),-1,-1]),m=this.cb.f,m[7*g]=e,this.mo(-1,e,g,m),e;for(var u=-1==g?-1:m[7*g];;){var C=-1==d?1:this.Qm.compare(this,e,u);if(0>C)if(C=this.ik(u),-1!=C)u=C;else{d=u;e=this.cb.Pj([-1,-1,u,e,this.ck(),-1,-1]);m=this.cb.f;m[7*u]=e;break}else{if(1==d&&0==C)return m[7*g+3]=u,-1;C=m[7*u+1];if(-1!=C)u=C;else{d=m[7*u+6];e=this.cb.Pj([-1,-1,u,e,this.ck(),-1,-1]);m=this.cb.f;m[7*u+1]=e;break}}}this.Fv(e,m);-1===m[7*e+2]&&(m[7*g]=e);this.mo(d,e,g,m);return e};a.prototype.mo=function(e,
d,g,m){var u;-1!=e?(u=m[7*e+5],m[7*e+5]=d):u=-1==g?-1:m[7*g+2];m[7*d+5]=u;-1!=u&&(m[7*u+6]=d);m[7*d+6]=e;e==(-1==g?-1:m[7*g+1])&&(m[7*g+1]=d);-1==e&&(m[7*g+2]=d);m[7*g+4]=(-1==g?0:m[7*g+4])+1};a.prototype.ry=function(e,d){var g=this.cb.f,m=g[7*e+5];e=g[7*e+6];-1!=m?g[7*m+6]=e:g[7*d+1]=e;-1!=e?g[7*e+5]=m:g[7*d+2]=m;g[7*d+4]=-1===d?-1:g[7*d+4]-1};a.prototype.$S=function(e,d){this.ry(e,d);var g=this.ik(e),m=this.Jo(e),u=this.getParent(e),C=e;if(-1!=g&&-1!=m){this.Ol=h.I.$x(this.Ol);var a;a=1073741823<
this.Ol?this.bb(e):this.ge(e);var b=this.getParent(a)==e;this.cb.Pu(e,a,0);this.cb.Pu(e,a,1);this.cb.Pu(e,a,2);-1!=u?this.ik(u)==e?this.Gy(u,a):this.Ky(u,a):this.VF(a,d);b?(g==a?(this.Gy(a,e),this.Tj(m,a)):m==a&&(this.Ky(a,e),this.Tj(g,a)),this.Tj(e,a),u=a):(this.Tj(g,a),this.Tj(m,a),u=this.getParent(e),C=a);g=this.ik(e);m=this.Jo(e);-1!=g&&this.Tj(g,e);-1!=m&&this.Tj(m,e)}g=-1!=g?g:m;-1==u?this.VF(g,d):this.ik(u)==C?this.Gy(u,g):this.Ky(u,g);-1!=g&&this.Tj(g,u);this.bk(e,d)};a.prototype.eM=function(e,
d){var g=this.cb.f;g[7*e+4]=2147483647;var m=-1,u=-1,C=-1===d?-1:g[7*d],h=C==e;h&&(m=g[7*C],u=g[7*C+1],-1==m&&-1==u)?(this.ry(C,d),this.bk(C,d),g[7*d]=-1):(this.pK(e,g),C=g[7*e+2],-1!=C&&(g[7*C]==e?g[7*C]=-1:g[7*C+1]=-1),this.ry(e,d),this.bk(e,d),h&&(g[7*d]=-1==m||-1!=g[7*m+2]?u:m))};a.prototype.By=function(e,d){this.cb.L(e,3,d)};return a}();h.bj=a})(A||(A={}));(function(h){var a=function(){function a(e,d){void 0!==e&&this.K(e,d)}a.prototype.K=function(e,d){this.qa=e;this.va=d;this.normalize()};a.prototype.normalize=
function(){if(!isNaN(this.qa)){if(this.qa>this.va){var e=this.qa;this.qa=this.va;this.va=e}isNaN(this.va)&&this.Ja()}};a.prototype.Ja=function(){this.va=this.qa=NaN};a.prototype.s=function(){return isNaN(this.qa)};a.prototype.Db=function(e){"number"===typeof e?this.s()?this.va=this.qa=e:this.Oj(e):e.s()||(this.s()?(this.qa=e.qa,this.va=e.va):(this.qa>e.qa&&(this.qa=e.qa),this.va<e.va&&(this.va=e.va),this.qa>this.va&&this.Ja()))};a.prototype.Oj=function(e){e<this.qa?this.qa=e:e>this.va&&(this.va=e)};
a.prototype.contains=function(e){return"number"===typeof e?e>=this.qa&&e<=this.va:e.qa>=this.qa&&e.va<=this.va};a.prototype.Ga=function(e){this.s()||e.s()?this.Ja():(this.qa<e.qa&&(this.qa=e.qa),this.va>e.va&&(this.va=e.va),this.qa>this.va&&this.Ja())};a.prototype.P=function(e){this.s()||(this.qa-=e,this.va+=e,this.va<this.qa&&this.Ja())};a.prototype.lv=function(){return this.s()?2.220446049250313E-14:2.220446049250313E-14*(Math.abs(this.qa)+Math.abs(this.va)+1)};a.prototype.yy=function(e,d){e>d?
(this.qa=d,this.va=e):(this.qa=e,this.va=d)};a.prototype.Sy=function(e){return h.I.Kr(e,this.qa,this.va)};a.prototype.aa=function(){return this.va-this.qa};a.prototype.Af=function(){return.5*(this.qa+this.va)};a.prototype.lc=function(e){return e==this?!0:e instanceof a?this.s()&&e.s()?!0:this.qa!=e.qa||this.va!=e.va?!1:!0:!1};a.prototype.hc=function(){return h.I.Rh(h.I.Rh())};return a}();h.Nd=a})(A||(A={}));(function(h){var a=new h.Nd,b=new h.Nd,e=function(){return function(){this.Zd=null;this.Lf=
-1;this.ib=new h.yb;this.ux=55555555;this.Et=this.Ft=!1;this.$h=new h.Nd;this.$h.yy(0,0)}}();h.XT=e;var d=function(){function d(d,g,C){this.a=d;this.Mj=NaN;this.mE=this.sp=0;this.nE=NaN;this.ka=g;this.tp=10*g;this.oE=this.pE=NaN;this.Zf=!1;this.Cl=this.mr=this.un=this.gr=this.fr=-1;this.lx=C;this.Rx=new e;this.vE=new e;h.I.truncate(3*d.pd/2)}d.prototype.$C=function(d,g,e,h){d.Zd=null===h?null:h[e[5*g]];d.Et=null!=d.Zd;d.Et||(h=e[5*g+2],-1!==h&&this.a.gR(e[5*g],e[5*h],d.ib),d.Zd=d.ib,d.$h.yy(d.ib.na,
d.ib.la),d.$h.va+=this.ka,d.ib.KE(),d.Ft=d.ib.ha==d.ib.ja,d.Ft||(d.ux=(d.ib.la-d.ib.na)/(d.ib.ha-d.ib.ja)))};d.prototype.tL=function(d,g){var m=d.fq(g,this.ka,!0);if(0!=m)return 2==m?this.aw():this.Oh();d.ht(I);d.uw(K);g.ht(L);g.uw(O);J.ma(this.sp,this.Mj);I.ub(L)&&this.Mj==I.y?0>K.compare(O)?J.J(K):J.J(O):I.ub(O)&&this.Mj==I.y?0>K.compare(L)?J.J(K):J.J(L):L.ub(K)&&this.Mj==L.y?0>I.compare(O)?J.J(I):J.J(O):K.ub(O)&&this.Mj==K.y&&(0>I.compare(L)?J.J(I):J.J(L));return d.xe(J.y,J.x)<g.xe(J.y,J.x)?-1:
1};d.prototype.rL=function(d,g){if(d.ib.ja==g.ib.ja&&d.ib.na==g.ib.na)return d.ib.ha==g.ib.ha&&d.ib.la==g.ib.la?this.lx?this.aw():0:this.HB(d,g);if(d.ib.ha==g.ib.ha&&d.ib.la==g.ib.la)return this.GB(d,g);var m=this.GB(d,g);d=this.HB(d,g);return 0>m&&0>d?-1:0<m&&0<d?1:this.Oh()};d.prototype.mL=function(d,g){if(d.la>g.la){if(g.la>g.na&&g.ha-g.ja<2*this.ka&&d.Kh(g.la,g.ha,this.ka))return this.Oh()}else if((g.ha-g.ja)/(g.la-g.na)*(d.la-d.na)<this.tp&&g.Kh(d.la,d.ha,this.ka))return this.Oh();return 1};
d.prototype.nL=function(d,g){if(d.na<g.na){if(g.la>g.na&&g.ha-g.ja<2*this.ka&&d.Kh(g.la,g.ha,this.ka))return this.Oh()}else if((g.ha-g.ja)/(g.la-g.na)*(d.na-d.la)<this.tp&&g.Kh(d.na,d.ja,this.ka))return this.Oh();return-1};d.prototype.oL=function(d,g){var m=new h.b;m.pc(g.oc(),g.Mb());m.Kp();m.normalize();var e=new h.b;e.pc(d.Mb(),g.Mb());var u=new h.b;u.pc(d.oc(),g.Mb());var e=e.ml(m),m=u.ml(m),u=Math.abs(e),a=Math.abs(m);if(u<a){if(u<this.tp&&g.Kh(d.na,d.ja,this.ka))return this.Oh()}else if(a<this.tp&&
g.Kh(d.la,d.ha,this.ka))return this.Oh();return 0>e&&0>m?-1:0<e&&0<m?1:this.Oh()};d.prototype.FB=function(d,g){return d.ja==g.ja&&d.na==g.na?this.mL(d,g):d.ha==g.ha&&d.la==g.la?this.nL(d,g):this.oL(d,g)};d.prototype.qL=function(d,g){return d.ha==g.ha&&d.la==g.la&&d.ja==g.ja&&d.na==g.na?this.lx?this.aw():0:this.Oh()};d.prototype.GB=function(d,g){var m=1;if(d.ib.ja<g.ib.ja){var m=-1,e=d;d=g;g=e}e=d.ib;d=g.ib;var u=e.na-d.na;g=g.ux*(e.ja-d.ja);var h=this.tp;return u<g-h?-m:u>g+h?m:d.Kh(e.na,e.ja,this.ka)?
this.Oh():u<g?-m:m};d.prototype.HB=function(d,g){var m=1;if(g.ib.ha<d.ib.ha){var m=-1,e=d;d=g;g=e}e=d.ib;d=g.ib;var u=e.la-d.na;g=g.ux*(e.ha-d.ja);var h=this.tp;return u<g-h?-m:u>g+h?m:d.Kh(e.la,e.ha,this.ka)?this.Oh():u<g?-m:m};d.prototype.aw=function(){this.Zf=!0;this.ei=new h.wd(5,this.un,this.mr);return-1};d.prototype.Oh=function(){this.Zf=!0;this.lx?this.ei=new h.wd(4,this.un,this.mr):this.mr=this.un=this.gr=this.fr=-1;return-1};d.prototype.sL=function(d,g,e,h){if(this.Zf)return-1;var m=this.nE==
this.Mj&&this.mE==this.sp,u;m&&d==this.fr?u=this.oE:(u=NaN,this.fr=-1);m&&g==this.gr?m=this.pE:(m=NaN,this.gr=-1);e.Zd.XE(a);h.Zd.XE(b);if(a.va<b.qa)return-1;if(b.va<a.qa)return 1;this.nE=this.Mj;this.mE=this.sp;isNaN(u)&&(this.fr=d,this.oE=u=d=e.Zd.xe(this.Mj,this.sp));isNaN(m)&&(this.gr=g,this.pE=m=d=h.Zd.xe(this.Mj,this.sp));return Math.abs(u-m)<=this.ka?this.tL(e.Zd,h.Zd):u<m?-1:u>m?1:0};d.prototype.lq=function(){this.Zf=!1};d.prototype.rl=function(){return this.ei};d.prototype.XF=function(d,
g){this.Mj=d;this.sp=g;this.mr=this.un=this.gr=this.fr=-1};d.prototype.compare=function(d,g,e){if(this.Zf)return-1;d=d.da(e);this.Cl=e;return this.JB(g,g,d,d)};d.prototype.JB=function(d,g,e,h){var m;this.un==g?m=this.Rx:(this.un=g,m=this.Rx,this.Rx.Lf=d,this.$C(m,g,this.a.cd.f,this.a.Ge));var u;null==u&&(this.mr=h,u=this.vE,this.vE.Lf=e,this.$C(u,h,this.a.cd.f,this.a.Ge));if(m.Et||u.Et)return this.sL(g,h,m,u);if(m.$h.va<u.$h.qa)return-1;if(u.$h.va<m.$h.qa)return 1;d=m.Ft?1:0;d|=u.Ft?2:0;return 0==
d?this.rL(m,u):1==d?this.FB(m.ib,u.ib):2==d?-1*this.FB(u.ib,m.ib):this.qL(m.ib,u.ib)};return d}();h.hA=d})(A||(A={}));(function(h){var a=function(){function a(e,d){this.a=e;this.ka=d;this.Zf=!1;this.un=-1;this.$h=new h.Nd;this.pp=new h.b;this.pp.Eh();this.Vd=new h.yb;this.Cl=-1;this.Cx=1.7976931348623157E308}a.prototype.lq=function(){this.Zf=!1;this.Cx=1.7976931348623157E308};a.prototype.bh=function(e){this.pp.J(e)};a.prototype.compare=function(e,d){return this.KB(d,e.da(d))};a.prototype.KB=function(e,
d){var g=null!=this.a.cc(d);g||(this.a.Oc(d,this.Vd),this.$h.yy(this.Vd.na,this.Vd.la));if(g)throw h.g.ra("not implemented");if(this.pp.x+this.ka<this.$h.qa)return-1;if(this.pp.x-this.ka>this.$h.va)return 1;if(this.Vd.ja==this.Vd.ha)return this.Cl=e,this.Zf=!0,0;this.Vd.KE();d=this.Vd.Mb();g=new h.b;g.pc(this.Vd.oc(),d);g.Kp();var m=new h.b;m.pc(this.pp,d);d=g.ml(m);d/=g.length();return d<10*-this.ka?-1:d>10*this.ka?1:this.Vd.Eq(this.pp,this.ka)&&(g=Math.abs(d),g<this.Cx&&(this.Cl=e,this.Cx=g),this.Zf=
!0,g<.25*this.ka)?0:0>d?-1:1};return a}();h.JI=a})(A||(A={}));(function(h){function a(e,d,g,m){g=new Float64Array(e.subarray(g,m));e.set(g,d)}var b=function(){function e(d){this.Sa=this.Xf=!1;this.f=[];var g=d;2>g&&(g=2);this.f=h.I.Lh(g,e.ob);this.size=d}e.Yc=function(d,g){e.ob=g;d=new e(d);e.ob=0;return d};e.lj=function(d){var g=new e(0);g.f=d.f.slice(0);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>g&&(m.size=g);m.f=d.f.slice(0,m.size);return m};e.prototype.xb=function(){};
e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];g.y=this.f[d+1]};e.prototype.get=function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};
e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");if(d<=this.size){if(h.I.truncate(5*d/4)<this.f.length){var m=this.f.slice(0,d);this.f=m}}else if(d>this.f.length){h.I.truncate(64>d?Math.max(2*d,4):5*d/4);for(var m=this.f.slice(0),e=this.f.length;e<d;e++)m[e]=g;this.f=m}this.size=d};e.prototype.cf=function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");
this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=function(d,g,m){for(var e=this.size;g<e&&g<m;g++)d=h.I.Rh(this.read(g));return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=function(d,g,m,e,C,a,b){if(this.Sa)throw h.g.xa();if(!C&&(1>a||0!=e%a))throw h.g.N();var u=this.size-b;u<e&&this.resize(this.size+e-u);for(u=
0;u<b-d;u++)this.f[d+e+u]=this.f[d+u];this.f==g.f&&d<m&&(m+=e);if(C)for(u=0;u<e;u++)this.f[u+d]=g.f[m+u];else for(C=e,b=0;b<e;b+=a)for(C-=a,u=0;u<a;u++)this.f[d+b+u]=g.f[m+C+u]};e.prototype.ul=function(d,g,m,e){if(this.Sa)throw h.g.xa();e-=d;for(var u=this.f.slice(d,d+e),a=0;a<e;a++)this.f[d+m+a]=u[a];for(e=0;e<m;e++)this.f[d+e]=g};e.prototype.lg=function(d,g,m){if(this.Sa)throw h.g.xa();for(var e=this.f.slice(d,d+(m-d)),C=0;C<m-d;C++)this.f[C+d+2]=e[C];this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=
function(d,g,m,e,C,a){if(0>d||0>g||0>e)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(m.size<e+g)throw h.g.N();if(0!=g)if(this.size<g+d&&this.resize(g+d),m==this)this.xi(d,g,e,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=m.f[e],d++,e++;else if(e=e+g-a,1==a)for(C=0;C<g;C++)this.f[d]=m.f[e],d++,e--;else for(C=0,g=h.I.truncate(g/a);C<g;C++){for(var u=0;u<a;u++)this.f[d+u]=m.f[e+u];d+=a;e-=a}};e.prototype.oj=function(d,g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();if(0<e-(d+g)){e-=
d+g;for(var m=this.f.slice(d+g,d+e+g),C=0;C<e;C++)this.f[d+C]=m[C]}this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,g,e){if(0>g||0>e||0>g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,g,e,u,C){if(!u||d!=e){for(var m=0;m<g;m++)this.f[d+m]=this.f[e+m];if(!u)for(e=
d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}}};e.prototype.$p=function(d,g,e,u,C){if(0>d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+1]=e[u].y,d+=C};e.prototype.Hp=function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=
function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,e){var m=this.f.slice(0,d),C=this.f.slice(g);d=this.f.slice(d,g).sort(e);this.f.length=0;this.f.push.apply(this.f,m.concat(d).concat(C))};e.prototype.Qh=function(){return 1};e.ob=0;return e}();h.qd=b;b=function(){function e(d){this.Sa=this.Xf=!1;this.f=null;var g=d;2>g&&(g=2);this.f=new Float64Array(g);this.size=d}e.Yc=function(d,g){var m=new e(d),u=m.f;2>d&&(d=2);if(0!==g)for(var C=0;C<d;C++)u[C]=g;return m};e.lj=function(d){var g=
new e(0);g.f=new Float64Array(d.f);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>g&&(m.size=g);g=m.size;2>g&&(g=2);m.f=new Float64Array(g);m.f.set(d.f.length<=g?d.f:d.f.subarray(0,g),0);return m};e.prototype.xb=function(d){0>=d||(null==this.f?this.f=new Float64Array(d):d<=this.f.length||(0<this.f.length?(d=new Float64Array(d),d.set(this.f),this.f=d):this.f=new Float64Array(d)))};e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];
g.y=this.f[d+1]};e.prototype.get=function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===
g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");if(d<=this.size){if(30<this.f.length&&5*d/4<this.f.length){var e=new Float64Array(this.f,0,d);this.f=e}}else{d>this.f.length&&(e=h.I.truncate(64>d?Math.max(2*d,4):5*d/4),e=new Float64Array(e),e.set(this.f),this.f=e);for(var e=this.f,u=this.size;u<d;u++)e[u]=g}this.size=d};e.prototype.cf=function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");
this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=function(d,g,e){for(var m=this.size;g<m&&g<e;g++)d=h.I.Rh(this.read(g));return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=function(d,g,e,u,C,M,b){if(this.Sa)throw h.g.xa();if(!C&&(1>M||0!=u%M))throw h.g.N();var m=this.size-b;m<u&&this.resize(this.size+u-m);a(this.f,
d+u,d,d+(b-d));this.f==g.f&&d<e&&(e+=u);if(C)this.f.set(g.f.subarray(e,e+u),d);else for(C=u,b=0;b<u;b+=M)for(C-=M,m=0;m<M;m++)this.f[d+b+m]=g.f[e+C+m]};e.prototype.ul=function(d,g,e,u){if(this.Sa)throw h.g.xa();u-=d;a(this.f,d+u,d,d+u);for(u=0;u<e;u++)this.f[d+u]=g};e.prototype.lg=function(d,g,e){if(this.Sa)throw h.g.xa();a(this.f,d+2,d,d+(e-d));this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=function(d,g,e,u,C,a){if(0>d||0>g||0>u)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(e.size<u+g)throw h.g.N();
if(0!=g)if(this.size<g+d&&this.resize(g+d),e==this)this.xi(d,g,u,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u++;else if(u=u+g-a,1==a)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u--;else for(C=0,g=h.I.truncate(g/a);C<g;C++){for(var m=0;m<a;m++)this.f[d+m]=e.f[u+m];d+=a;u-=a}};e.prototype.oj=function(d,g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();0<e-(d+g)&&a(this.f,d,d+g,d+(e-(d+g))+g);this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();
for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,g,e){if(0>g||0>e||0>g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,g,e,u,C){if(!u||d!=e)if(this.f.set(this.f.subarray(e,e+g),d),!u)for(e=d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(var m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}};e.prototype.$p=function(d,g,e,u,C){if(0>
d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+1]=e[u].y,d+=C};e.prototype.Hp=function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,e){Array.prototype.sort.call(this.f.subarray(d,g),e)};e.prototype.Qh=function(){return 1};
return e}();h.QG=b})(A||(A={}));!0===A.ah.Sk&&!0===A.ah.it&&(A.qd=A.QG);(function(h){function a(e,d,g,m){g=new Int32Array(e.subarray(g,m));e.set(g,d)}h.tT=function(){return function(){this.random=1973}}();var b=function(){function e(d){this.Sa=this.Xf=!1;this.f=[];var g=d;2>g&&(g=2);this.f=this.f=h.I.Lh(g,e.ob);this.size=d}e.Yc=function(d,g){e.ob=g;d=new e(d);e.ob=0;return d};e.lj=function(d){var g=new e(0);g.f=d.f.slice(0);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>
g&&(m.size=g);m.f=d.f.slice(0,m.size);return m};e.prototype.xb=function(){};e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];g.y=this.f[d+1]};e.prototype.get=function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+
1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");if(d<=this.size){if(h.I.truncate(5*d/4)<this.f.length){var e=this.f.slice(0,d);this.f=e}}else if(d>this.f.length){h.I.truncate(64>d?Math.max(2*d,4):5*d/4);for(var e=this.f.slice(0),u=this.f.length;u<d;u++)e[u]=g;this.f=e}this.size=d};e.prototype.cf=
function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=function(d,g,e){for(var m=this.size;g<m&&g<e;g++)d=h.I.kg(this.read(g),d);return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=
function(d,g,e,u,C,a,b){if(this.Sa)throw h.g.xa();if(!C&&(1>a||0!=u%a))throw h.g.N();for(var m=0;m<b-d;m++)this.f[d+u+m]=this.f[d+m];this.f==g.f&&d<e&&(e+=u);if(C)for(m=0;m<u;m++)this.f[m+d]=g.f[e+m];else for(C=u,b=0;b<u;b+=a)for(C-=a,m=0;m<a;m++)this.f[d+b+m]=g.f[e+C+m]};e.prototype.ul=function(d,g,e,u){if(this.Sa)throw h.g.xa();u-=d;for(var m=this.f.slice(d,d+u),a=0;a<u;a++)this.f[d+e+a]=m[a];for(u=0;u<e;u++)this.f[d+u]=g};e.prototype.lg=function(d,g,e){if(this.Sa)throw h.g.xa();for(var m=this.f.slice(d,
d+(e-d)),C=0;C<e-d;C++)this.f[C+d+2]=m[C];this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=function(d,g,e,u,C,a){if(0>d||0>g||0>u)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(e.size<u+g)throw h.g.N();if(0!=g)if(this.size<g+d&&this.resize(g+d),e==this)this.xi(d,g,u,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u++;else if(u=u+g-a,1==a)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u--;else for(C=0,g=h.I.truncate(g/a);C<g;C++){for(var m=0;m<a;m++)this.f[d+m]=e.f[u+m];d+=a;u-=a}};e.prototype.oj=function(d,
g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();if(0<e-(d+g)){e-=d+g;for(var m=this.f.slice(d+g,d+e+g),C=0;C<e;C++)this.f[d+C]=m[C]}this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,g,e){if(0>g||0>e||0>g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,
g,e,u,C){if(!u||d!=e){for(var m=0;m<g;m++)this.f[d+m]=this.f[e+m];if(!u)for(e=d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}}};e.prototype.$p=function(d,g,e,u,C){if(0>d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+1]=e[u].y,d+=C};e.prototype.Hp=function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<
g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,e){var m=this.f.slice(0,d),C=this.f.slice(g);d=this.f.slice(d,g).sort(e);this.f.length=0;this.f.push.apply(this.f,m.concat(d).concat(C))};e.prototype.Qh=function(){return 2};e.prototype.tc=function(){return this.f[this.size-1]};e.prototype.af=function(){this.resize(this.size-1)};e.prototype.JF=function(d){this.f[this.size-1]=d};e.prototype.QE=
function(d){d<this.size-1&&(this.f[d]=this.f[this.size-1]);this.resize(this.size-1)};e.prototype.Qs=function(d){for(var g=0,e=this.size;g<e;g++)if(this.f[g]==d)return g;return-1};e.prototype.Nw=function(d){return 0<=this.Qs(d)};e.ob=0;return e}();h.ga=b;b=function(){function e(d){this.Sa=this.Xf=!1;this.f=null;var g=d;2>g&&(g=2);this.f=new Int32Array(g);this.size=d}e.Yc=function(d,g){var m=new e(d),u=m.f;2>d&&(d=2);if(0!==g)for(var C=0;C<d;C++)u[C]=g;return m};e.lj=function(d){var g=new e(0);g.f=
new Int32Array(d.f);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>g&&(m.size=g);g=m.size;2>g&&(g=2);m.f=new Int32Array(g);m.f.set(d.f.length<=g?d.f:d.f.subarray(0,g),0);return m};e.prototype.xb=function(d){0>=d||(null==this.f?this.f=new Int32Array(d):d<=this.f.length||(0<this.f.length?(d=new Int32Array(d),d.set(this.f),this.f=d):this.f=new Int32Array(d)))};e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];g.y=this.f[d+1]};e.prototype.get=
function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");
if(d<=this.size){if(30<this.f.length&&5*d/4<this.f.length){var e=new Int32Array(this.f,0,d);this.f=e}}else{d>this.f.length&&(e=h.I.truncate(64>d?Math.max(2*d,4):5*d/4),e=new Int32Array(e),e.set(this.f),this.f=e);for(var e=this.f,u=this.size;u<d;u++)e[u]=g}this.size=d};e.prototype.cf=function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=
function(d,g,e){for(var m=this.size;g<m&&g<e;g++)d=h.I.kg(this.read(g),d);return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=function(d,g,e,u,C,M,b){if(this.Sa)throw h.g.xa();if(!C&&(1>M||0!=u%M))throw h.g.N();a(this.f,d+u,d,d+(b-d));this.f==g.f&&d<e&&(e+=u);if(C)this.f.set(g.f.subarray(e,e+u),d);else for(C=u,b=0;b<u;b+=M){C-=M;for(var m=
0;m<M;m++)this.f[d+b+m]=g.f[e+C+m]}};e.prototype.ul=function(d,g,e,u){if(this.Sa)throw h.g.xa();u-=d;a(this.f,d+u,d,d+u);for(u=0;u<e;u++)this.f[d+u]=g};e.prototype.lg=function(d,g,e){if(this.Sa)throw h.g.xa();a(this.f,d+2,d,d+(e-d));this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=function(d,g,e,u,C,a){if(0>d||0>g||0>u)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(e.size<u+g)throw h.g.N();if(0!=g)if(this.size<g+d&&this.resize(g+d),e==this)this.xi(d,g,u,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=
e.f[u],d++,u++;else if(u=u+g-a,1==a)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u--;else for(C=0,g=h.I.truncate(g/a);C<g;C++){for(var m=0;m<a;m++)this.f[d+m]=e.f[u+m];d+=a;u-=a}};e.prototype.oj=function(d,g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();0<e-(d+g)&&a(this.f,d,d+g,d+(e-(d+g))+g);this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+
g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,g,e){if(0>g||0>e||0>g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,g,e,u,C){if(!u||d!=e)if(this.f.set(this.f.subarray(e,e+g),d),!u)for(e=d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(var m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}};e.prototype.$p=function(d,g,e,u,C){if(0>d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=
C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+1]=e[u].y,d+=C};e.prototype.Hp=function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,m){10>g-d?e.$i(this.f,d,g,m):e.$g(this.f,d,g-1,m)};e.prototype.Qh=function(){return 2};e.prototype.tc=function(){return this.f[this.size-1]};e.prototype.af=function(){this.resize(this.size-
1)};e.prototype.JF=function(d){this.f[this.size-1]=d};e.prototype.QE=function(d){d<this.size-1&&(this.f[d]=this.f[this.size-1]);this.resize(this.size-1)};e.prototype.Qs=function(d){for(var g=0,e=this.size;g<e;g++)if(this.f[g]==d)return g;return-1};e.prototype.Nw=function(d){return 0<=this.Qs(d)};e.$i=function(d,g,e,u){for(var m=g;m<e;m++){for(var h=d[m],a=m-1;a>=g&&0<u(d[a],h);)d[a+1]=d[a],a--;d[a+1]=h}};e.Wf=function(d,g,e){var m=d[e];d[e]=d[g];d[g]=m};e.$g=function(d,g,m,u){if(!(g>=m))for(;;){if(9>
m-g){e.$i(d,g,m+1,u);break}var C=d[g];e.Wf(d,g,m);for(var h=g,a=g;a<m;a++)0>=u(d[a],C)&&(e.Wf(d,h,a),h+=1);e.Wf(d,h,m);h-g<m-h?(e.$g(d,g,h-1,u),g=h+1):(e.$g(d,h+1,m,u),m=h-1)}};return e}();h.Xu=b})(A||(A={}));!0===A.ah.Sk&&(A.ga=A.Xu);(function(h){function a(e,d,g,m){g=new Int8Array(e.subarray(g,m));e.set(g,d)}var b=function(){function e(d){this.Sa=this.Xf=!1;this.f=[];var g=d;2>g&&(g=2);this.f=h.I.Lh(g,e.ob);this.size=d}e.Yc=function(d,g){e.ob=g;d=new e(d);e.ob=0;return d};e.lj=function(d){var g=
new e(0);g.f=d.f.slice(0);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>g&&(m.size=g);m.f=d.f.slice(0,m.size);return m};e.prototype.xb=function(){};e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];g.y=this.f[d+1]};e.prototype.get=function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();
this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");if(d<=this.size){if(h.I.truncate(5*d/4)<this.f.length){var e=this.f.slice(0,d);this.f=e}}else if(d>this.f.length){h.I.truncate(64>d?Math.max(2*d,4):5*d/4);for(var e=
this.f.slice(0),u=this.f.length;u<d;u++)e[u]=g;this.f=e}this.size=d};e.prototype.cf=function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=function(d,g,e){for(var m=this.size;g<m&&g<e;g++)d=h.I.kg(this.read(g),d);return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&
u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=function(d,g,e,u,C,a,b){if(this.Sa)throw h.g.xa();if(!C&&(1>a||0!=u%a))throw h.g.N();for(var m=0;m<b-d;m++)this.f[d+u+m]=this.f[d+m];this.f==g.f&&d<e&&(e+=u);if(C)for(m=0;m<u;m++)this.f[m+d]=g.f[e+m];else for(C=u,b=0;b<u;b+=a)for(C-=a,m=0;m<a;m++)this.f[d+b+m]=g.f[e+C+m]};e.prototype.ul=function(d,g,e,u){if(this.Sa)throw h.g.xa();u-=d;for(var m=this.f.slice(d,d+u),a=0;a<u;a++)this.f[d+e+a]=m[a];for(u=
0;u<e;u++)this.f[d+u]=g};e.prototype.lg=function(d,g,e){if(this.Sa)throw h.g.xa();for(var m=this.f.slice(d,d+(e-d)),C=0;C<e-d;C++)this.f[C+d+2]=m[C];this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=function(d,g,e,u,C,a){if(0>d||0>g||0>u)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(e.size<u+g)throw h.g.N();if(0!=g)if(this.size<g+d&&this.resize(g+d),e==this)this.xi(d,g,u,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u++;else if(u=u+g-a,1==a)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u--;else for(C=
0,g=h.I.truncate(g/a);C<g;C++){for(var m=0;m<a;m++)this.f[d+m]=e.f[u+m];d+=a;u-=a}};e.prototype.oj=function(d,g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();if(0<e-(d+g)){e-=d+g;for(var m=this.f.slice(d+g,d+e+g),C=0;C<e;C++)this.f[d+C]=m[C]}this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,
g,e){if(0>g||0>e||0>g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,g,e,u,C){if(!u||d!=e){for(var m=0;m<g;m++)this.f[d+m]=this.f[e+m];if(!u)for(e=d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}}};e.prototype.$p=function(d,g,e,u,C){if(0>d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+
1]=e[u].y,d+=C};e.prototype.Hp=function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,e){var m=this.f.slice(0,d),C=this.f.slice(g);d=this.f.slice(d,g).sort(e);this.f.length=0;this.f.push.apply(this.f,m.concat(d).concat(C))};e.prototype.Qh=function(){return 1};e.prototype.xy=function(d,g){if(this.Sa)throw h.g.ra("invalid call. Attribute Stream is read only.");
this.f[d]|=g};e.prototype.BB=function(d,g){if(this.Sa)throw h.g.ra("invalid call. Attribute Stream is read only.");this.f[d]&=~g};e.ob=0;return e}();h.Wk=b;b=function(){function e(d){this.f=null;var g=d;2>g&&(g=2);this.f=new Int8Array(g);this.size=d}e.Yc=function(d,g){var m=new e(d),u=m.f;2>d&&(d=2);if(0!==g)for(var C=0;C<d;C++)u[C]=g;return m};e.lj=function(d){var g=new e(0);g.f=new Int8Array(d.f);g.size=d.size;return g};e.V=function(d,g){var m=new e(0);m.size=d.size;m.size>g&&(m.size=g);g=m.size;
2>g&&(g=2);m.f=new Int8Array(g);m.f.set(d.f.length<=g?d.f:d.f.subarray(0,g),0);return m};e.prototype.xb=function(d){0>=d||(null==this.f?this.f=new Int8Array(d):d<=this.f.length||(0<this.f.length?(d=new Int8Array(d),d.set(this.f),this.f=d):this.f=new Int8Array(d)))};e.prototype.read=function(d){return this.f[d]};e.prototype.ec=function(d,g){g.x=this.f[d];g.y=this.f[d+1]};e.prototype.get=function(d){return this.f[d]};e.prototype.write=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.set=
function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g};e.prototype.Rn=function(d,g){if(this.Sa)throw h.g.xa();this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.add=function(d){this.resize(this.size+1);this.f[this.size-1]=d};e.prototype.Ip=function(d){return e.V(this,d)};e.prototype.Bh=function(d){return this.read(d)};e.prototype.resize=function(d,g){void 0===g&&(g=0);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");if(d<=this.size){if(30<this.f.length&&5*d/4<this.f.length){var e=
new Int8Array(this.f,0,d);this.f=e}}else{d>this.f.length&&(e=h.I.truncate(64>d?Math.max(2*d,4):5*d/4),e=new Int8Array(e),e.set(this.f),this.f=e);for(var e=this.f,u=this.size;u<d;u++)e[u]=g}this.size=d};e.prototype.cf=function(d){(null==this.f||d>this.f.length)&&this.resize(d);if(this.Xf)throw h.g.ra("invalid call. Attribute Stream is locked and cannot be resized.");this.size=d};e.prototype.Uk=function(d,g){this.write(d,g)};e.prototype.jj=function(d,g,e){for(var m=this.size;g<m&&g<e;g++)d=h.I.kg(this.read(g),
d);return d};e.prototype.lc=function(d,g,m){if(null==d||!(d instanceof e))return!1;var u=this.size,C=d.size;if(m>u||m>C&&u!=C)return!1;for(m>u&&(m=u);g<m;g++)if(this.read(g)!=d.read(g))return!1;return!0};e.prototype.nk=function(d,g,e,u,C,M,b){if(this.Sa)throw h.g.xa();if(!C&&(1>M||0!=u%M))throw h.g.N();a(this.f,d+u,d,d+(b-d));this.f==g.f&&d<e&&(e+=u);if(C)this.f.set(g.f.subarray(e,e+u),d);else for(C=u,b=0;b<u;b+=M){C-=M;for(var m=0;m<M;m++)this.f[d+b+m]=g.f[e+C+m]}};e.prototype.ul=function(d,g,e,
u){if(this.Sa)throw h.g.xa();u-=d;a(this.f,d+u,d,d+u);for(u=0;u<e;u++)this.f[d+u]=g};e.prototype.lg=function(d,g,e){if(this.Sa)throw h.g.xa();a(this.f,d+2,d,d+(e-d));this.f[d]=g.x;this.f[d+1]=g.y};e.prototype.km=function(d,g,e,u,C,a){if(0>d||0>g||0>u)throw h.g.N();if(!C&&(0>=a||0!=g%a))throw h.g.N();if(e.size<u+g)throw h.g.N();if(0!=g)if(this.size<g+d&&this.resize(g+d),e==this)this.xi(d,g,u,C,a);else if(C)for(C=0;C<g;C++)this.f[d]=e.f[u],d++,u++;else if(u=u+g-a,1==a)for(C=0;C<g;C++)this.f[d]=e.f[u],
d++,u--;else for(C=0,g=h.I.truncate(g/a);C<g;C++){for(var m=0;m<a;m++)this.f[d+m]=e.f[u+m];d+=a;u-=a}};e.prototype.oj=function(d,g,e){if(this.Sa)throw h.g.xa();if(d+g>this.size)throw h.g.xa();0<e-(d+g)&&a(this.f,d,d+g,d+(e-(d+g))+g);this.size-=g};e.prototype.Jp=function(d,g,e){if(this.Sa)throw h.g.xa();if(1>e||0!=g%e)throw h.g.xa();for(var m=g>>1,C=0;C<m;C+=e){g-=e;for(var a=0;a<e;a++){var b=this.f[d+C+a];this.f[d+C+a]=this.f[d+g+a];this.f[d+g+a]=b}}};e.prototype.dh=function(d,g,e){if(0>g||0>e||0>
g||e+g>this.size)throw h.g.N();for(var m=g;m<g+e;m++)this.f[m]=d};e.prototype.xi=function(d,g,e,u,C){if(!u||d!=e)if(this.f.set(this.f.subarray(e,e+g),d),!u)for(e=d,d=d+g-C,u=0,g=h.I.truncate(g/2);u<g;u++){for(var m=0;m<C;m++){var a=this.f[e+m];this.f[e+m]=this.f[d+m];this.f[d+m]=a}e+=C;d-=C}};e.prototype.$p=function(d,g,e,u,C){if(0>d||0>g||0>u)throw h.g.N();if(0!=g)for(this.size<(g<<1)+d&&this.resize((g<<1)+d),C||(d+=g-1<<1),C=C?2:-2,g+=u;u<g;u++)this.f[d]=e[u].x,this.f[d+1]=e[u].y,d+=C};e.prototype.Hp=
function(d,g,e,u,C){if(0>d||0>g||0>u||this.size<g+d)throw h.g.N();if(C)for(C=0;C<g;C++)e[u+C]=this.f[d+C];else for(u=u+g-1;d<g;d++)e[u]=this.f[d],u--};e.prototype.clear=function(d){d?this.resize(0):this.cf(0)};e.prototype.xd=function(d,g,e){g=this.f.subarray(d,g);Array.prototype.sort.call(g,e);this.f.set(g,d)};e.prototype.xy=function(d,g){if(this.Sa)throw h.g.ra("invalid call. Attribute Stream is read only.");this.f[d]|=g};e.prototype.BB=function(d,g){if(this.Sa)throw h.g.ra("invalid call. Attribute Stream is read only.");
this.f[d]&=~g};e.prototype.Qh=function(){return 1};return e}();h.Yu=b})(A||(A={}));!0===A.ah.Sk&&(A.Wk=A.Yu);(function(h){var a=function(){function a(){}a.to=function(e,d){return h.Wk.Yc(e,d)};a.kl=function(e,d){return h.qd.Yc(e,d)};a.Sv=function(e,d,g){switch(e){case 1:e=h.qd.Yc(d,g);break;case 2:e=h.ga.Yc(d,g);break;case 4:e=h.Wk.Yc(d,g);break;default:throw h.g.wa();}return e};a.Tv=function(e,d){return a.Sv(h.pa.Qh(e),d*h.pa.Wa(e),h.pa.ue(e))};a.Dg=function(e,d){return h.ga.Yc(e,d)};a.ay=function(e){var d,
g=[];for(d=0;d<e;d++)g.push(null);return g};return a}();h.Ac=a})(A||(A={}));(function(h){var a=function(){function a(){}a.to=function(e,d){return h.Yu.Yc(e,d)};a.kl=function(e,d){return h.qd.Yc(e,d)};a.Sv=function(e,d,g){switch(e){case 1:e=h.qd.Yc(d,g);break;case 2:e=h.Xu.Yc(d,g);break;case 4:e=h.Yu.Yc(d,g);break;default:throw h.g.wa();}return e};a.Tv=function(e,d){return h.Ac.Sv(h.pa.Qh(e),d*h.pa.Wa(e),h.pa.ue(e))};a.Dg=function(e,d){return h.Xu.Yc(e,d)};a.ay=function(e){var d,g=[];for(d=0;d<e;d++)g.push(null);
return g};return a}();h.RG=a})(A||(A={}));!0===A.ah.Sk&&(A.Ac=A.RG);(function(h){h.ca=function(){return function(h){void 0===h&&(h=0);this.l=h}}()})(A||(A={}));(function(h){var a=function(){function e(){}e.nb=function(d,g){return 0<=g?e.H(d):-e.H(d)};e.H=function(d){return 0>d?-d:d};e.Ih=function(d){return 3.552713678800501E-15>d};e.Xz=function(d,g,m){return e.H(d-g)<=m*(1+(e.H(d)+e.H(g))/2)};e.S=function(d,g){return e.Xz(d,g,3.552713678800501E-15)};e.wI=function(d){return 3.552713678800501E-15>=
e.H(d)};e.Vc=function(d){return e.wI(d)};return e}();h.j=a;var b=function(){function e(){}e.Sn=function(d,g){d=a.H(d);g=a.H(g);var e=0;0!=d+g&&(d>g?(e=g/d,e=d*Math.sqrt(1+e*e)):(e=d/g,e=g*Math.sqrt(1+e*e)));return e};e.Ep=function(d,g,m,u,C){for(var h=[0,0,0],b=[0,0,0],c=0;2>=c;c++)g[c]-=d[c],m[c]-=g[c];m=h[1]*b[2]-h[2]*b[1];g=h[2]*b[0]-h[0]*b[2];h=h[0]*b[1]-h[1]*b[0];d=-1*(m*d[0]+g*d[1]+h*d[2]);u[0]=m;u[1]=g;u[2]=h;u[3]=d;b=e.jm(u);u[0]/=b;u[1]/=b;u[2]/=b;u[3]/=b;0!=C&&(b=a.Vc(h)?a.Vc(d)?a.nb(1,
g):-a.nb(1,d):a.nb(1,h),b*=a.nb(1,C),u[0]*=b,u[1]*=b,u[2]*=b,u[3]*=b)};e.Uu=function(d,g,e){e[0]=d[1]*g[2]-g[1]*d[2];e[1]=d[2]*g[0]-g[2]*d[0];e[2]=d[0]*g[1]-g[0]*d[1]};e.Qr=function(d,g){return d[0]*g[0]+d[1]*g[1]+d[2]*g[2]};e.jm=function(d){return e.Sn(e.Sn(d[0],d[1]),d[2])};e.wm=function(d,g,m,u,C,h){var a=e.n(1,d,g),b=Math.cos(g);u.l=(a+0)*b*Math.cos(m);C.l=(a+0)*b*Math.sin(m);h.l=(a*(1-d)+0)*Math.sin(g)};e.JK=function(d,g,m,u,C,h,b){var M=e.Sn(g,m),c=1*Math.sqrt(1-d),p=c/1;if(a.S(M,0))h.l=0,C.l=
a.nb(1.570796326794897,u),b.l=a.H(u)-c;else{h.l=Math.atan2(m,g);m=Math.atan2(1*u,c*M);h=Math.cos(m);var f=Math.sin(m);g=c*d/(1-d);d*=1;m=Math.atan2(u+g*f*f*f,M-d*h*h*h);3.141592653589793<a.H(m)&&(m=a.nb(3.141592653589793,m)-m);m=Math.atan(p*Math.tan(m));f=Math.sin(m);h=Math.cos(m);C.l=Math.atan2(u+g*f*f*f,M-d*h*h*h);1.570796326794897<a.H(C.l)&&(C.l=a.nb(3.141592653589793,C.l)-C.l);m=Math.atan(p*Math.tan(C.l));f=Math.sin(m);h=Math.cos(m);b.l=(u-c*f)*Math.sin(C.l)+(M-1*h)*Math.cos(C.l)}};e.n=function(d,
g,e){e=Math.sin(e);return d/Math.sqrt(1-g*e*e)};e.sr=function(d,g){return Math.atan2(Math.sin(g)*(1-d),Math.cos(g))};e.Si=function(d,g){return Math.atan2(Math.sin(g),Math.cos(g)*(1-d))};e.xn=function(d,g){if(a.Ih(d)||0==g||a.S(a.H(g),1.570796326794897))return g;var m,u,C,h,b,c,p,f,l;if(.006884661117170036>d){h=Math.sqrt(1-d);b=(1-h)/(1+h);c=b*b;p=b*c;f=b*p;m=b*f;l=b*m;u=b*l;C=1.572916666666667*p-3.2578125*m+4.295068359375*u;h=2.142578125*f-6.071484375*l;d=3.129296875*m-11.249837239583334*u;var q=
4.775276692708333*l,n=7.958636765252976*u,z=Math.cos(2*g);return g+Math.sin(2*g)*(1.5*b-.84375*p+.525390625*m-.2688395182291667*u-C+d-n+z*(2*(1.3125*c-1.71875*f+1.650146484375*l)-4*h+6*q+z*(4*C-12*d+24*n+z*(8*h-32*q+z*(16*d-80*n+z*(32*q+64*z*n))))))}h=1-d;b=d/2;c=a.H(g);p=c*e.Yr(d)/(1.570796326794897*h);f=9999;l=c;for(c=0;1E-16<f&&50>c;c++)u=e.Tk(d,l),m=(e.Lz(l,d)-b*Math.sin(2*l)/u)/h-p,u=1/(u*u*u),C=m/u,m=l-C,f=a.H(C),l=m;return 0<=g?l:-l};e.nR=function(d,g){return a.Ih(g)?d:d*e.Yr(g)/1.570796326794897};
e.W=function(d){d=e.Hz(d,6.283185307179586);return 0>d?d+6.283185307179586:3.141592653589793>a.H(d)||a.S(a.H(d),3.141592653589793)?d:d-6.283185307179586};e.Hz=function(d,g){return d-Math.floor(d/g)*g};e.gg=function(d,g){if(.006884661117170036>g){g=Math.sqrt(1-g);g=(1-g)/(1+g);var m=g*g,u=m*m;return d/(1+g)*(1+.25*m+.015625*u+.00390625*m*u)*1.570796326794897}return d*e.Yr(g)};e.Dp=function(d,g){var m=a.nb(1,Math.sin(g));g=a.H(e.Hz(g,3.141592653589793));g=1.570796326794897>=g?g:3.141592653589793-g;
var u;a.S(g,1.570796326794897)?u=g:u=Math.atan(Math.sqrt(1-d)*Math.tan(g));return u*m};e.q=function(d,g,m){if(.006884661117170036>g){g=Math.sqrt(1-g);g=(1-g)/(1+g);var u=g*g,C=g*u,h=g*C,a=g*h,b=g*a,c=g*b,p=-.7291666666666666*C+.2278645833333333*a+.03987630208333334*c,f=.615234375*h-.21533203125*b,l=-.54140625*a+.20302734375*c,q=.48876953125*b,n=-.4488699776785715*c,z=Math.cos(2*m);return d/(1+g)*((1+.25*u+.015625*h+.00390625*b)*m+Math.sin(2*m)*(-1.5*g+.1875*C+.0234375*a+.00732421875*c-p+l-n+z*(2*
(.9375*u-.234375*h-.03662109375*b)-4*f+6*q+z*(4*p-12*l+24*n+z*(8*f-32*q+z*(16*l-80*n+z*(32*q+64*z*n)))))))}return d*(e.Lz(m,g)-.5*g*Math.sin(2*m)/e.Tk(g,m))};e.Tk=function(d,g){g=Math.sin(g);return Math.sqrt(1-d*g*g)};e.Yr=function(d){return a.Xz(d,1,2.220446049250313E-16)?1:1>d?e.js(0,1-d)-d/3*e.hs(0,1-d):NaN};e.Lz=function(d,g){var m=a.nb(1,d);d=a.H(d);var u=Math.floor(d/1.570796326794897),C;if(1<g)C=0==d?0:NaN;else if(a.Vc(u))C=e.sin(d),C=C*e.js(1-C*C,1-g*C*C)-g/3*C*C*C*e.hs(1-C*C,1-g*C*C);else{C=
h.I.truncate(u%2);var b=e.Yr(g);0<C?(C=Math.sin(1.570796326794897*(u+1)-d),C=C*e.js(1-C*C,1-g*C*C)-g/3*C*C*C*e.hs(1-C*C,1-g*C*C),C=b*(u+1)-C):(C=Math.sin(d-1.570796326794897*u),C=C*e.js(1-C*C,1-g*C*C)-g/3*C*C*C*e.hs(1-C*C,1-g*C*C),C=b*u+C)}return C*m};e.sin=function(d){d=e.W(d);var g=a.nb(1,d);d=a.H(d);return a.S(d,3.141592653589793)?0:a.S(d,1.570796326794897)?1*g:Math.sin(d)*g};e.hs=function(d,g){for(var e=1,u=0,C=1,h,b,c,p;;){h=.2*(d+g+3*e);b=(h-d)/h;c=(h-g)/h;p=(h-e)/h;if(1E-4>a.H(b)&&1E-4>a.H(c)&&
1E-4>a.H(p))break;p=Math.sqrt(g);h=Math.sqrt(e);p=Math.sqrt(d)*(p+h)+p*h;u+=C/(h*(e+p));C*=.25;d=.25*(d+p);g=.25*(g+p);e=.25*(e+p)}d=b*c;e=p*p;g=d-e;e=d-6*e;b=e+g+g;return 3*u+C*(1+e*(-.2142857142857143+.10227272727272728*e-.1730769230769231*p*b)+p*(.1666666666666667*b+p*(-.4090909090909091*g+.1153846153846154*p*d)))/(h*Math.sqrt(h))};e.js=function(d,g){for(var e,u,C,h,b=1;;b=.25*(b+e)){e=(d+g+b)/3;u=2-(e+d)/e;C=2-(e+g)/e;h=2-(e+b)/e;if(1E-4>a.H(u)&&1E-4>a.H(C)&&1E-4>a.H(h))break;e=Math.sqrt(g);u=
Math.sqrt(b);e=Math.sqrt(d)*(e+u)+e*u;d=.25*(d+e);g=.25*(g+e)}d=u*C-h*h;g=u*C*h;return(1+(.04166666666666666*d-.1-.06818181818181818*g)*d+.07142857142857142*g)/Math.sqrt(e)};e.qu=function(d,g){if(a.Ih(d)||0==g||a.S(a.H(g),1.570796326794897))return g;var e,u,C;if(.006884661117170036>d){e=d*d;u=d*e;C=d*u;var h=d*C,b=d*h,c=d*b,p=-(.02708333333333333*u+.03430059523809524*C+.03149181547619048*h+.02634359154541446*b+.02156896735835538*c),f=.007669890873015873*C+.01299603174603175*h+.0148051353064374*b+
.01454454953803912*c,l=-(.002275545634920635*h+.004830845032667949*b+.006558395368616723*c),q=6.957236677288761E-4*b+.001775193002406544*c,n=-(2.17324089394402E-4*c),z=Math.cos(2*g);return g+Math.sin(2*g)*(-(.5*d+.2083333333333333*e+.09375*u+.04878472222222222*C+.02916666666666667*h+.01938905423280423*b+.01388255931712963*c)-p+l-n+z*(2*(.1041666666666667*e+.0875*u+.06050347222222222*C+.04151785714285714*h+.02958958540013228*b+.02203667534722222*c)-4*f+6*q+z*(4*p-12*l+24*n+z*(8*f-32*q+z*(16*l-80*n+
z*(32*q+64*z*n))))))}0==g||a.S(a.H(g),1.570796326794897)?e=g:(u=Math.sqrt(d),C=u*Math.sin(g),e=Math.tan(.7853981633974483+g/2)*Math.pow((1-C)/(1+C),u/2),e=2*Math.atan(e)-1.570796326794897);return e};e.$K=function(d,g){if(a.Ih(d)||0==g||a.S(a.H(g),1.570796326794897))return g;var e,u;if(.006884661117170036>d){z=d*d;l=d*z;q=d*l;e=d*q;n=d*e;u=d*n;var C=.05833333333333333*l+.07232142857142858*q+.05634300595238095*e+.0355325796406526*n+.020235546186067*u,h=.02653149801587302*q+.04379960317460317*e+.0429211791776896*
n+.03255384637546096*u,b=.01294022817460318*e+.02668104344536636*n+.03155651254609588*u,c=.00659454790965208*n+.0163075268674227*u,p=.003463473736911237*u,f=Math.cos(2*g);return g+Math.sin(2*g)*(.5*d+.2083333333333333*z+.08333333333333333*l+.03611111111111111*q+.01875*e+.01195601851851852*n+.008863673941798942*u-C+b-p+f*(2*(.1458333333333333*z+.1208333333333333*l+.07039930555555556*q+.03616071428571429*e+.01839451058201058*n+.01017113095238095*u)-4*h+6*c+f*(4*C-12*b+24*p+f*(8*h-32*c+f*(16*b-80*p+
f*(32*c+64*f*p))))))}for(var l=Math.sqrt(d),q=l/2,n=Math.tan(.7853981633974483+g/2),C=0,h=1,z=g;0!=h;z=u)if(e=l*Math.sin(z),u=n*Math.pow((1+e)/(1-e),q),u=2*Math.atan(u)-1.570796326794897,C++,a.S(u,z)||3E4<C)h=0;return z};return e}();h.u=b})(A||(A={}));(function(h){var a=function(){function a(){}a.Fb=function(e,d,g,m,u,C,a,b){if(null!=C||null!=a||null!=b){m=h.u.W(m);d=h.u.W(d);g=h.u.W(g);u=h.u.W(u);1.570796326794897<h.j.H(g)&&(g=h.j.nb(3.141592653589793,g)-g,d=h.u.W(d+3.141592653589793));1.570796326794897<
h.j.H(u)&&(u=h.j.nb(3.141592653589793,u)-u,m=h.u.W(m+3.141592653589793));var M=h.u.W(m-d);if(h.j.S(g,u)&&(h.j.S(d,m)||h.j.S(h.j.H(g),1.570796326794897)))null!=C&&(C.l=0),null!=a&&(a.l=0),null!=b&&(b.l=0);else{if(h.j.S(g,-u)){if(h.j.S(h.j.H(g),1.570796326794897)){null!=C&&(C.l=3.141592653589793*e);null!=a&&(a.l=0<g?h.u.W(3.141592653589793-h.u.W(m)):h.u.W(m));null!=b&&(b.l=0<g?h.u.W(m):h.u.W(3.141592653589793-h.u.W(m)));return}if(h.j.S(h.j.H(M),3.141592653589793)){null!=C&&(C.l=3.141592653589793*e);
null!=a&&(a.l=0);null!=b&&(b.l=0);return}}var c=1.570796326794897==h.j.H(g)?0:Math.cos(g),p=Math.sin(g),f=1.570796326794897==h.j.H(u)?0:Math.cos(u),Y=Math.sin(u),l=1.570796326794897==h.j.H(M)?0:Math.cos(M),q=3.141592653589793==h.j.H(M)?0:Math.sin(M);if(null!=C){var n=Math.sin((u-g)/2),M=Math.sin(M/2);C.l=2*Math.asin(Math.sqrt(n*n+c*f*M*M))*e}null!=a&&(h.j.S(h.j.H(g),1.570796326794897)?a.l=0>g?m:h.u.W(3.141592653589793-m):a.l=Math.atan2(f*q,c*Y-p*f*l));null!=b&&(h.j.S(h.j.H(u),1.570796326794897)?b.l=
0>u?d:h.u.W(3.141592653589793-d):(b.l=Math.atan2(c*q,Y*c*l-f*p),b.l=h.u.W(b.l+3.141592653589793)))}}};a.gf=function(e,d,g,m,u,C,a){if(null!=C||null!=a){d=h.u.W(d);g=h.u.W(g);1.570796326794897<h.j.H(g)&&(g=h.j.nb(3.141592653589793,g)-g,d=h.u.W(d+3.141592653589793));h.j.S(h.j.H(g),1.570796326794897)&&(d=0);u=h.u.W(u);var b=h.j.S(h.j.H(u),1.570796326794897)?0:Math.cos(u),M=h.j.S(h.j.H(u),3.141592653589793)?0:Math.sin(u),c=h.j.S(h.j.H(g),1.570796326794897)?0:Math.cos(g),p=Math.sin(g);e=m/e;m=h.j.S(h.j.H(e),
1.570796326794897)?0:Math.cos(e);var f=h.j.S(h.j.H(e),3.141592653589793)?0:Math.sin(e),l=Math.asin(p*m+c*f*b);null!=a&&(a.l=l);null!=C&&(C.l=h.j.S(h.j.H(l),1.570796326794897)?h.j.S(g,-l)?0>l?u:h.u.W(3.141592653589793-u):d:h.j.S(h.j.H(g),1.570796326794897)&&h.j.S(e,3.141592653589793)?0>g?u:h.u.W(3.141592653589793-u):h.u.W(d+Math.atan2(f*M,c*m-p*f*b)))}};return a}();h.zg=a})(A||(A={}));(function(h){var a=function(){function a(){}a.Fb=function(e,d,g,m,u,C,a,b,c){var M=new h.ca(0),p=new h.ca(0),f=[0,
0,0],Y=[0,0,0],l=[0,0,0],q=new h.ca(0),W=new h.ca(0),n=new h.ca(0),z=new h.ca(0),v=new h.ca(0);if(null!=a||null!=b||null!=c)if(h.j.Ih(d))h.zg.Fb(e,g,m,u,C,a,b,c);else{u=h.u.W(u);g=h.u.W(g);var k=h.u.W(u-g);if(h.j.S(m,C)&&(h.j.S(g,u)||h.j.S(h.j.H(m),1.570796326794897)))null!=a&&(a.l=0),null!=b&&(b.l=0),null!=c&&(c.l=0);else{if(h.j.S(m,-C)){if(h.j.S(h.j.H(m),1.570796326794897)){null!=a&&(a.l=2*h.u.gg(e,d));null!=b&&(b.l=0<m?h.u.W(3.141592653589793-h.u.W(u)):h.u.W(u));null!=c&&(c.l=0<m?h.u.W(u):h.u.W(3.141592653589793-
h.u.W(u)));return}h.j.S(h.j.H(k),3.141592653589793)&&(null!=a&&(a.l=2*h.u.gg(e,d)),null!=b&&(b.l=0),null!=c&&(c.l=0))}else if(h.j.S(h.j.H(m),1.570796326794897)||h.j.S(h.j.H(C),1.570796326794897))h.j.S(h.j.H(m),1.570796326794897)?g=u:u=g;var A=0,t;0>k&&(A=1,t=g,g=u,u=t,t=m,m=C,C=t);var k=h.u.sr(d,m),y=h.u.sr(d,C);if(null!=b||null!=c)h.zg.Fb(e,g,k,u,y,null,M,p),M=Math.atan2(Math.sin(M.l)*Math.cos(m-k),Math.cos(M.l)),p=Math.atan2(Math.sin(p.l)*Math.cos(C-y),Math.cos(p.l)),0!=A&&(t=M,M=p,p=t),null!=b&&
(b.l=M),null!=c&&(c.l=p);null!=a&&(h.u.wm(d,m,g,n,z,v),f[0]=n.l,f[1]=z.l,f[2]=v.l,h.u.wm(d,C,u,n,z,v),Y[0]=n.l,Y[1]=z.l,Y[2]=v.l,l[0]=f[1]*Y[2]-Y[1]*f[2],l[1]=-(f[0]*Y[2]-Y[0]*f[2]),l[2]=f[0]*Y[1]-Y[0]*f[1],d=1-h.u.Tk(d,h.u.Dp(d,h.u.Si(d,Math.acos(l[2]/Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]))))),d*=2-d,b=Math.atan2(-l[1],-l[0]),l=h.u.W(b-1.570796326794897),b=h.u.W(b+1.570796326794897),l=h.j.H(h.u.W(g-l))<=h.j.H(h.u.W(g-b))?l:b,h.zg.Fb(1,l,0,g,k,q,null,null),h.zg.Fb(1,l,0,u,y,W,null,null),3.141592653589793<
q.l+W.l&&(l=h.u.W(l+3.141592653589793),h.zg.Fb(1,l,0,g,k,q,null,null),h.zg.Fb(1,l,0,u,y,W,null,null)),q.l*=h.j.nb(1,m),W.l*=h.j.nb(1,C),q.l=h.u.Si(d,q.l),W.l=h.u.Si(d,W.l),g=h.u.q(e,d,q.l),e=h.u.q(e,d,W.l),a.l=h.j.H(e-g))}}};a.gf=function(e,d,g,m,u,C,a,b){var M=0,c=new h.ca(0),p=new h.ca(0),f=[0,0,0],l=[0,0,0],Y=new h.ca(0),q=new h.ca(0),n=new h.ca(0);if(null!=a||null!=b)if(h.j.Ih(d))h.zg.gf(e,g,m,u,C,a,b);else if(h.j.Vc(u))null!=a&&(a.l=g),null!=b&&(b.l=m);else{C=h.u.W(C);0>u&&(u=h.j.H(u),C=h.u.W(C+
3.141592653589793));g=h.u.W(g);m=h.u.W(m);1.570796326794897<h.j.H(m)&&(g=h.u.W(g+3.141592653589793),m=h.j.nb(3.141592653589793,m)-m);h.j.S(h.j.H(m),1.570796326794897)&&(g=0);var z;if(h.j.Vc(m))z=h.j.H(1.570796326794897-h.j.H(C)),z=h.u.Si(d,z),z=1-h.u.Tk(d,h.u.Dp(d,z)),z*=2-z,e=u/h.u.gg(e,z)*1.570796326794897,e=h.u.xn(z,e),e=h.u.sr(z,e),h.zg.gf(1,g,m,e,C,a,c),null!=b&&(M=c.l),null!=b&&(b.l=h.u.Si(d,M));else if(h.j.S(h.j.H(m),1.570796326794897))M=h.u.gg(e,d),c=2*M,e=h.j.nb(1.570796326794897,m),C=0<
e?h.u.W(3.141592653589793-C):C,m=M-u,h.j.H(m)<=M?null!=a&&(a.l=C):(m=Math.floor(u/c),0==h.I.truncate(m%2)?(null!=a&&(a.l=C),m=M-(u-m*c)):(null!=a&&(a.l=h.u.W(C+3.141592653589793)),m=M-((m+1)*c-u))),null!=b&&(b.l=h.u.xn(d,m/M*e));else{z=h.u.sr(d,m);C=Math.atan2(Math.sin(C),Math.cos(C)*Math.cos(m-z));var v=h.I.truncate(h.j.nb(1,z))*(1.570796326794897>=h.j.H(C)?1:-1);C=h.u.W(g+Math.atan(Math.tan(C)*-Math.sin(z)));h.zg.Fb(e,C,0,g,z,null,p,null);z=h.j.H(1.570796326794897-h.j.H(p.l));z=h.u.Si(d,z);z=1-
h.u.Tk(d,h.u.Dp(d,z));z*=2-z;h.u.wm(d,0,C,Y,q,n);f[0]=Y.l;f[1]=q.l;f[2]=n.l;h.u.wm(d,m,g,Y,q,n);l[0]=Y.l;l[1]=q.l;l[2]=n.l;m=Math.acos((f[0]*l[0]+f[1]*l[1]+f[2]*l[2])/Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]));m=h.u.Si(z,m);m=h.u.q(e,z,m)+u*v;u=0<m?p.l:h.u.W(p.l+3.141592653589793);e=h.j.H(m)/h.u.gg(e,z)*1.570796326794897;e=h.u.xn(z,e);e=h.u.sr(z,e);h.zg.gf(1,C,0,e,u,a,c);null!=b&&(M=c.l);null!=b&&(b.l=h.u.Si(d,M))}}};return a}();h.Xj=a})(A||(A={}));(function(h){var a=function(){function a(){}a.Fb=
function(e,d,g,m,u,C,a,b,c){var M=0,p=0,f=0;if(null!=a||null!=b||null!=c)if(h.j.Ih(d))h.zg.Fb(e,g,m,u,C,a,b,c);else{var l=h.u.W(u-g);if(h.j.S(m,C)&&(h.j.Vc(l)||h.j.S(h.j.H(m),1.570796326794897)))null!=a&&(a.l=0),null!=b&&(b.l=0),null!=c&&(c.l=0);else{if(h.j.S(m,-C)){if(h.j.S(h.j.H(m),1.570796326794897)){null!=a&&(a.l=2*h.u.gg(e,d));null!=b&&(b.l=0<m?h.u.W(3.141592653589793-h.u.W(u)):h.u.W(u));null!=c&&(c.l=0<m?h.u.W(u):h.u.W(3.141592653589793-h.u.W(u)));return}h.j.S(h.j.H(l),3.141592653589793)&&(null!=
a&&(a.l=2*h.u.gg(e,d)),null!=b&&(b.l=0),null!=c&&(c.l=0))}else{if(h.j.S(h.j.H(m),1.570796326794897)||h.j.S(h.j.H(C),1.570796326794897)){h.Xj.Fb(e,d,g,m,u,C,a,b,c);return}if(h.j.Vc(l)||h.j.S(h.j.H(l),3.141592653589793)){h.Xj.Fb(e,d,g,m,u,C,a,b,c);return}}var Y=1-Math.sqrt(1-d),q=d/(1-d),W=e*(1-Y);e=h.u.Dp(d,m);var n=h.u.Dp(d,C);d=1.570796326794897==h.j.H(e)?0:Math.cos(e);var z=Math.sin(e),v=1.570796326794897==h.j.H(n)?0:Math.cos(n),k=Math.sin(n),t=l,A=Math.cos(t),y=Math.sin(t),w=1,D=0,F,B,Q,J,G;do{F=
t;B=Math.sqrt(Math.pow(v*y,2)+Math.pow(d*k-z*v*A,2));Q=z*k+d*v*A;J=Math.atan2(B,Q);if(0==B){w=0;break}G=d*v*y/B;M=Math.cos(Math.asin(G));M*=M;p=Q-2*z*k/M;1<h.j.H(p)&&(p=h.j.nb(1,p));f=p*p;t=Y/16*M*(4+Y*(4-3*M));t=l+(1-t)*Y*G*(J+t*B*(p+t*Q*(2*f-1)));A=Math.cos(t);y=Math.sin(t);D++;if(3.141592653589793<h.j.H(t)&&30<D){w=0;break}}while(5E3>=D&&!h.j.S(F,t));if(0!=w)q*=M,Y=q*(256+q*(-128+q*(74-47*q)))/1024,null!=a&&(a.l=W*(1+q*(4096+q*(-768+q*(320-175*q)))/16384)*(J-Y*B*(p+Y/4*(Q*(2*f-1)-Y/6*p*(4*B*B-
3)*(4*f-3))))),null!=b&&(h.j.S(h.j.H(m),1.570796326794897)?b.l=0>m?u:h.u.W(3.141592653589793-u):b.l=Math.atan2(v*y,d*k-z*v*A)),null!=c&&(h.j.S(h.j.H(C),1.570796326794897)?c.l=0>C?g:h.u.W(3.141592653589793-g):(c.l=Math.atan2(d*y,d*k*A-z*v),c.l=h.u.W(c.l+3.141592653589793)));else{t=h.j.nb(3.141592653589793,l);Q=z*k-d*v;J=Math.acos(Q);B=Math.sin(J);M=1;D=G=0;do f=G,M*=M,A=M*M,G=Y*M*(1+Y+Y*Y),p=Y*Y*A*(1+2.25*Y),w=Y*Y*Y*A*M,A=1-.25*G+.1875*p-.1953125*w,G=.25*G-.25*p+.29296875*w,y=.03125*p-.05859375*w,
w*=.00651041666666667,p=Q-2*z*k/M,1<h.j.H(p)&&(p=h.j.nb(1,p)),M=Math.acos(p),Q=Math.cos(2*M),F=Math.cos(3*M),G=h.j.S(m,-C)?h.u.W(3.141592653589793-l)/(3.141592653589793*Y*A):h.u.W(t-l)/(Y*(A*J+G*B*p+y*Math.sin(2*J)*Q+w*Math.sin(3*J)*F)),y=G*B/(d*v),t=1.570796326794897<h.j.H(l)?h.j.nb(3.141592653589793,y)-Math.asin(y):Math.asin(y),A=Math.cos(t),B=Math.sqrt(Math.pow(v*y,2)+Math.pow(d*k-z*v*A,2)),J=3.141592653589793-Math.asin(h.j.H(B)),Q=Math.cos(J),M=Math.cos(Math.asin(G)),D++;while(70>=D&&!h.j.S(f,
G));null!=a&&(M*=M,q*=M,A=1+q*(4096+q*(-768+q*(320-175*q)))/16384,h.j.S(m,-C)?a.l=3.141592653589793*W*A:(p=Q-2*z*k/M,M=Math.acos(p),Q=Math.cos(2*M),F=Math.cos(3*M),a.l=W*(A*J+q*(-512+q*(128+q*(-60+35*q)))/2048*B*p+q*(-4+5*q)/6144*q*q*Math.sin(2*J)*Q+w*Math.sin(3*J)*F+-7.62939453125E-5*q*q*q*q*Math.sin(4*J)*Math.cos(4*M))));null!=b&&(h.j.Vc(m)&&h.j.Vc(C)?(M=Math.sqrt(1-G*G),b.l=Math.acos(M),0>l&&(b.l*=-1)):h.j.S(h.j.H(m),1.570796326794897)?b.l=0>m?u:h.u.W(3.141592653589793-u):(a=G/d,W=Math.sqrt(1-
a*a),0>d*k-z*v*Math.cos(t)&&(W*=-1),b.l=Math.atan2(a,W),h.j.S(m,-C)&&h.j.H(h.u.W(g-u))>3.141592653589793*(1-Y*Math.cos(m))&&(0<m&&1.570796326794897>h.j.H(b.l)||0>m&&1.570796326794897<h.j.H(b.l))&&(b.l=h.j.nb(3.141592653589793,b.l)-b.l)));if(null!=c)if(h.j.Vc(m)&&h.j.Vc(C))M=Math.sqrt(1-G*G),c.l=Math.acos(M),0<=l&&(c.l*=-1);else if(h.j.S(h.j.H(C),1.570796326794897))c.l=0>C?g:h.u.W(3.141592653589793-g);else if(l=G/v,a=Math.sqrt(1-l*l),W=Math.sin(t/2),0>Math.sin(n-e)-2*d*k*W*W&&(a*=-1),c.l=Math.atan2(l,
a),c.l=h.u.W(c.l+3.141592653589793),h.j.S(m,-C)&&!h.j.Vc(m)&&!h.j.S(h.j.H(m),1.570796326794897)&&h.j.H(h.u.W(g-u))>3.141592653589793*(1-Y*Math.cos(m))&&(null!=b?W=b.l:(a=G/d,W=Math.sqrt(1-a*a),0>d*k-z*v*Math.cos(t)&&(W*=-1),W=Math.atan2(a,W),h.j.S(m,-C)&&h.j.H(h.u.W(g-u))>3.141592653589793*(1-Y*Math.cos(m))&&(0<m&&1.570796326794897>h.j.H(W)||0>m&&1.570796326794897<h.j.H(W))&&(W=h.j.nb(3.141592653589793,W)-W)),1.570796326794897>=h.j.H(W)&&1.570796326794897<h.j.H(c.l)||1.570796326794897<=h.j.H(W)&&
1.570796326794897>h.j.H(c.l)))c.l=-1*h.u.W(c.l+3.141592653589793)}}}};a.gf=function(e,d,g,m,u,C,a,b){if(null!=a||null!=b)if(h.j.Ih(d))h.zg.gf(e,g,m,u,C,a,b);else if(C=h.u.W(C),h.j.S(h.j.H(m),1.570796326794897)||h.j.Vc(C)||h.j.S(h.j.H(C),3.141592653589793))h.Xj.gf(e,d,g,m,u,C,a,b);else{var M=1.570796326794897==h.j.H(C)?0:Math.cos(C),c=3.141592653589793==h.j.H(C)?0:Math.sin(C);h.j.S(h.j.H(m),1.570796326794897)&&(g=0);C=1-Math.sqrt(1-d);var p=h.u.Dp(d,m);m=1.570796326794897==h.j.H(p)?0:Math.cos(p);var f=
Math.sin(p),p=Math.atan2(Math.tan(p),M),l=m*c,Y=l*l,q=1-Y,n=d/(1-d)*q;d=n*(256+n*(-128+n*(74-47*n)))/1024;var z=d/4,v=d/6,t=u/(e*(1-C)*(1+n*(4096+n*(-768+n*(320-175*n)))/16384)),k=t,A;do{A=k;u=1.570796326794897==h.j.H(k)?0:Math.cos(k);var n=3.141592653589793==h.j.H(k)?0:Math.sin(k),y=n*n;e=Math.cos(2*p+k);k=e*e;k=d*n*(e+z*(u*(2*k-1)-v*e*(4*y-3)*(4*k-3)))+t}while(!h.j.S(A,k));u=1.570796326794897==h.j.H(k)?0:Math.cos(k);n=3.141592653589793==h.j.H(k)?0:Math.sin(k);null!=a&&(c=Math.atan2(n*c,m*u-f*n*
M),q=C/16*q*(4+C*(4-3*q)),e=Math.cos(2*p+k),a.l=h.u.W(g+(c-(1-q)*C*l*(k+q*n*(e+q*u*(2*e*e-1))))));null!=b&&(q=f*n-m*u*M,q=(1-C)*Math.sqrt(Y+q*q),b.l=Math.atan2(f*u+m*n*M,q))}};return a}();h.cs=a})(A||(A={}));(function(a){var h=function(){function h(){}h.Fb=function(e,d,g,m,u,C,h,b,c){var M=a.u.W(u-g),p=a.j.S(a.j.H(m),1.570796326794897),f=a.j.S(a.j.H(C),1.570796326794897);if(a.j.S(m,C)&&(a.j.Vc(M)||p))null!=h&&(h.l=0),null!=b&&(b.l=0),null!=c&&(c.l=0);else{var l,Y;a.j.Ih(d)?(l=Math.sin(m),Y=Math.sin(C),
l=Math.sqrt((1+l)/(1-l)),Y=Math.sqrt((1+Y)/(1-Y)),l=Math.log(Y)-Math.log(l),l=Math.atan2(M,l),null!=h&&(h.l=a.j.S(m,C)?a.j.H(e*Math.cos(m)*M):a.j.H((e*C-e*m)/Math.cos(l)))):(Y=a.u.qu(d,C),l=Math.sin(a.u.qu(d,m)),Y=Math.sin(Y),l=Math.sqrt((1+l)/(1-l)),Y=Math.sqrt((1+Y)/(1-Y)),l=Math.log(Y)-Math.log(l),l=Math.atan2(M,l),null!=h&&(a.j.S(m,C)?h.l=a.j.H(e*M*Math.cos(m)/a.u.Tk(d,m)):(M=a.u.q(e,d,m),e=a.u.q(e,d,C),h.l=a.j.H((e-M)/Math.cos(l)))));if(null!=b||null!=c)h=a.u.W(l+3.141592653589793),p&&f||!p&&
!f||(p?l=0>m?u:a.u.W(3.141592653589793-u):f&&(h=0>C?g:a.u.W(3.141592653589793-g))),null!=b&&(b.l=l),null!=c&&(c.l=h)}};h.gf=function(e,d,g,m,u,C,h,b){C=a.u.W(C);0>u&&(u=a.j.H(u),C=a.u.W(C+3.141592653589793));a.j.Ih(d)?a.j.S(a.j.H(m),1.570796326794897)?(g=0>m?C:a.u.W(3.141592653589793-C),C=u/e%6.283185307179586,3.141592653589793>=C?e=m-a.j.nb(C,m):(g=a.u.W(g+3.141592653589793),e=-m+a.j.nb(C-3.141592653589793,m))):a.j.S(a.j.H(C),1.570796326794897)?(g=a.u.W(g+a.j.nb(u,C)/(e*Math.cos(m))),e=m):(e=m+u*
Math.cos(C)/e,1.570796326794897<a.j.H(e)&&(e=1.570796326794897),a.j.S(a.j.H(e),1.570796326794897)&&(a.j.Vc(C)||a.j.S(a.j.H(C),3.141592653589793))||(1.570796316258184<a.j.H(e)&&(e=a.j.nb(1.570796316258184,e)),d=Math.sin(m),m=Math.sin(e),d=Math.sqrt((1+d)/(1-d)),m=Math.sqrt((1+m)/(1-m)),d=Math.log(m)-Math.log(d),g=a.u.W(g+Math.tan(C)*d))):a.j.S(a.j.H(m),1.570796326794897)?(g=0>m?C:a.u.W(3.141592653589793-C),C=u/a.u.nR(e,d),C%=6.283185307179586,3.141592653589793>=C?(e=m-a.j.nb(C,m),e=a.u.xn(d,e)):(g=
a.u.W(g+3.141592653589793),e=-m+a.j.nb(C-3.141592653589793,m),e=a.u.xn(d,e))):a.j.S(a.j.H(C),1.570796326794897)?(g=a.u.W(g+a.j.nb(u,C)*a.u.Tk(d,m)/(e*Math.cos(m))),e=m):(e=1.570796326794897*(u*Math.cos(C)+a.u.q(e,d,m))/a.u.gg(e,d),1.570796326794897<a.j.H(e)&&(e=a.j.nb(1.570796326794897,e)),e=a.u.xn(d,e),a.j.S(a.j.H(e),1.570796326794897)&&(a.j.Vc(C)||a.j.S(a.j.H(C),3.141592653589793))||(u=a.u.qu(d,m),m=a.u.qu(d,e),1.570796316258184<a.j.H(m)&&(m=a.j.nb(1.570796316258184,e),e=a.u.$K(d,m)),d=Math.sin(u),
m=Math.sin(m),d=Math.sqrt((1+d)/(1-d)),m=Math.sqrt((1+m)/(1-m)),d=Math.log(m)-Math.log(d),g=a.u.W(g+Math.tan(C)*d)));null!=h&&(h.l=g);null!=b&&(b.l=e)};return h}();a.Zz=h})(A||(A={}));(function(a){var h=function(){function h(){}h.gw=function(e,d,g,m,u,C,h){a.cs.Fb(e,d,g,m,u,C,null,h,null)};h.Ph=function(e,d,g,m,u,C,h,b){a.cs.gf(e,d,g,m,u,C,h,b)};h.Rd=function(e,d,g,m,u,C,h,b,c,p){switch(p){case 2:a.Xj.Fb(e,d,g,m,u,C,h,b,c);break;case 3:a.$z.Fb(e,d,g,m,u,C,h,b,c);break;case 1:a.Zz.Fb(e,d,g,m,u,C,h,
b,c);break;default:a.cs.Fb(e,d,g,m,u,C,h,b,c)}};h.dk=function(e,d,g,m,u,C,h,b,c){switch(c){case 2:a.Xj.gf(e,d,g,m,u,C,h,b);break;case 3:a.$z.gf(e,d,g,m,u,C,h,b);break;case 1:a.Zz.gf(e,d,g,m,u,C,h,b);break;default:a.cs.gf(e,d,g,m,u,C,h,b)}};return h}();a.zb=h})(A||(A={}));(function(a){var h=function(){function h(){}h.QS=function(e,d){var g=8;0>g&&(g=8);var m=[0,0,0,0],u=new a.b;u.J(d);u.scale(9102==a.Ya.Em(e).Se().Qc()?1:a.Ya.Em(e).Se().Dj/3.141592653589793*180);-180>u.x?(u.x-=u.x%360,-180>u.x&&(u.x+=
360)):180<u.x&&(u.x-=u.x%360,180<u.x&&(u.x-=360));90<u.y&&(u.y=90);-90>u.y&&(u.y=-90);e=5*g;d=(e+31)/32;for(var C=-180,b=180,c=e-1,p=d-1;0<=p;p--)for(var f=c-32*p,l=Math.min(32,e-32*p),q=1;q<l;q+=2){var n=.5*(b+C);u.x>=n?(m[p]|=1<<f,C=n):b=n;f-=2;c-=2}C=-90;b=90;c=e-2;for(p=d-1;0<=p;p--)for(f=c-32*p,l=Math.min(32,e-32*p),q=0;q<l;q+=2)n=.5*(b+C),u.y>=n?(m[p]|=1<<f,C=n):b=n,f-=2,c-=2;return h.XS(m,g,g)};h.XS=function(e,d,g){for(var m=[],u=0;u<d;u++)m[u]="";for(var a=u=0,h=0;h<d;h++){var b=e[u]>>a&31,
a=a+5;if(31<a){var c=37-a,b=b&(1<<c)-1,a=a-32;u++;b|=(e[u]&(1<<a)-1)<<c}m[d-1-h]="0123456789bcdefghjkmnpqrstuvwxyz".split("")[b]}if(g>d)for(h=0;h<g-d;h++)m.push("0");else g<d&&(m.length=g);return m.join("")};return h}();a.qH=h})(A||(A={}));(function(a){var h={gcstol:[0,1E-8,1,1.11111E-8,2,1.68845E-8,3,2.17661E-8,4,2.22508E-8,5,2.34848E-8,6,2.37811E-8,7,2.88455E-8,8,3.1456E-8,9,3.29779E-8,10,3.66789E-8,11,4.23597E-8,12,4.79463E-8,13,6.45223E-8,14,7.26274E-8,15,7.49945E-8,16,7.52506E-8,17,7.97991E-8,
18,9.66202E-8,19,9.79918E-8,20,9.89735E-8,21,1.02314E-7,22,1.08146E-7,23,2.29734E-7,24,2.42985E-7,25,2.7546E-7,26,3.37034E-7,27,4.30795E-7,28,5.20871E-7,29,5.50921E-7,30,6.74068E-7,31,6.86177E-7,32,7.25263E-7,33,7.44101E-7,34,7.74267E-7,35,9.62954E-7,36,1.06103E-6,37,1.14363E-6,38,1.16219E-6,39,1.36419E-6,40,1.36744E-6,41,1.43239E-6,42,1.73624E-6,43,1.84825E-6,44,1.90986E-6,45,1.97572E-6,46,2.12207E-6,47,2.72837E-6,48,3.1831E-6,49,3.58099E-6,50,3.81972E-6,51,4.09256E-6,52,4.40737E-6,53,4.77465E-6,
54,5.16178E-6,55,5.20871E-6,56,5.72958E-6,57,6.03113E-6,58,6.98729E-6,59,9.24125E-6,60,1.14592E-5],pcstol:[0,6.66667E-9,1,2E-8,2,4.97098E-5,3,.001,4,.00109362,5,.00328087,6,.00497101],newtoold:[2154,102110,2195,102200,2204,32036,2205,26979,2225,102641,2226,102642,2227,102643,2228,102644,2229,102645,2230,102646,2231,102653,2232,102654,2233,102655,2234,102656,2235,102657,2236,102658,2237,102659,2238,102660,2239,102666,2240,102667,2241,102668,2242,102669,2243,102670,2246,102679,2247,102680,2248,102685,
2249,102686,2250,102687,2254,102694,2255,102695,2257,102712,2258,102713,2259,102714,2260,102715,2261,102716,2262,102717,2263,102718,2264,102719,2267,102724,2268,102725,2271,102728,2272,102729,2274,102736,2275,102737,2276,102738,2277,102739,2278,102740,2279,102741,2283,102746,2284,102747,2285,102748,2286,102749,2287,102752,2288,102753,2289,102754,2312,23433,2326,102140,2395,2091,2396,2092,2397,2166,2398,2167,2399,2168,2759,102229,2760,102230,2761,102248,2762,102249,2763,102250,2764,102251,2765,102252,
2766,102241,2767,102242,2768,102243,2769,102244,2770,102245,2771,102246,2772,102253,2773,102254,2774,102255,2775,102256,2776,102257,2777,102258,2778,102259,2779,102260,2780,102266,2781,102267,2782,102261,2783,102262,2784,102263,2785,102264,2786,102265,2787,102268,2788,102269,2789,102270,2790,102271,2791,102272,2792,102273,2793,102274,2794,102275,2795,102276,2796,102277,2797,102278,2798,102279,2799,102280,2800,102281,2801,102282,2802,102283,2803,102284,2804,102285,2805,102286,2806,102287,2807,102288,
2808,102289,2809,102290,2810,102291,2811,102292,2812,102293,2813,102294,2814,102295,2815,102296,2816,102297,2817,102298,2818,102300,2819,102304,2820,102307,2821,102308,2822,102309,2823,102310,2824,102311,2825,102312,2826,102313,2827,102314,2828,102315,2829,102316,2830,102317,2831,102318,2832,102320,2833,102321,2834,102322,2835,102323,2836,102324,2837,102325,2838,102326,2839,102327,2840,102330,2841,102334,2842,102335,2843,102336,2844,102337,2845,102338,2846,102339,2847,102340,2848,102341,2849,102342,
2850,102343,2851,102344,2852,102345,2853,102346,2854,102347,2855,102348,2856,102349,2857,102350,2858,102351,2859,102352,2860,102353,2861,102354,2862,102355,2863,102356,2864,102357,2865,102358,2866,102361,2942,102167,2943,102169,2944,2139,2945,2140,2946,2141,2947,2142,2948,2143,2949,2144,2950,2145,2951,2146,2952,2147,2953,2036,2954,2291,2955,2153,2956,2152,2957,2151,2958,2150,2959,2149,2960,2037,2961,2038,2962,2148,2965,2244,2966,2245,3003,102091,3004,102092,3005,102190,3060,2982,3067,102139,3072,
102606,3074,102608,3075,102208,3077,102210,3078,102123,3080,102119,3081,102603,3082,102602,3083,102601,3088,65163,3089,102763,3090,102363,3092,102151,3093,102152,3094,102153,3095,102154,3096,102155,3097,102145,3098,102146,3099,102147,3100,102148,3101,102149,3102,2155,3107,102172,3110,102170,3111,102171,3119,2214,3158,102234,3159,102235,3160,102236,3336,2979,3338,102006,3346,2600,3370,102126,3371,102127,3372,102130,3373,102131,3400,102184,3401,102185,3404,3359,3407,3366,3417,102675,3418,102676,3419,
102677,3420,102678,3421,102707,3422,102708,3423,102709,3424,102711,3433,102651,3434,102652,3435,102671,3436,102672,3437,102710,3438,102730,3448,102095,3451,102681,3452,102682,3455,102735,3461,2063,3462,2064,3463,3073,3464,3076,3560,102742,3566,102743,3567,102744,3734,102722,3735,102723,3736,102755,3737,102756,3738,102757,3739,102758,3741,102205,3742,102206,3743,102207,3748,102211,3750,102202,3751,102203,3759,102663,3760,102463,3764,102112,3770,102090,3771,102180,3772,102181,3773,102182,3775,102186,
3776,102187,3777,102188,3800,102183,3801,102189,3812,102199,3814,102609,3815,102469,3819,104990,3821,104136,3824,104137,3825,102444,3826,102443,3827,102442,3828,102441,3857,102100,3889,104991,3906,104992,4048,103201,4049,103202,4050,103203,4051,103204,4056,103205,4057,103206,4058,103207,4059,103208,4060,103209,4061,103210,4062,103211,4063,103212,4071,103213,4082,103214,4083,103215,4093,103216,4094,103217,4095,103218,4096,103219,4167,104108,4169,37252,4171,104107,4189,104110,4197,4234,4223,37223,4304,
104304,4414,102201,4415,102762,4417,102764,4434,102765,4437,102647,4455,32029,4456,32018,4457,3454,4462,102439,4463,4466,4470,4469,4484,103794,4485,103795,4486,103796,4487,103797,4488,103798,4489,103799,4611,104104,4612,104111,4613,37255,4615,37247,4616,37250,4617,4140,4618,4291,4620,37211,4626,37235,4647,102362,4658,37204,4668,37201,4669,4126,4672,37217,4673,104125,4675,37220,4684,37232,4698,4631,4707,37213,4708,37231,4709,37212,4710,37238,4711,37214,4712,37237,4713,37208,4714,37215,4715,37253,4716,
37216,4717,37239,4719,37219,4722,37242,4724,37233,4725,37222,4727,37224,4728,37246,4729,37226,4730,37227,4731,37228,4732,37229,4733,37230,4734,37251,4735,37259,4736,37254,4739,37205,4758,104133,4760,37001,4762,104114,4826,102214,5013,104142,5014,102331,5015,102332,5016,102333,5173,102085,5174,102086,5175,102087,5176,102088,5177,102089,5178,102040,5179,102080,5185,102081,5186,102082,5187,102083,5188,102084,5221,102066,5246,104100,5247,102490,5324,104144,5325,102420,5329,2934,5365,104143,5367,102305,
5451,104132,5513,102065,5514,102067,5519,102111,5520,31461,5646,102745,5839,5388,5858,5532,5879,4474,21896,21891,21897,21892,21898,21893,21899,21894,26701,102124,26702,102125,26799,26747,26847,102683,26848,102684,26849,102691,26850,102692,26851,102693,26852,102704,26853,102750,26854,102751,26857,102466,26858,102467,26859,102468,26901,102128,26902,102129,27493,27492,29101,29100,29168,29118,29169,29119,29170,29120,29171,29121,29172,29122,29187,29177,29188,29178,29189,29179,29190,29180,29191,29181,29192,
29182,29193,29183,29194,29184,29195,29185,29902,29900,31279,31278,31281,31291,31282,31292,31283,31293,31284,31294,31285,31295,31286,31296,31287,31297,31466,31462,31467,31463,31468,31464,31469,31465,31986,31917,31987,31918,31988,31919,31989,31920,31990,31921,31991,31922,32064,32074,32065,32075,32066,32076,32067,32077],pcsid:[2066,6,2136,5,2155,5,2157,3,2158,3,2159,5,2160,5,2219,3,2220,3,2244,5,2245,5,2256,5,2265,5,2266,5,2269,5,2270,5,2273,5,2290,3,2291,3,2294,3,2295,3,2313,3,2314,5,2964,5,2967,5,
2968,5,2991,3,2992,5,2993,3,2994,5,3073,3,3076,3,3079,3,3091,5,3106,3,3108,3,3109,3,3141,3,3142,3,3167,2,3337,3,3347,3,3348,3,3359,5,3360,3,3361,5,3362,3,3363,5,3364,3,3365,5,3366,5,3402,3,3403,3,3405,3,3406,3,3439,3,3440,3,3447,3,3449,3,3450,3,3453,5,3454,5,3460,3,3479,5,3480,3,3481,5,3482,3,3483,5,3484,3,3485,5,3486,3,3487,5,3488,3,3489,3,3490,5,3491,3,3492,5,3493,3,3494,5,3495,3,3496,5,3497,3,3498,5,3499,3,3500,5,3501,3,3502,5,3503,3,3504,5,3505,3,3506,5,3507,3,3508,5,3509,3,3510,5,3511,3,3512,
5,3513,3,3514,3,3515,5,3516,3,3517,5,3518,3,3519,5,3520,3,3521,5,3522,3,3523,5,3524,3,3525,5,3526,3,3527,5,3528,3,3529,5,3530,3,3531,5,3532,3,3533,5,3534,3,3535,5,3536,3,3537,5,3538,3,3539,5,3540,3,3541,5,3542,3,3543,5,3544,3,3545,5,3546,3,3547,5,3548,3,3549,5,3550,3,3551,5,3552,3,3553,5,3582,5,3583,3,3584,5,3585,3,3586,5,3587,3,3588,5,3589,3,3590,5,3591,3,3592,3,3593,5,3598,5,3599,3,3600,5,3605,5,3606,3,3607,3,3608,5,3609,3,3610,5,3611,3,3612,5,3613,3,3614,5,3615,3,3616,5,3617,3,3618,5,3619,3,3620,
5,3621,3,3622,5,3623,3,3624,5,3625,3,3626,5,3627,3,3628,5,3629,3,3630,5,3631,3,3632,5,3633,3,3634,5,3635,3,3636,5,3640,5,3641,3,3642,5,3643,3,3644,5,3645,3,3646,5,3647,3,3648,5,3649,3,3650,5,3651,3,3652,5,3653,3,3654,5,3655,3,3656,5,3657,3,3658,5,3659,3,3660,5,3661,3,3662,5,3663,3,3664,5,3668,5,3669,3,3670,5,3671,3,3672,5,3673,3,3674,5,3675,3,3676,5,3677,5,3678,3,3679,5,3680,5,3681,3,3682,5,3683,5,3684,3,3685,3,3686,5,3687,3,3688,5,3689,3,3690,5,3691,3,3692,5,3696,5,3697,3,3698,5,3699,3,3700,5,3740,
3,3749,3,3783,3,3784,3,3793,3,3794,3,3802,3,3816,3,3829,3,3854,3,3920,3,3978,3,3979,3,3991,5,3992,5,4026,3,4037,3,4038,3,4217,5,4438,5,4439,5,4467,3,4471,3,4474,3,4559,3,4839,3,5018,3,5048,3,5167,3,5168,3,5223,3,5234,3,5235,3,5243,3,5266,3,5316,3,5320,3,5321,3,5330,3,5331,3,5337,3,5361,3,5362,3,5382,3,5383,3,5396,3,5456,3,5457,3,5469,3,5472,4,5490,3,5518,3,5523,3,5559,3,5588,5,5589,5,5596,3,5627,3,5629,3,5641,3,5643,3,5644,3,5654,5,5655,5,5659,3,5700,3,5825,3,5836,3,5837,3,5842,3,5844,3,5880,3,5887,
3,5890,3,20499,3,20538,3,20539,3,20790,3,20791,3,21291,3,21292,3,21500,3,21817,3,21818,3,22032,3,22033,3,22091,3,22092,3,22332,3,22391,3,22392,3,22700,3,22770,3,22780,3,22832,3,23090,3,23095,3,23239,3,23240,3,23433,3,23700,3,24047,3,24048,3,24100,5,24200,3,24305,3,24306,3,24382,4,24383,3,24500,3,24547,3,24548,3,24571,2,24600,3,25E3,3,25231,3,25884,3,25932,3,26237,3,26331,3,26332,3,26591,3,26592,3,26632,3,26692,3,26855,5,26856,5,27120,3,27200,3,27291,4,27292,4,27429,3,27492,3,27500,3,27700,3,28232,
3,28600,3,28991,3,28992,3,29100,3,29220,3,29221,3,29333,3,29635,3,29636,3,29701,3,29738,3,29739,3,29849,3,29850,3,29871,2,29872,5,29873,3,29900,3,29901,3,29903,3,30200,6,30339,3,30340,3,30591,3,30592,3,30791,3,30792,3,31028,3,31121,3,31154,3,31170,3,31171,3,31370,3,31528,3,31529,3,31600,3,31700,3,31838,3,31839,3,31901,3,32061,3,32062,3,32098,3,32099,5,32100,3,32104,3,32161,3,32766,3,53034,3,53048,3,53049,3,54034,3,65061,5,65062,5,65161,3,65163,3,102041,5,102064,4,102068,1,102069,0,102217,5,102218,
3,102219,5,102220,5,102378,5,102379,5,102380,3,102381,5,102589,5,102599,5,102600,5,102604,5,102605,3,102606,3,102647,3,102704,5,102705,5,102733,5,102761,5,102762,3,102763,5,102764,3,102765,3,102766,5,102970,5,102974,5,102993,3,102994,3,102995,5,102996,5,103015,3,103016,5,103017,3,103018,5,103025,3,103026,3,103027,5,103028,5,103035,3,103036,3,103037,5,103038,5,103039,3,103040,3,103041,5,103042,5,103043,3,103044,3,103045,5,103046,5,103047,3,103048,3,103049,5,103050,5,103051,3,103052,5,103053,3,103054,
5,103055,3,103056,5,103057,3,103058,3,103059,5,103060,5,103061,3,103062,3,103063,5,103064,5,103069,5,103070,3,103071,3,103072,5,103073,5,103086,3,103087,3,103088,5,103089,5,103094,5,103095,3,103096,5,103103,3,103104,5,103105,3,103106,5,103121,3,103122,5,103123,3,103124,3,103125,5,103126,5,103127,3,103128,3,103129,5,103130,5,103131,3,103132,3,103133,5,103134,5,103135,3,103136,3,103137,5,103138,5,103139,3,103140,5,103141,3,103142,5,103143,3,103144,5,103145,3,103146,5,103147,3,103148,3,103149,5,103150,
5,103151,3,103152,5,103172,3,103173,5,103174,3,103175,3,103176,5,103177,5,103178,3,103179,3,103180,5,103181,5,103182,3,103183,3,103184,5,103185,5,103228,3,103229,3,103230,5,103231,5,103250,3,103251,5,103252,3,103253,5,103260,3,103261,3,103262,5,103263,5,103270,3,103271,3,103272,5,103273,5,103274,3,103275,3,103276,5,103277,5,103278,3,103279,3,103280,5,103281,5,103282,3,103283,3,103284,5,103285,5,103286,3,103287,5,103288,3,103289,5,103290,3,103291,5,103292,3,103293,3,103294,5,103295,5,103296,3,103297,
3,103298,5,103299,5,103376,5,103377,3,103378,3,103379,5,103380,5,103393,3,103394,3,103395,5,103396,5,103472,3,103473,5,103474,3,103475,5,103482,3,103483,5,103484,3,103485,5,103500,3,103501,5,103502,3,103503,3,103504,5,103505,5,103506,3,103507,3,103508,5,103509,5,103510,3,103511,3,103512,5,103513,5,103514,3,103515,5,103516,3,103517,5,103518,3,103519,5,103520,3,103521,5,103522,3,103523,3,103524,5,103525,5,103526,3,103527,5,103561,5,103562,5,103563,3,103564,3,103565,5,103566,5,103567,3,103568,3,103569,
5,103570,5,103585,5,103695,5],pcsidc:[[2E3,2045,3],[2056,2065,3],[2067,2135,3],[2137,2153,3],[2161,2170,3],[2172,2193,3],[2196,2198,3],[2200,2203,3],[2206,2217,3],[2222,2224,5],[2251,2253,5],[2280,2282,5],[2308,2311,3],[2315,2325,3],[2327,2394,3],[2400,2462,3],[2523,2576,3],[2578,2693,3],[2695,2758,3],[2867,2888,5],[2891,2930,5],[2931,2941,3],[2969,2973,3],[2975,2982,3],[2984,2988,3],[2995,3002,3],[3006,3051,3],[3054,3059,3],[3061,3066,3],[3068,3071,3],[3084,3087,3],[3112,3118,3],[3120,3138,3],[3146,
3151,3],[3153,3157,3],[3161,3166,3],[3168,3172,3],[3174,3203,3],[3294,3313,3],[3315,3335,3],[3339,3345,3],[3350,3358,3],[3367,3369,3],[3374,3399,3],[3408,3416,3],[3425,3432,5],[3441,3446,5],[3456,3459,5],[3465,3478,3],[3554,3559,3],[3561,3565,5],[3568,3570,5],[3571,3581,3],[3594,3597,3],[3601,3604,3],[3637,3639,3],[3665,3667,3],[3693,3695,3],[3701,3727,3],[3728,3733,5],[3744,3747,3],[3753,3758,5],[3761,3763,3],[3765,3769,3],[3779,3781,3],[3788,3791,3],[3797,3799,3],[3832,3841,3],[3844,3852,3],[3873,
3885,3],[3890,3893,3],[3907,3912,3],[3942,3950,3],[3968,3970,3],[3973,3976,3],[3986,3989,3],[3994,3997,3],[4399,4413,5],[4418,4433,5],[4491,4554,3],[5069,5072,3],[5105,5130,3],[5180,5184,3],[5253,5259,3],[5269,5275,3],[5292,5311,3],[5343,5349,3],[5355,5357,3],[5387,5389,3],[5459,5463,3],[5479,5482,3],[5530,5539,3],[5550,5552,3],[5562,5583,3],[5623,5625,5],[5631,5639,3],[5649,5653,3],[5663,5680,3],[5682,5685,3],[5875,5877,3],[20002,20032,3],[20062,20092,3],[20135,20138,3],[20248,20258,3],[20348,20358,
3],[20436,20440,3],[20822,20824,3],[20934,20936,3],[21035,21037,3],[21095,21097,3],[21148,21150,3],[21413,21423,3],[21473,21483,3],[21780,21782,3],[21891,21894,3],[22171,22177,3],[22181,22187,3],[22191,22197,3],[22234,22236,3],[22521,22525,3],[22991,22994,3],[23028,23038,3],[23830,23853,3],[23866,23872,3],[23877,23884,3],[23886,23894,3],[23946,23948,3],[24311,24313,3],[24342,24347,3],[24370,24374,4],[24375,24381,3],[24718,24721,3],[24817,24821,3],[24877,24882,3],[24891,24893,3],[25391,25395,3],[25828,
25838,3],[26191,26195,3],[26391,26393,3],[26703,26722,3],[26729,26760,5],[26766,26798,5],[26860,26870,5],[26891,26899,3],[26903,26923,3],[26929,26946,3],[26948,26998,3],[27037,27040,3],[27205,27232,3],[27258,27260,3],[27391,27398,3],[27561,27564,3],[27571,27574,3],[27581,27584,3],[27591,27594,3],[28191,28193,3],[28348,28358,3],[28402,28432,3],[28462,28492,3],[29118,29122,3],[29177,29185,3],[30161,30179,3],[30491,30494,3],[30729,30732,3],[31251,31259,3],[31265,31268,3],[31275,31278,3],[31288,31297,
3],[31461,31465,3],[31491,31495,3],[31917,31922,3],[31965,31985,3],[31992,32E3,3],[32001,32003,5],[32005,32031,5],[32033,32060,5],[32074,32077,5],[32081,32086,3],[32107,32130,3],[32133,32158,3],[32164,32167,5],[32180,32199,3],[32201,32260,3],[32301,32360,3],[32601,32662,3],[32664,32667,5],[32701,32761,3],[53001,53004,3],[53008,53019,3],[53021,53032,3],[53042,53046,3],[54001,54004,3],[54008,54019,3],[54021,54032,3],[54042,54046,3],[54048,54053,3],[102001,102040,3],[102042,102063,3],[102065,102067,
3],[102070,102112,3],[102114,102117,3],[102118,102121,5],[102122,102208,3],[102210,102216,3],[102221,102300,3],[102304,102377,3],[102382,102388,3],[102389,102391,5],[102401,102444,3],[102450,102452,3],[102461,102468,5],[102469,102492,3],[102500,102519,5],[102530,102549,3],[102570,102588,3],[102590,102598,3],[102601,102603,3],[102608,102628,3],[102629,102646,5],[102648,102672,5],[102675,102700,5],[102701,102703,3],[102707,102730,5],[102735,102758,5],[102767,102798,3],[102962,102969,3],[102971,102973,
3],[102975,102989,3],[102990,102992,5],[102997,103002,3],[103003,103008,5],[103009,103011,3],[103012,103014,5],[103019,103021,3],[103022,103024,5],[103029,103031,3],[103032,103034,5],[103065,103068,3],[103074,103076,3],[103077,103079,5],[103080,103082,3],[103083,103085,5],[103090,103093,3],[103097,103099,3],[103100,103102,5],[103107,103109,3],[103110,103112,5],[103113,103116,3],[103117,103120,5],[103153,103157,3],[103158,103162,5],[103163,103165,3],[103166,103171,5],[103186,103188,3],[103189,103191,
5],[103192,103195,3],[103196,103199,5],[103200,103224,3],[103225,103227,5],[103232,103237,3],[103238,103243,5],[103244,103246,3],[103247,103249,5],[103254,103256,3],[103257,103259,5],[103264,103266,3],[103267,103269,5],[103300,103375,3],[103381,103383,3],[103384,103386,5],[103387,103389,3],[103390,103392,5],[103397,103399,3],[103400,103471,5],[103476,103478,3],[103479,103481,5],[103486,103488,3],[103489,103491,5],[103492,103495,3],[103496,103499,5],[103539,103543,3],[103544,103548,5],[103549,103551,
3],[103552,103557,5],[103558,103560,3],[103571,103573,3],[103574,103576,5],[103577,103580,3],[103581,103583,5],[103600,103694,3],[103700,103793,5],[103794,103799,3]],gcsid:[4042,0,4075,0,4081,0,4168,0,4170,0,4188,0,4261,1,4262,0,4263,0,4288,0,4289,0,4305,1,4322,0,4324,0,4326,0,4466,0,4469,0,4475,0,4483,0,4490,0,4555,0,4558,0,4614,0,4619,0,4657,0,4670,0,4671,0,4674,0,4682,0,4683,0,4718,0,4720,0,4721,0,4723,0,4726,0,4737,0,4738,0,4759,0,4761,0,4807,1,4808,0,4809,0,4816,1,4817,0,4818,0,4819,1,4820,0,
4821,1,4823,0,4824,0,4901,1,4902,1,4903,0,4904,0,5228,0,5229,0,5233,0,5252,0,5264,0,5340,0,5354,0,5360,0,5371,0,5373,0,5381,0,5393,0,5464,0,5467,0,5489,0,5524,0,5527,0,5546,0,5561,0,5593,0,5681,0,5886,0,37225,1,37235,0,37257,0,37259,0,37260,0,104020,0,104139,1,104140,1,104223,0,104286,0,104287,0,104304,0,104305,0,104896,0,104900,5,104901,0,104902,0,104903,9,104904,2,104905,2,104906,59,104907,54,104908,0,104909,58,104910,31,104911,56,104912,6,104913,50,104914,41,104915,10,104916,3,104917,30,104918,
8,104919,60,104920,53,104921,44,104922,48,104923,51,104924,38,104925,0,104926,49,104927,57,104928,21,104929,23,104930,35,104931,49,104932,27,104933,17,104934,13,104935,7,104936,56,104937,40,104938,28,104939,37,104940,15,104941,55,104942,22,104943,4,104944,0,104945,20,104946,42,104947,47,104948,52,104949,43,104950,46,104951,39,104952,24,104953,16,104954,50,104955,36,104956,33,104957,46,104958,14,104959,19,104960,0,104961,34,104962,32,104963,29,104964,45,104965,26,104966,25,104967,41,104968,11,104969,
12,104970,18],gcsidc:[[4001,4016,0],[4018,4025,0],[4027,4029,0],[4031,4036,0],[4044,4047,0],[4052,4054,0],[4120,4166,0],[4172,4176,0],[4178,4185,0],[4190,4196,0],[4198,4216,0],[4218,4222,0],[4224,4232,0],[4234,4260,0],[4265,4267,0],[4269,4286,0],[4291,4303,0],[4306,4319,0],[4600,4610,0],[4621,4625,0],[4627,4633,0],[4636,4639,0],[4641,4646,0],[4659,4667,0],[4676,4680,0],[4686,4697,0],[4699,4706,0],[4740,4757,0],[4763,4765,0],[4801,4806,0],[4810,4812,1],[4813,4815,0],[37001,37008,0],[37201,37208,0],
[37211,37224,0],[37226,37233,0],[37237,37243,0],[37245,37247,0],[37249,37255,0],[104100,104138,0],[104141,104145,0],[104256,104261,0],[104700,104786,0],[104990,104992,0]]},b={c:[[2E3,2045,9001],[2056,2065,9001],[2067,2135,9001],[2137,2153,9001],[2161,2170,9001],[2172,2193,9001],[2196,2198,9001],[2200,2203,9001],[2206,2217,9001],[2222,2224,9002],[2251,2253,9002],[2280,2282,9002],[2308,2311,9001],[2315,2325,9001],[2327,2394,9001],[2400,2462,9001],[2523,2576,9001],[2578,2693,9001],[2695,2758,9001],[2867,
2869,9002],[2870,2888,9003],[2891,2895,9003],[2896,2898,9002],[2902,2908,9003],[2915,2920,9003],[2921,2923,9002],[2924,2930,9003],[2931,2941,9001],[2969,2973,9001],[2975,2982,9001],[2984,2988,9001],[2995,3002,9001],[3006,3051,9001],[3054,3059,9001],[3061,3066,9001],[3068,3071,9001],[3084,3087,9001],[3112,3118,9001],[3120,3138,9001],[3146,3151,9001],[3153,3157,9001],[3161,3166,9001],[3168,3172,9001],[3174,3203,9001],[3294,3313,9001],[3315,3335,9001],[3339,3345,9001],[3350,3358,9001],[3367,3369,9001],
[3374,3399,9001],[3408,3416,9001],[3425,3432,9003],[3441,3446,9003],[3456,3459,9003],[3465,3478,9001],[3554,3559,9001],[3561,3565,9003],[3568,3570,9003],[3571,3581,9001],[3594,3597,9001],[3601,3604,9001],[3637,3639,9001],[3665,3667,9001],[3693,3695,9001],[3701,3727,9001],[3728,3733,9003],[3744,3747,9001],[3753,3758,9003],[3761,3763,9001],[3765,3769,9001],[3779,3781,9001],[3788,3791,9001],[3797,3799,9001],[3832,3841,9001],[3844,3852,9001],[3873,3885,9001],[3890,3893,9001],[3907,3912,9001],[3942,3950,
9001],[3968,3970,9001],[3973,3976,9001],[3986,3989,9001],[3994,3997,9001],[4001,4016,9102],[4018,4025,9102],[4027,4029,9102],[4031,4036,9102],[4044,4047,9102],[4052,4054,9102],[4120,4166,9102],[4172,4176,9102],[4178,4185,9102],[4190,4196,9102],[4198,4216,9102],[4218,4222,9102],[4224,4232,9102],[4234,4260,9102],[4265,4267,9102],[4269,4286,9102],[4291,4303,9102],[4306,4319,9102],[4399,4413,9003],[4418,4433,9003],[4491,4554,9001],[4600,4610,9102],[4621,4625,9102],[4627,4633,9102],[4636,4639,9102],[4641,
4646,9102],[4659,4667,9102],[4676,4680,9102],[4686,4697,9102],[4699,4706,9102],[4740,4757,9102],[4763,4765,9102],[4801,4806,9102],[4810,4812,9105],[4813,4815,9102],[5069,5072,9001],[5105,5130,9001],[5180,5184,9001],[5253,5259,9001],[5269,5275,9001],[5292,5311,9001],[5343,5349,9001],[5355,5357,9001],[5387,5389,9001],[5459,5463,9001],[5479,5482,9001],[5530,5539,9001],[5550,5552,9001],[5562,5583,9001],[5623,5625,9003],[5631,5639,9001],[5649,5653,9001],[5663,5680,9001],[5682,5685,9001],[5875,5877,9001],
[20002,20032,9001],[20062,20092,9001],[20135,20138,9001],[20248,20258,9001],[20348,20358,9001],[20436,20440,9001],[20822,20824,9001],[20934,20936,9001],[21035,21037,9001],[21095,21097,9001],[21148,21150,9001],[21413,21423,9001],[21473,21483,9001],[21780,21782,9001],[21891,21894,9001],[22171,22177,9001],[22181,22187,9001],[22191,22197,9001],[22234,22236,9001],[22521,22525,9001],[22991,22994,9001],[23028,23038,9001],[23830,23853,9001],[23866,23872,9001],[23877,23884,9001],[23886,23894,9001],[23946,
23948,9001],[24311,24313,9001],[24342,24347,9001],[24370,24374,9084],[24375,24381,9001],[24718,24721,9001],[24817,24821,9001],[24877,24882,9001],[24891,24893,9001],[25391,25395,9001],[25828,25838,9001],[26191,26195,9001],[26391,26393,9001],[26703,26722,9001],[26729,26760,9003],[26766,26798,9003],[26860,26870,9003],[26891,26899,9001],[26903,26923,9001],[26929,26946,9001],[26948,26998,9001],[27037,27040,9001],[27205,27232,9001],[27258,27260,9001],[27391,27398,9001],[27561,27564,9001],[27571,27574,9001],
[27581,27584,9001],[27591,27594,9001],[28191,28193,9001],[28348,28358,9001],[28402,28432,9001],[28462,28492,9001],[29118,29122,9001],[29177,29185,9001],[30161,30179,9001],[30491,30494,9001],[30729,30732,9001],[31251,31259,9001],[31265,31268,9001],[31275,31278,9001],[31288,31297,9001],[31461,31465,9001],[31491,31495,9001],[31917,31922,9001],[31965,31985,9001],[31992,32E3,9001],[32001,32003,9003],[32005,32031,9003],[32033,32060,9003],[32074,32077,9003],[32081,32086,9001],[32107,32130,9001],[32133,32158,
9001],[32164,32167,9003],[32180,32199,9001],[32201,32260,9001],[32301,32360,9001],[32601,32662,9001],[32664,32667,9003],[32701,32761,9001],[37001,37008,9102],[37201,37208,9102],[37211,37224,9102],[37226,37233,9102],[37237,37243,9102],[37245,37247,9102],[37249,37255,9102],[53001,53004,9001],[53008,53019,9001],[53021,53032,9001],[53042,53046,9001],[54001,54004,9001],[54008,54019,9001],[54021,54032,9001],[54042,54046,9001],[54048,54053,9001],[102001,102040,9001],[102042,102063,9001],[102065,102067,9001],
[102070,102112,9001],[102114,102117,9001],[102122,102208,9001],[102210,102216,9001],[102221,102300,9001],[102304,102377,9001],[102382,102388,9001],[102389,102391,9003],[102401,102444,9001],[102450,102452,9001],[102461,102468,9003],[102469,102492,9001],[102500,102519,9002],[102530,102549,9001],[102570,102588,9001],[102590,102598,9001],[102601,102603,9001],[102608,102628,9001],[102629,102646,9003],[102648,102672,9003],[102675,102700,9003],[102701,102703,9001],[102707,102730,9003],[102735,102758,9003],
[102767,102798,9001],[102962,102969,9001],[102971,102973,9001],[102975,102989,9001],[102990,102992,9002],[102997,103002,9001],[103003,103008,9003],[103009,103011,9001],[103012,103014,9003],[103019,103021,9001],[103022,103024,9003],[103029,103031,9001],[103032,103034,9003],[103065,103068,9001],[103074,103076,9001],[103077,103079,9002],[103080,103082,9001],[103083,103085,9003],[103090,103093,9001],[103097,103099,9001],[103100,103102,9003],[103107,103109,9001],[103110,103112,9003],[103113,103116,9001],
[103117,103120,9003],[103153,103157,9001],[103158,103162,9003],[103163,103165,9001],[103166,103168,9002],[103169,103171,9003],[103186,103188,9001],[103189,103191,9003],[103192,103195,9001],[103196,103199,9003],[103200,103224,9001],[103225,103227,9002],[103232,103237,9001],[103238,103243,9003],[103244,103246,9001],[103247,103249,9003],[103254,103256,9001],[103257,103259,9003],[103264,103266,9001],[103267,103269,9003],[103300,103375,9001],[103381,103383,9001],[103384,103386,9002],[103387,103389,9001],
[103390,103392,9003],[103397,103399,9001],[103400,103471,9003],[103476,103478,9001],[103479,103481,9003],[103486,103488,9001],[103489,103491,9003],[103492,103495,9001],[103496,103499,9003],[103539,103543,9001],[103544,103548,9003],[103549,103551,9001],[103552,103554,9002],[103555,103557,9003],[103558,103560,9001],[103571,103573,9001],[103574,103576,9003],[103577,103580,9001],[103581,103583,9003],[103600,103694,9001],[103700,103793,9003],[103794,103799,9001],[104100,104138,9102],[104141,104145,9102],
[104256,104261,9102],[104700,104786,9102],[104900,104970,9102],[104990,104992,9102]],nc:[2066,9039,2136,9094,2155,9003,2157,9001,2158,9001,2159,9094,2160,9094,2219,9001,2220,9001,2244,9003,2245,9003,2256,9002,2265,9002,2266,9002,2269,9002,2270,9002,2273,9002,2290,9001,2291,9001,2294,9001,2295,9001,2313,9001,2314,9005,2899,9003,2900,9003,2901,9002,2909,9002,2910,9002,2911,9003,2912,9003,2913,9002,2914,9002,2964,9003,2967,9003,2968,9003,2991,9001,2992,9002,2993,9001,2994,9002,3073,9001,3076,9001,3079,
9001,3091,9003,3106,9001,3108,9001,3109,9001,3141,9001,3142,9001,3167,9301,3337,9001,3347,9001,3348,9001,3359,9003,3360,9001,3361,9002,3362,9001,3363,9003,3364,9001,3365,9003,3366,9005,3402,9001,3403,9001,3405,9001,3406,9001,3439,9001,3440,9001,3447,9001,3449,9001,3450,9001,3453,9003,3454,9003,3460,9001,3479,9002,3480,9001,3481,9002,3482,9001,3483,9002,3484,9001,3485,9003,3486,9001,3487,9003,3488,9001,3489,9001,3490,9003,3491,9001,3492,9003,3493,9001,3494,9003,3495,9001,3496,9003,3497,9001,3498,9003,
3499,9001,3500,9003,3501,9001,3502,9003,3503,9001,3504,9003,3505,9001,3506,9003,3507,9001,3508,9003,3509,9001,3510,9003,3511,9001,3512,9003,3513,9001,3514,9001,3515,9003,3516,9001,3517,9003,3518,9001,3519,9003,3520,9001,3521,9003,3522,9001,3523,9003,3524,9001,3525,9003,3526,9001,3527,9003,3528,9001,3529,9003,3530,9001,3531,9003,3532,9001,3533,9003,3534,9001,3535,9003,3536,9001,3537,9003,3538,9001,3539,9003,3540,9001,3541,9003,3542,9001,3543,9003,3544,9001,3545,9003,3546,9001,3547,9003,3548,9001,3549,
9003,3550,9001,3551,9003,3552,9001,3553,9003,3582,9003,3583,9001,3584,9003,3585,9001,3586,9003,3587,9001,3588,9002,3589,9001,3590,9002,3591,9001,3592,9001,3593,9002,3598,9003,3599,9001,3600,9003,3605,9002,3606,9001,3607,9001,3608,9003,3609,9001,3610,9003,3611,9001,3612,9003,3613,9001,3614,9003,3615,9001,3616,9003,3617,9001,3618,9003,3619,9001,3620,9003,3621,9001,3622,9003,3623,9001,3624,9003,3625,9001,3626,9003,3627,9001,3628,9003,3629,9001,3630,9003,3631,9001,3632,9003,3633,9001,3634,9002,3635,9001,
3636,9002,3640,9003,3641,9001,3642,9003,3643,9001,3644,9002,3645,9001,3646,9002,3647,9001,3648,9002,3649,9001,3650,9003,3651,9001,3652,9003,3653,9001,3654,9003,3655,9001,3656,9002,3657,9001,3658,9003,3659,9001,3660,9003,3661,9001,3662,9003,3663,9001,3664,9003,3668,9003,3669,9001,3670,9003,3671,9001,3672,9003,3673,9001,3674,9003,3675,9001,3676,9002,3677,9003,3678,9001,3679,9002,3680,9003,3681,9001,3682,9002,3683,9003,3684,9001,3685,9001,3686,9003,3687,9001,3688,9003,3689,9001,3690,9003,3691,9001,3692,
9003,3696,9003,3697,9001,3698,9003,3699,9001,3700,9003,3740,9001,3749,9001,3783,9001,3784,9001,3793,9001,3794,9001,3802,9001,3816,9001,3829,9001,3854,9001,3920,9001,3978,9001,3979,9001,3991,9003,3992,9003,4026,9001,4037,9001,4038,9001,4042,9102,4075,9102,4081,9102,4168,9102,4170,9102,4188,9102,4217,9003,4261,9105,4262,9102,4263,9102,4288,9102,4289,9102,4305,9105,4322,9102,4324,9102,4326,9102,4438,9003,4439,9003,4466,9102,4467,9001,4469,9102,4471,9001,4474,9001,4475,9102,4483,9102,4490,9102,4555,9102,
4558,9102,4559,9001,4614,9102,4619,9102,4657,9102,4670,9102,4671,9102,4674,9102,4682,9102,4683,9102,4718,9102,4720,9102,4721,9102,4723,9102,4726,9102,4737,9102,4738,9102,4759,9102,4761,9102,4807,9105,4808,9102,4809,9102,4816,9105,4817,9102,4818,9102,4819,9105,4820,9102,4821,9105,4823,9102,4824,9102,4839,9001,4901,9105,4902,9105,4903,9102,4904,9102,5018,9001,5048,9001,5167,9001,5168,9001,5223,9001,5228,9102,5229,9102,5233,9102,5234,9001,5235,9001,5243,9001,5252,9102,5264,9102,5266,9001,5316,9001,5320,
9001,5321,9001,5330,9001,5331,9001,5337,9001,5340,9102,5354,9102,5360,9102,5361,9001,5362,9001,5371,9102,5373,9102,5381,9102,5382,9001,5383,9001,5393,9102,5396,9001,5456,9001,5457,9001,5464,9102,5467,9102,5469,9001,5472,9037,5489,9102,5490,9001,5518,9001,5523,9001,5524,9102,5527,9102,5546,9102,5559,9001,5561,9102,5588,9002,5589,9005,5593,9102,5596,9001,5627,9001,5629,9001,5641,9001,5643,9001,5644,9001,5654,9003,5655,9003,5659,9001,5681,9102,5700,9001,5825,9001,5836,9001,5837,9001,5842,9001,5844,9001,
5880,9001,5886,9102,5887,9001,5890,9001,20499,9001,20538,9001,20539,9001,20790,9001,20791,9001,21291,9001,21292,9001,21500,9001,21817,9001,21818,9001,22032,9001,22033,9001,22091,9001,22092,9001,22332,9001,22391,9001,22392,9001,22700,9001,22770,9001,22780,9001,22832,9001,23090,9001,23095,9001,23239,9001,23240,9001,23433,9001,23700,9001,24047,9001,24048,9001,24100,9005,24200,9001,24305,9001,24306,9001,24382,9084,24383,9001,24500,9001,24547,9001,24548,9001,24571,9062,24600,9001,25E3,9001,25231,9001,
25884,9001,25932,9001,26237,9001,26331,9001,26332,9001,26591,9001,26592,9001,26632,9001,26692,9001,26855,9003,26856,9003,27120,9001,27200,9001,27291,9040,27292,9040,27429,9001,27492,9001,27500,9001,27700,9001,28232,9001,28600,9001,28991,9001,28992,9001,29100,9001,29220,9001,29221,9001,29333,9001,29635,9001,29636,9001,29701,9001,29738,9001,29739,9001,29849,9001,29850,9001,29871,9042,29872,9041,29873,9001,29900,9001,29901,9001,29903,9001,30200,9039,30339,9001,30340,9001,30591,9001,30592,9001,30791,
9001,30792,9001,31028,9001,31121,9001,31154,9001,31170,9001,31171,9001,31370,9001,31528,9001,31529,9001,31600,9001,31700,9001,31838,9001,31839,9001,31901,9001,32061,9001,32062,9001,32098,9001,32099,9003,32100,9001,32104,9001,32161,9001,32766,9001,37225,9105,37235,9102,37257,9102,37259,9102,37260,9102,53034,9001,53048,9001,53049,9001,54034,9001,65061,9003,65062,9003,65161,9001,65163,9001,102041,9003,102064,9085,102068,109030,102069,109031,102118,9003,102119,9002,102120,9003,102121,9003,102217,9003,
102218,9001,102219,9003,102220,9003,102378,9002,102379,9002,102380,9001,102381,9002,102589,9003,102599,9003,102600,9003,102604,9003,102605,9001,102606,9001,102647,9001,102704,9003,102705,9003,102733,9003,102761,9003,102762,9001,102763,9003,102764,9001,102765,9001,102766,9003,102970,9002,102974,9003,102993,9001,102994,9001,102995,9003,102996,9003,103015,9001,103016,9003,103017,9001,103018,9003,103025,9001,103026,9001,103027,9003,103028,9003,103035,9001,103036,9001,103037,9003,103038,9003,103039,9001,
103040,9001,103041,9003,103042,9003,103043,9001,103044,9001,103045,9003,103046,9003,103047,9001,103048,9001,103049,9003,103050,9003,103051,9001,103052,9003,103053,9001,103054,9003,103055,9001,103056,9003,103057,9001,103058,9001,103059,9003,103060,9003,103061,9001,103062,9001,103063,9003,103064,9003,103069,9003,103070,9001,103071,9001,103072,9003,103073,9003,103086,9001,103087,9001,103088,9003,103089,9003,103094,9002,103095,9001,103096,9003,103103,9001,103104,9003,103105,9001,103106,9003,103121,9001,
103122,9003,103123,9001,103124,9001,103125,9002,103126,9002,103127,9001,103128,9001,103129,9003,103130,9003,103131,9001,103132,9001,103133,9003,103134,9003,103135,9001,103136,9001,103137,9002,103138,9002,103139,9001,103140,9003,103141,9001,103142,9003,103143,9001,103144,9003,103145,9001,103146,9002,103147,9001,103148,9001,103149,9003,103150,9003,103151,9001,103152,9003,103172,9001,103173,9003,103174,9001,103175,9001,103176,9003,103177,9003,103178,9001,103179,9001,103180,9003,103181,9003,103182,9001,
103183,9001,103184,9003,103185,9003,103228,9001,103229,9001,103230,9003,103231,9003,103250,9001,103251,9003,103252,9001,103253,9003,103260,9001,103261,9001,103262,9003,103263,9003,103270,9001,103271,9001,103272,9003,103273,9003,103274,9001,103275,9001,103276,9003,103277,9003,103278,9001,103279,9001,103280,9003,103281,9003,103282,9001,103283,9001,103284,9003,103285,9003,103286,9001,103287,9003,103288,9001,103289,9003,103290,9001,103291,9003,103292,9001,103293,9001,103294,9003,103295,9003,103296,9001,
103297,9001,103298,9003,103299,9003,103376,9003,103377,9001,103378,9001,103379,9003,103380,9003,103393,9001,103394,9001,103395,9003,103396,9003,103472,9001,103473,9002,103474,9001,103475,9003,103482,9001,103483,9003,103484,9001,103485,9003,103500,9001,103501,9003,103502,9001,103503,9001,103504,9002,103505,9002,103506,9001,103507,9001,103508,9003,103509,9003,103510,9001,103511,9001,103512,9003,103513,9003,103514,9001,103515,9003,103516,9001,103517,9003,103518,9001,103519,9003,103520,9001,103521,9002,
103522,9001,103523,9001,103524,9003,103525,9003,103526,9001,103527,9003,103561,9003,103562,9003,103563,9001,103564,9001,103565,9003,103566,9003,103567,9001,103568,9001,103569,9003,103570,9003,103585,9003,103695,9003,104020,9102,104139,9105,104140,9105,104223,9102,104286,9102,104287,9102,104304,9102,104305,9102,104896,9102]},e=function(){function d(){}d.cC=function(g){!1===d.ti&&d.bo();var e=d.NG(g);if(-1==e){var u=d.ks(g);u!=g&&(e=d.cC(u))}return e};d.NG=function(g){return void 0!==d.ds[g]?d.ds[g]:
-1};d.SM=function(g){!1===d.ti&&d.bo();var e=d.Fz(g);if(1E38==e){var u=d.ks(g);u!=g&&(e=d.Fz(u));if(1E38==e)return 1E-10}return e};d.WO=function(g){if(void 0!==d.Un[g])return!0;var e=d.ks(g);return e!=g&&void 0!==d.Un[e]?!0:!1};d.ZO=function(g){if(void 0!==d.Gh[g])return!0;var e=d.ks(g);return e!=g&&void 0!==d.Gh[e]?!0:!1};d.Fz=function(g){!1===d.ti&&d.bo();return void 0!==d.Un[g]?d.Un[g]:void 0!==d.Gh[g]?d.Gh[g]:1E38};d.oU=function(g){!1===d.ti&&d.bo();return void 0!==d.ew[g]?d.ew[g]:g};d.ks=function(g){!1===
d.ti&&d.bo();return void 0!==d.Mw[g]?d.Mw[g]:g};d.bo=function(){for(var g=h,e,u=0;u<g.pcsid.length;u+=2)d.Gh[g.pcsid[u]]=g.pcstol[2*g.pcsid[u+1]+1];for(u=0;u<g.pcsidc.length;u+=1){e=g.pcsidc[u];for(var a=e[0];a<=e[1];a++)d.Gh[a]=g.pcstol[2*e[2]+1]}for(u=0;u<g.gcsid.length;u+=2)d.Un[g.gcsid[u]]=g.gcstol[2*g.gcsid[u+1]+1];for(u=0;u<g.gcsidc.length;u+=1)for(e=g.gcsidc[u],a=e[0];a<=e[1];a++)d.Gh[a]=g.gcstol[2*e[2]+1];for(u=0;u<b.c.length;u+=1)for(e=b.c[u],a=e[0];a<=e[1];a++)d.ds[a]=e[2];for(u=0;u<b.nc.length;u+=
2)d.ds[b.nc[u]]=b.nc[u+1];b=null;for(u=0;u<g.newtoold.length;u+=2)d.ew[g.newtoold[u+1]]=g.newtoold[u],d.Mw[g.newtoold[u]]=g.newtoold[u+1];h=null;d.ti=!0};d.ti=!1;d.Un=[];d.Gh=[];d.ew=[];d.Mw=[];d.ds=[];return d}();a.ls=e})(A||(A={}));(function(a){function h(d){return 0===d.length?'""':'"'==d[0]||"."==d[0]||"0"<=d[0]&&"9">=d[0]?d:'"'+d.trim()+'"'}var b=[],e=function(){function d(){}d.UM=function(g){try{for(var e=0;e<b.length;e++)if(b[e].wkttext===g)return b[e].unit;for(var u,C=e="",M=!1,c=0;c<g.length;c++){var p=
g[c];!0===M?'"'==p?'"'==g[c+1]?e+=p:M=!1:e+=p:/[\s]/.test(p)||(","==p?(C=""!==e?C+(h(e)+","):C+",",e=""):")"==p||"]"==p?(C=""!==e?C+(h(e)+"]}"):C+"]}",e=""):"("==p||"["==p?(C+='{ "entity": "'+e.toUpperCase().trim()+'", "values":[',e=""):'"'==p?(M=!0,e=""):e+=p)}u=JSON.parse(C);var f=d.Dz(u);if(null===f)return null;u=null;for(p=0;p<f.values.length;p++)if("object"===typeof f.values[p]&&"UNIT"===f.values[p].entity){u=f.values[p];break}if(null===u)return null;var l=a.Tb.EL("GEOGCS"===f.entity?1:0,u.values[1],
u.values[2]);b.push({wkttext:g,unit:l});10<b.length&&b.shift();return l}catch(aa){return null}};d.Dz=function(g){if(null===g)return null;if("GEOGCS"===g.entity||"PROJCS"===g.entity)return g;for(var e=[],u=0;u<g.values.length;u++)if("object"===typeof g.values[u]&&void 0!==g.values[u].entity){if("GEOGCS"===g.values[u].entity||"PROJCS"==g.values[u].entity)return g.values[u];e.push(g.values[u])}for(g=0;g<e.length;g++)if(u=d.Dz(e[g]),null!==u)return u;return null};d.TM=function(d){var g=-1;if(null!=d&&
0<d.length){var e,a;e=d.indexOf("PROJCS");if(0<=e){var h=0;e=d.lastIndexOf("UNIT");if(0<=e&&(e=d.indexOf(",",e+4),0<e&&(e++,a=d.indexOf("]",e+1),0<a)))try{h=parseFloat(d.substring(e,a))}catch(W){h=0}0<h&&(g=.001/h)}else if(e=d.indexOf("GEOGCS"),0<=e){var b=0,h=0;e=d.indexOf("SPHEROID",e+6);if(0<e&&(e=d.indexOf(",",e+8),0<e)){e++;a=d.indexOf(",",e+1);if(0<a)try{b=parseFloat(d.substring(e,a))}catch(W){b=0}if(0<b&&(e=d.indexOf("UNIT",a+1),0<=e&&(e=d.indexOf(",",e+4),0<e&&(e++,a=d.indexOf("]",e+1),0<
a))))try{h=parseFloat(d.substring(e,a))}catch(W){h=0}}0<b&&0<h&&(g=.001/(b*h))}}return g};return d}();a.mA=e})(A||(A={}));(function(a){(function(a){a[a.NONE=0]="NONE";a[a.LINEAR=1]="LINEAR";a[a.ANGULAR=2]="ANGULAR"})(a.BH||(a.BH={}));(function(a){a[a.enumFloat=0]="enumFloat";a[a.enumDouble=1]="enumDouble";a[a.enumInt32=2]="enumInt32";a[a.enumInt64=3]="enumInt64";a[a.enumInt8=4]="enumInt8";a[a.enumInt16=5]="enumInt16"})(a.oI||(a.oI={}));(function(a){a[a.POSITION=0]="POSITION";a[a.Z=1]="Z";a[a.M=2]=
"M";a[a.ID=3]="ID";a[a.NORMAL=4]="NORMAL";a[a.TEXTURE1D=5]="TEXTURE1D";a[a.TEXTURE2D=6]="TEXTURE2D";a[a.TEXTURE3D=7]="TEXTURE3D";a[a.ID2=8]="ID2";a[a.MAXSEMANTICS=10]="MAXSEMANTICS"})(a.xf||(a.xf={}));var h=function(){function h(e,d){this.er=this.le=null;this.up=this.Aa=0;this.Wg=this.Jf=null;this.tk=0;if(void 0!==d){this.Aa=d.Aa;this.up=d.up;this.Jf=d.Jf.slice(0);this.Wg=d.Wg.slice(0);this.tk=d.tk;this.er=[];for(d=e=0;d<this.Aa;d++)this.er[d]=e,e+=h.Wa(this.Jf[d]);this.up=e;this.le=[];for(d=0;d<
this.Aa;d++){e=h.Wa(this.Hd(d));for(var g=h.ue(this.Hd(d)),m=0;m<e;m++)this.le[this.er[d]+m]=g}}else this.up=this.Aa=0}h.prototype.Hd=function(e){if(0>e||e>this.Aa)throw a.g.N();return this.Jf[e]};h.prototype.zf=function(e){return this.Wg[e]};h.JN=function(e){return h.ac[e]};h.Qh=function(e){return h.Cc[e]};h.ye=function(e){return h.Bd[e]};h.Gh=function(e){return h.ye(h.Qh(e))*h.Wa(e)};h.Wa=function(e){return h.ob[e]};h.Wf=function(e){return 2>e};h.ti=function(e){return h.Wf(h.Qh(e))};h.prototype.hasAttribute=
function(e){return 0<=this.Wg[e]};h.prototype.WC=function(){return this.hasAttribute(1)};h.ue=function(e){return h.V[e]};h.prototype.XN=function(e){return this.er[e]};h.nD=function(e,d){return h.V[e]===d};h.$g=function(e){if(4==e)return 2;if(8==e)return 3;throw a.g.N();};h.prototype.lc=function(e){return this===e};h.prototype.jj=function(){for(var e=a.I.kg(this.Jf[0]),d=1;d<this.Aa;d++)e=a.I.kg(this.Jf[d],e);return e};h.prototype.fj=function(e){return this.er[e]};h.prototype.hc=function(){return this.tk};
h.prototype.Fd=function(e){return this.Jf[e]};h.V=[0,0,NaN,0,0,0,0,0,0];h.ac=[1,1,1,0,2,1,1,1,0];h.Cc=[1,1,1,2,0,0,0,0,2];h.Bd=[4,8,4,8,1,2];h.ob=[2,1,1,1,3,1,2,3,2];return h}();a.pa=h})(A||(A={}));(function(a){function h(d,e,u,a){var g=d.jd,m=d.e+e+1;1===u?a=5<=g[m]:2===u?a=5<g[m]||5==g[m]&&(a||0>m||void 0!==g[m+1]||g[m-1]&1):3===u?a=a||void 0!==g[m]||0>m:(a=!1,0!==u&&b("!Big.RM!"));if(1>m||!g[0])a?(d.e=-e,d.jd=[1]):d.jd=[d.e=0];else{g.length=m--;if(a)for(;9<++g[m];)g[m]=0,m--||(++d.e,g.unshift(1));
for(m=g.length;!g[--m];g.pop());}}function b(d){d=Error(d);d.name="BigError";throw d;}var e=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d=function(){function d(g){if(g instanceof d)this.Dd=g.Dd,this.e=g.e,this.jd=g.jd.slice();else{var m,a,h;0===g&&0>1/g?g="-0":e.test(g+="")||b(NaN);this.Dd="-"==g.charAt(0)?(g=g.slice(1),-1):1;-1<(m=g.indexOf("."))&&(g=g.replace(".",""));0<(a=g.search(/e/i))?(0>m&&(m=a),m+=+g.slice(a+1),g=g.substring(0,a)):0>m&&(m=g.length);for(a=0;"0"==g.charAt(a);a++);if(a==(h=g.length))this.jd=
[this.e=0];else{for(;"0"==g.charAt(--h););this.e=m-a-1;this.jd=[];for(m=0;a<=h;this.jd[m++]=+g.charAt(a++));}}}d.prototype.abs=function(){var g=new d(this);g.Dd=1;return g};d.prototype.DB=function(){var g=0,e=this.jd,a=(g=new d(g)).jd,h=this.Dd,b=g.Dd,c=this.e,p=g.e;if(!e[0]||!a[0])return e[0]?h:a[0]?-b:0;if(h!=b)return h;g=0>h;if(c!=p)return c>(p^g)?1:-1;h=-1;for(b=(c=e.length)<(p=a.length)?c:p;++h<b;)if(e[h]!=a[h])return e[h]>(a[h]^g)?1:-1;return c==p?0:c>(p^g)?1:-1};d.prototype.VB=function(g){var e=
this.jd,m=(g=new d(g)).jd,a=this.Dd==g.Dd?1:-1,c=d.Cc;(c!==~~c||0>c||1E6<c)&&b("!Big.DP!");if(!e[0]||!m[0])return e[0]==m[0]&&b(NaN),m[0]||b(a/0),new d(0*a);var p,f,l,q,n=m.slice(),z=p=m.length,k=e.length,v=e.slice(0,p),t=v.length,A=g,y=A.jd=[],w=0,D=c+(A.e=this.e-g.e)+1;A.Dd=a;a=0>D?0:D;for(n.unshift(0);t++<p;v.push(0));do{for(f=0;10>f;f++){if(p!=(t=v.length))l=p>t?1:-1;else for(q=-1,l=0;++q<p;)if(m[q]!=v[q]){l=m[q]>v[q]?1:-1;break}if(0>l){for(g=t==p?m:n;t;){if(v[--t]<g[t]){for(q=t;q&&!v[--q];v[q]=
9);--v[q];v[t]+=10}v[t]-=g[t]}for(;!v[0];v.shift());}else break}y[w++]=l?f:++f;v[0]&&l?v[t]=e[z]||0:v=[e[z]]}while((z++<k||void 0!==v[0])&&a--);y[0]||1==w||(y.shift(),A.e--);w>D&&h(A,c,d.ye,void 0!==v[0]);return A};d.prototype.nO=function(){return 0<this.DB()};d.prototype.vP=function(){return 0>this.DB()};d.prototype.nr=function(g){var e,m,a=this.Dd,h=(g=new d(g)).Dd;if(a!=h)return g.Dd=-h,this.NE(g);var b=this.jd.slice();m=this.e;var c=g.jd,p=g.e;if(!b[0]||!c[0])return c[0]?(g.Dd=-h,g):new d(b[0]?
this:0);if(a=m-p){(e=0>a)?(a=-a,m=b):(p=m,m=c);m.reverse();for(h=a;h--;m.push(0));m.reverse()}else for(m=((e=b.length<c.length)?b:c).length,a=h=0;h<m;h++)if(b[h]!=c[h]){e=b[h]<c[h];break}e&&(m=b,b=c,c=m,g.Dd=-g.Dd);if(0<(h=(m=c.length)-(e=b.length)))for(;h--;b[e++]=0);for(h=e;m>a;){if(b[--m]<c[m]){for(e=m;e&&!b[--e];b[e]=9);--b[e];b[m]+=10}b[m]-=c[m]}for(;0==b[--h];b.pop());for(;0==b[0];)b.shift(),--p;b[0]||(g.Dd=1,b=[p=0]);g.jd=b;g.e=p;return g};d.prototype.NE=function(g){var e,m=this.Dd;e=(g=new d(g)).Dd;
if(m!=e)return g.Dd=-e,this.nr(g);e=this.e;var a=this.jd,h=g.e,b=g.jd;if(!a[0]||!b[0])return b[0]?g:new d(a[0]?this:0*m);a=a.slice();if(m=e-h){0<m?(h=e,e=b):(m=-m,e=a);for(e.reverse();m--;e.push(0));e.reverse()}0>a.length-b.length&&(e=b,b=a,a=e);m=b.length;for(e=0;m;)e=(a[--m]=a[m]+b[m]+e)/10|0,a[m]%=10;e&&(a.unshift(e),++h);for(m=a.length;0==a[--m];a.pop());g.jd=a;g.e=h;return g};d.prototype.pow=function(g){var e=this,m=new d(1),a=m,h=0>g;(g!==~~g||-1E6>g||1E6<g)&&b("!pow!");for(g=h?-g:g;;){g&1&&
(a=a.Wp(e));g>>=1;if(!g)break;e=e.Wp(e)}return h?m.VB(a):a};d.prototype.round=function(g,e){var m=this;null==g?g=0:(g!==~~g||0>g||1E6<g)&&b("!round!");h(m=new d(m),g,null==e?d.ye:e);return m};d.prototype.sqrt=function(){var g,e,a;e=this.jd;g=this.Dd;a=this.e;var M=new d("0.5");if(!e[0])return new d(this);0>g&&b(NaN);g=Math.sqrt(this.toString());0==g||g==1/0?(g=e.join(""),g.length+a&1||(g+="0"),e=new d(Math.sqrt(g).toString()),e.e=((a+1)/2|0)-(0>a||a&1)):e=new d(g.toString());g=e.e+(d.Cc+=4);do a=
e,e=M.Wp(a.NE(this.VB(a)));while(a.jd.slice(0,g).join("")!==e.jd.slice(0,g).join(""));h(e,d.Cc-=4,d.ye);return e};d.prototype.Wp=function(g){var e,m=this.jd,a=(g=new d(g)).jd,h=m.length,b=a.length,c=this.e,p=g.e;g.Dd=this.Dd==g.Dd?1:-1;if(!m[0]||!a[0])return new d(0*g.Dd);g.e=c+p;h<b&&(e=m,m=a,a=e,p=h,h=b,b=p);for(e=Array(p=h+b);p--;e[p]=0);for(c=b;c--;){b=0;for(p=h+c;p>c;)b=e[p]+a[c]*m[p-c-1]+b,e[p--]=b%10,b=b/10|0;e[p]=(e[p]+b)%10}b&&++g.e;e[0]||e.shift();for(c=e.length;!e[--c];e.pop());g.jd=e;
return g};d.prototype.toString=function(){var d=this.e,g=this.jd.join(""),e=g.length;if(-7>=d||21<=d)g=g.charAt(0)+(1<e?"."+g.slice(1):"")+(0>d?"e":"e+")+d;else if(0>d){for(;++d;g="0"+g);g="0."+g}else if(0<d)if(++d>e)for(d-=e;d--;g+="0");else d<e&&(g=g.slice(0,d)+"."+g.slice(d));else 1<e&&(g=g.charAt(0)+"."+g.slice(1));return 0>this.Dd&&this.jd[0]?"-"+g:g};d.Cc=20;d.ye=1;return d}();a.Tn=d})(A||(A={}));(function(a){var h=function(){function e(d){this.$e=d}e.prototype.Zp=function(d,g,e){var m=new a.b,
h=new a.b,b=this.$e;e.xd(d,g,function(d,g){b.ec(2*d,m);b.ec(2*g,h);return m.compare(h)})};e.prototype.Mo=function(d){return this.$e.read(2*d+1)};return e}(),b=function(){function e(){}e.No=function(d){if(d.s())return!1;var g=d.D();return 1736==g?0==d.Mh()?!1:!0:1607==g?(g=[!1],e.qz(d,!0,g),g[0]):197==g||a.T.Lc(g)&&!d.kD()?!0:!1};e.il=function(d){var g=d.D();if(1736==g)return g=new a.Xa(d.description),d.s()||d.tA(g),g;if(1607==g)return e.qz(d,!1,null);if(197==g)return g=new a.Xa(d.description),d.s()||
g.Wc(d,!1),g;if(a.T.Lc(g)){g=new a.pe(d.description);if(!d.s()&&!d.kD()){var m=new a.Va;d.En(m);g.add(m);d.Bn(m);g.add(m)}return g}if(a.T.Km(g))return null;throw a.g.N();};e.qz=function(d,g,e){null!=e&&(e[0]=!1);var m=null;g||(m=new a.pe(d.description));if(!d.s()){var C=new a.ga(0);C.xb(2*d.ea());for(var b=0,c=d.ea();b<c;b++)if(0<d.Ha(b)&&!d.Oo(b)){var p=d.Ea(b);C.add(p);p=d.Dc(b)-1;C.add(p)}if(0<C.size){c=new a.Rr;b=d.mc(0);c.sort(C,0,C.size,new h(b));c=new a.b;b.ec(2*C.get(0),c);for(var p=0,f=1,
l=new a.Va,q=new a.b,n=1,z=C.size;n<z;n++)if(b.ec(2*C.get(n),q),q.ub(c))C.get(p)>C.get(n)?(C.set(p,2147483647),p=n):C.set(n,2147483647),f++;else{if(0==(f&1))C.set(p,2147483647);else if(g)return null!=e&&(e[0]=!0),null;c.J(q);p=n;f=1}if(0==(f&1))C.set(p,2147483647);else if(g)return null!=e&&(e[0]=!0),null;if(!g)for(C.xd(0,C.size,function(d,g){return d-g}),n=0,z=C.size;n<z&&2147483647!=C.get(n);n++)d.Sd(C.get(n),l),m.add(l)}}return g?null:m};return e}();a.Hh=b})(A||(A={}));(function(a){var h=function(){function h(){this.lf=
new a.ga(0);this.Lq=new a.ga(0);this.gE=1;this.Qq=NaN}h.prototype.sort=function(e,d,g,m){if(32>g-d)m.Zp(d,g,e);else{var a=!0;try{for(var h=Infinity,b=-Infinity,c=d;c<g;c++){var p=m.Mo(e.get(c));p<h&&(h=p);p>b&&(b=p)}if(this.reset(g-d,h,b,g-d)){for(c=d;c<g;c++){var f=e.get(c),p=m.Mo(f),l=this.oC(p);this.lf.set(l,this.lf.get(l)+1);this.Lq.write(c-d,f)}var q=this.lf.get(0);this.lf.set(0,0);for(var c=1,n=this.lf.size;c<n;c++){var z=this.lf.get(c);this.lf.set(c,q);q+=z}for(c=d;c<g;c++){var f=this.Lq.read(c-
d),p=m.Mo(f),l=this.oC(p),v=this.lf.get(l);e.set(v+d,f);this.lf.set(l,v+1)}a=!1}}catch(la){this.lf.resize(0),this.Lq.resize(0)}if(a)m.Zp(d,g,e);else{c=g=0;for(n=this.lf.size;c<n;c++)a=g,g=this.lf.get(c),g>a&&m.Zp(d+a,d+g,e);100<this.lf.size&&(this.lf.resize(0),this.Lq.resize(0))}}};h.prototype.reset=function(e,d,g,m){if(2>e||g==d)return!1;e=Math.min(h.tI,e);this.lf.xb(e);this.lf.resize(e);this.lf.dh(0,0,this.lf.size);this.gE=d;this.Lq.resize(m);this.Qq=(g-d)/(e-1);return!0};h.prototype.oC=function(e){return a.I.truncate((e-
this.gE)/this.Qq)};h.tI=65536;return h}();a.Rr=h})(A||(A={}));(function(a){var h;(function(d){d[d.enum_line=1]="enum_line";d[d.enum_arc=2]="enum_arc";d[d.enum_dummy=4]="enum_dummy";d[d.enum_concave_dip=8]="enum_concave_dip";d[d.enum_connection=3]="enum_connection"})(h||(h={}));var b=function(){function d(){}d.Ks=function(g,e,m,u,h,b){var C=new d;C.Fl=new a.b;C.Ql=new a.b;C.Lt=new a.b;C.Fl.J(g);C.Ql.J(e);C.Lt.J(m);C.qn=u;C.Rg=h;C.Ug=b;return C};d.Oa=function(g,e,m,u){var h=new d;h.Fl=new a.b;h.Ql=
new a.b;h.Lt=new a.b;h.Fl.J(g);h.Ql.J(e);h.Lt.Eh();h.qn=4;h.Rg=m;h.Ug=u;return h};return d}(),e=function(){function d(d,g,e,m,a,u){this.It=null;this.ua=0;this.Ex=d;this.yE=this.wE=0;this.Da=g;this.Pi=e;this.Cj=m;this.mp=a;this.Yb=u}d.prototype.next=function(){for(var d=new a.Va;;){if(this.ua==this.Ex.F())return null;this.Ex.Sd(this.ua,d);this.ua++;if(!d.s())break}var g=!1;null==this.It&&(this.wE=d.lk(),this.yE=d.mk(),this.It=m.buffer(d,this.Da,this.Pi,this.Cj,this.mp,this.Yb),g=!0);var e;this.ua<
this.Ex.F()?(e=new a.Ka,this.It.copyTo(e)):e=this.It;if(!g){var g=new a.Bg,u=d.lk()-this.wE,d=d.mk()-this.yE;g.Nn(u,d);e.Oe(g)}return e};d.prototype.ya=function(){return 0};return d}(),d=function(){function d(d,g){this.Ma=d;this.ua=0;this.Yo=g}d.prototype.next=function(){var d=this.Ma.U;if(this.ua<d.ea()){var g=this.ua;this.ua++;if(!d.Oo(g))for(var e=d.Fa(d.Dc(g)-1);this.ua<d.ea();){var m=d.Fa(d.Ea(this.ua));if(d.Oo(this.ua))break;if(m!=e)break;e=d.Fa(d.Dc(this.ua)-1);this.ua++}if(1==this.ua-g)return this.Ma.kB(this.Ma.U,
g,this.Yo);e=new a.Xa(this.Ma.U.description);e.Zj(this.Ma.U,g,!0);for(g+=1;g<this.ua;g++)e.ys(this.Ma.U,g,0,d.ct(g),!1);return this.Ma.kB(e,0,this.Yo)}return null};d.prototype.ya=function(){return 0};return d}(),g=function(){function d(d){this.Ma=d;this.ua=0}d.prototype.next=function(){var d=this.Ma.U;if(this.ua<d.ea()){var g=this.ua;d.oo(this.ua);for(this.ua++;this.ua<d.ea()&&!(0<d.oo(this.ua));)this.ua++;return 0==g&&this.ua==d.ea()?this.Ma.Gv(d,0,d.ea()):this.Ma.Gv(d,g,this.ua)}return null};d.prototype.ya=
function(){return 0};return d}(),m=function(){function m(d){this.Vq=this.Tt=this.Wq=this.sd=null;this.Jd=[];this.Yb=d;this.hb=this.wt=this.OP=this.Da=this.vx=this.jr=this.ka=0;this.sx=this.Cj=-1;this.Yo=!0}m.buffer=function(d,g,e,u,h,b){if(null==d)throw a.g.N();if(0>u)throw a.g.N();if(d.s())return new a.Ka(d.description);var C=new a.i;d.dd(C);0<g&&C.P(g,g);b=new m(b);b.Pi=e;b.U=d;b.ka=a.Ia.zd(e,C,!0);b.jr=a.Ia.zd(null,C,!0);b.Da=g;b.OP=d.D();0>=h&&(h=96);b.hb=Math.abs(b.Da);b.wt=0!=b.hb?1/b.hb:0;
isNaN(u)||0==u?u=1E-5*b.hb:u>.5*b.hb&&(u=.5*b.hb);12>h&&(h=12);d=Math.abs(g)*(1-Math.cos(Math.PI/h));d>u?u=d:(d=Math.PI/Math.acos(1-u/Math.abs(g)),d<h-1&&(h=a.I.truncate(d),12>h&&(h=12,u=Math.abs(g)*(1-Math.cos(Math.PI/h)))));b.Cj=u;b.mp=h;b.vx=Math.min(b.jr,.25*u);return b.lB()};m.prototype.Ss=function(){if(null==this.sd)this.sd=[];else if(0!==this.sd.length)return;var d=this.pB(),d=a.I.truncate((d+3)/4),g=.5*Math.PI/d;this.sx=g;for(var e=0;e<4*d;e++)this.sd.push(null);for(var m=Math.cos(g),g=Math.sin(g),
u=a.b.Oa(0,1),e=0;e<d;e++)this.sd[e+0*d]=a.b.Oa(u.y,-u.x),this.sd[e+1*d]=a.b.Oa(-u.x,-u.y),this.sd[e+2*d]=a.b.Oa(-u.y,u.x),this.sd[e+3*d]=u,u=a.b.Oa(u.x,u.y),u.Er(m,g)};m.prototype.lB=function(){var d=this.U.D();if(a.T.Lc(d))return d=new a.Xa(this.U.description),d.Bc(this.U,!0),this.U=d,this.lB();if(this.Da<=this.ka)if(a.T.SO(d)){if(0>=this.Da&&(d=new a.i,this.U.o(d),d.aa()<=2*-this.Da||d.ba()<=2*this.Da))return new a.Ka(this.U.description)}else return new a.Ka(this.U.description);switch(this.U.D()){case 33:return this.tK();
case 550:return this.sK();case 1607:return this.vK();case 1736:return this.uK();case 197:return this.qK();default:throw a.g.wa();}};m.prototype.vK=function(){if(this.oD(this.U)){var g=new a.Va;this.U.Sd(0,g);var e=new a.i;this.U.o(e);g.ic(e.Af());return this.Es(g)}this.U=this.SQ(this.U);g=new d(this,this.Yo);return a.wi.local().$(g,this.Pi,this.Yb).next()};m.prototype.uK=function(){if(0==this.Da)return this.U;var d=a.as.local();this.Ss();this.U=d.$(this.U,null,!1,this.Yb);if(0>this.Da){var e=this.U,
e=this.Gv(e,0,e.ea());return d.$(e,this.Pi,!1,this.Yb)}if(this.oD(this.U))return d=new a.Va,this.U.Sd(0,d),e=new a.i,this.U.o(e),d.ic(e.Af()),this.Es(d);d=new g(this);return a.wi.local().$(d,this.Pi,this.Yb).next()};m.prototype.Gv=function(d,g,e){for(var u=new a.Ka(d.description);g<e;g++)if(!(1>d.Ha(g))){var h=d.oo(g),C=new a.i;d.Ti(g,C);if(0<this.Da)if(0<h)if(this.pD(d,g))h=new a.Va,d.Sd(d.Ea(g),h),h.ic(C.Af()),this.us(u,h);else{var b=h=new a.Xa(d.description),b=a.Tr.sD(this.U,g)||2==this.sm(this.U,
g,b,!0,1)?this.jB(d,g):this.rm(h);u.add(b,!1)}else{if(!(C.aa()+this.ka<=2*this.hb||C.ba()+this.ka<=2*this.hb||(b=h=new a.Xa(d.description),this.sm(this.U,g,b,!0,1),h.s()))){var c=new a.i;c.K(C);c.P(this.hb,this.hb);b.ws(c);b=this.rm(h);C=1;for(h=b.ea();C<h;C++)u.Zj(b,C,!0)}}else if(0<h){if(!(C.aa()+this.ka<=2*this.hb||C.ba()+this.ka<=2*this.hb||(b=h=new a.Xa(d.description),this.sm(this.U,g,b,!0,-1),h.s())))for(c=new a.i,b.dd(c),c.P(this.hb,this.hb),b.ws(c),b=this.rm(h),C=1,h=b.ea();C<h;C++)u.Zj(b,
C,!0)}else for(b=h=new a.Xa(d.description),this.sm(this.U,g,b,!0,-1),b=this.rm(h),C=0,h=b.ea();C<h;C++)u.Zj(b,C,!0)}if(0<this.Da)return 1<u.ea()?u=this.rm(u):m.Id(u);d=new a.i;u.dd(d);if(u.s())return m.Id(u);d.P(this.hb,this.hb);u.ws(d);u=this.rm(u);d=new a.Ka(u.description);C=1;for(h=u.ea();C<h;C++)d.Zj(u,C,!1);return m.Id(d)};m.prototype.tK=function(){return this.Es(this.U)};m.prototype.Es=function(d){var g=new a.Ka(this.U.description);this.us(g,d);return this.nS(g)};m.prototype.sK=function(){var d=
new e(this.U,this.Da,this.Pi,this.Cj,this.mp,this.Yb);return a.wi.local().$(d,this.Pi,this.Yb).next()};m.prototype.qK=function(){var d=new a.Ka(this.U.description);if(0>=this.Da){if(0==this.Da)d.Wc(this.U,!1);else{var g=new a.Vj;this.U.Fp(g);g.P(this.Da,this.Da);d.Wc(g,!1)}return d}d.Wc(this.U,!1);this.U=d;return this.jB(d,0)};m.prototype.jB=function(d,g){this.Ss();var e=new a.Ka(d.description),u=new a.b,h=new a.b,C=new a.b,b=new a.b,c=new a.b,M=new a.b,p=new a.b,f=new a.b,l=d.Ha(g),q=d.Ea(g),n=0;
for(g=d.Ha(g);n<g;n++){d.w(q+n,h);d.w(q+(n+1)%l,b);d.w(q+(n+2)%l,M);p.pc(b,h);if(0==p.length())throw a.g.wa();p.tt();p.normalize();p.scale(this.hb);u.add(p,h);C.add(p,b);0==n?e.Nr(u):e.Lm(u);e.Lm(C);f.pc(M,b);if(0==f.length())throw a.g.wa();f.tt();f.normalize();f.scale(this.hb);c.add(f,b);this.NA(e,b,C,c,!1)}return m.Id(e)};m.prototype.kB=function(d,g,e){this.Ss();if(1>d.Ha(g))return null;if(this.pD(d,g)&&0<this.Da){e=new a.Va;d.Sd(d.Ea(g),e);var m=new a.i;d.Ti(g,m);e.ic(m.Af());return this.Es(e)}m=
new a.Xa(d.description);if(d.Oo(g))this.sm(d,g,m,e,1),this.sm(d,g,m,e,-1);else{var u=new a.Xa(d.description);u.Zj(d,g,!1);u.ys(d,g,0,d.ct(g),!1);this.sm(u,0,m,e,1)}return this.rm(m)};m.prototype.rm=function(d){return a.Of.Qj(d,this.jr,!0,!0,this.Yb)};m.prototype.pB=function(){if(0==this.Cj)return this.mp;var d=1-this.Cj*Math.abs(this.wt),g;-1>d?g=4:g=2*Math.PI/Math.acos(d)+.5;4>g?g=4:g>this.mp&&(g=this.mp);return a.I.truncate(g)};m.prototype.NA=function(d,g,e,m,u){this.Ss();var h=new a.b;h.pc(e,g);
h.scale(this.wt);var C=new a.b;C.pc(m,g);C.scale(this.wt);h=Math.atan2(h.y,h.x)/this.sx;0>h&&(h=this.sd.length+h);h=this.sd.length-h;C=Math.atan2(C.y,C.x)/this.sx;0>C&&(C=this.sd.length+C);C=this.sd.length-C;C<h&&(C+=this.sd.length);var b=a.I.truncate(C),C=a.I.truncate(Math.ceil(h)),h=new a.b;h.J(this.sd[C%this.sd.length]);h.Fr(this.hb,g);var c=10*this.ka;h.sub(e);h.length()<c&&(C+=1);h.J(this.sd[b%this.sd.length]);h.Fr(this.hb,g);h.sub(m);h.length()<c&&--b;e=b-C;e++;b=0;for(C%=this.sd.length;b<e;b++,
C=(C+1)%this.sd.length)h.J(this.sd[C]),h.Fr(this.hb,g),d.Lm(h);u&&d.Lm(m)};m.prototype.sm=function(d,g,e,m,u){var h=new a.fd,C=h.QJ(d,g);h.xo(this.vx,!1,!1);if(2>h.F(C)){if(0>u)return 1;u=d;h=new a.Va;u.Sd(u.Ea(g),h);this.us(e,h);return 1}var c=h.Fa(h.Cb(h.Vb(C))),M=new a.Bg;M.Nn(-c.x,-c.y);h.Oe(M);if(m&&(this.MM(h,C,u),2>h.F(C))){if(0>u)return 1;u=d;h=new a.Va;u.Sd(u.Ea(g),h);this.us(e,h);return 1}this.Jd.length=0;var p=h.Vb(C);g=h.Cb(p);var f=1==u?h.Ua(g):h.X(g);d=1==u?h.X(g):h.Ua(g);var l=!0;m=
new a.b;for(var C=new a.b,q=new a.b,Y=new a.b,n=new a.b,z=new a.b,W=new a.b,v=new a.b,k=new a.b,t=new a.b,A=this.hb,p=h.Ha(p),y=0;y<p;y++)h.w(d,C),l&&(h.w(g,m),h.w(f,q),v.pc(m,q),v.normalize(),t.zD(v),t.scale(A),Y.add(t,m)),W.pc(C,m),W.normalize(),k.zD(W),k.scale(A),n.add(m,k),f=v.Ai(W),l=v.ml(W),0>f||0>l&&0==f?this.Jd.push(b.Ks(Y,n,m,2,this.Jd.length+1,this.Jd.length-1)):Y.ub(n)||(this.Jd.push(b.Oa(Y,m,this.Jd.length+1,this.Jd.length-1,"dummy")),this.Jd.push(b.Oa(m,n,this.Jd.length+1,this.Jd.length-
1,"dummy"))),z.add(C,k),this.Jd.push(b.Ks(n,z,m,1,this.Jd.length+1,this.Jd.length-1)),Y.J(z),t.J(k),q.J(m),m.J(C),v.J(W),f=g,g=d,l=!1,d=1==u?h.X(g):h.Ua(g);this.Jd[this.Jd.length-1].Rg=0;this.Jd[0].Ug=this.Jd.length-1;this.UQ(e);M.Nn(c.x,c.y);e.ZA(M,e.ea()-1);return 1};m.prototype.UQ=function(d){for(var g=this.aL(),e=!0,m=g+1,a=g;m!=g;a=m){var u=this.Jd[a],m=-1!=u.Rg?u.Rg:(a+1)%this.Jd.length;0!=u.qn&&(e&&d.Nr(u.Fl),2==u.qn?this.NA(d,u.Lt,u.Fl,u.Ql,!0):d.Lm(u.Ql),e=!1)}};m.prototype.aL=function(){null==
this.Vq&&(this.Vq=[null,null,null,null,null,null,null,null,null]);for(var d=0,g=0,e=this.Jd.length;g<e;){var m=this.Jd[g];if(0!=(m.qn&3)){d=g;break}g=m.Rg}e=d+1;for(g=d;e!=d;g=e){for(var m=this.Jd[g],e=m.Rg,u=1,h=null;e!=g;){h=this.Jd[e];if(0!=(h.qn&3))break;e=h.Rg;u++}1!=u&&1==(m.qn&h.qn)&&(null==this.Wq&&(this.Wq=new a.yb,this.Tt=new a.yb),this.Wq.ed(m.Fl),this.Wq.vd(m.Ql),this.Tt.ed(h.Fl),this.Tt.vd(h.Ql),1==this.Wq.Ga(this.Tt,this.Vq,null,null,this.jr)&&(m.Ql.J(this.Vq[0]),h.Fl.J(this.Vq[0]),
m.Rg=e,h.Ug=g))}return d};m.prototype.rt=function(d,g,e){var m=new a.b;m.pc(e,d);e=m.length();e=this.hb*this.hb-e*e*.25;if(0<e){e=Math.sqrt(e);m.normalize();m.Kp();var u=new a.b;u.pc(g,d);if(u.ml(m)+e>=this.hb)return!0}return!1};m.prototype.MM=function(d,g,e){for(var m=0;1>m;m++){var u=!1,h=d.Vb(g),C=d.Ha(h);if(0==C)break;var b=C;if(3>C)break;!d.vc(h)&&(b=C-1);for(var h=d.Cb(h),C=0<e?d.Ua(h):d.X(h),c=0<e?d.X(h):d.Ua(h),M=C,p=!0,f=new a.b,l=new a.b,q=new a.b,n=new a.b,Y=new a.b,z=a.b.Oa(0,0),v=new a.b,
k=new a.b,t=new a.b,A=new a.b,y=this.hb,w=0,D=0;D<b;){d.w(c,l);p&&(d.w(h,f),d.w(C,q),M=C);k.pc(f,q);k.normalize();v.pc(l,f);v.normalize();if(M==c)break;var B=k.Ai(v),F=k.ml(v),Q=!0;0>B||0>F&&0==B||!this.rt(q,f,l)||(z.J(l),Q=!1,++w,u=!0);if(Q){if(0<w)for(;;){B=0<e?d.Ua(M):d.X(M);if(B==h)break;d.w(B,n);if(this.rt(n,q,z))q.J(n),M=B,Q=!1,++w;else{B!=c&&this.rt(n,q,l)&&this.rt(n,f,l)&&(q.J(n),M=B,Q=!1,++w);break}}if(!Q)continue;if(0<w){M=0<e?d.Ua(C):d.X(C);for(p=1;p<w;p++)Q=0<e?d.Ua(M):d.X(M),d.vf(M,!0),
M=Q;t.pc(f,q);w=t.length();w=y*y-w*w*.25;w=Math.sqrt(w);y-w>.5*this.Cj?(Y.add(q,f),Y.scale(.5),t.normalize(),t.Kp(),A.J(t),A.scale(y-w),Y.add(A),d.Yi(C,Y)):d.vf(C,!0);w=0}q.J(f);M=h}f.J(l);C=h;h=c;c=0<e?d.X(h):d.Ua(h);D++;p=!1}if(0<w){M=0<e?d.Ua(C):d.X(C);for(p=1;p<w;p++)Q=0<e?d.Ua(M):d.X(M),d.vf(M,!0),M=Q;Y.add(q,f);Y.scale(.5);t.pc(f,q);w=t.length();w=y*y-w*w*.25;w=Math.sqrt(w);t.normalize();t.Kp();A.J(t);A.scale(y-w);Y.add(A);d.Yi(C,Y)}d.xo(this.vx,!1,!1);if(!u)break}};m.prototype.pD=function(d,
g){if(1==d.Ha(g))return!0;var e=new a.i;d.Ti(g,e);return Math.max(e.aa(),e.ba())<.5*this.Cj?!0:!1};m.prototype.oD=function(d){var g=new a.i;d.o(g);return Math.max(g.aa(),g.ba())<.5*this.Cj?!0:!1};m.prototype.SQ=function(d){d=a.Sz.local().$(d,.25*this.Cj,!1,this.Yb);for(var g=0,e=0,m=d.ea();e<m;e++)g=Math.max(d.Ha(e),g);if(32>g)return this.Yo=!1,d;this.Yo=!0;return a.Of.Qj(d,this.jr,!1,!0,this.Yb)};m.prototype.us=function(d,g){g=g.w();if(null!=this.sd&&0!==this.sd.length){var e=new a.b;e.J(this.sd[0]);
e.Fr(this.hb,g);d.Nr(e);for(var m=1,u=this.sd.length;m<u;m++)e.J(this.sd[m]),e.Fr(this.hb,g),d.Lm(e)}else for(var m=this.pB(),e=a.I.truncate((m+3)/4),m=.5*Math.PI/e,u=Math.cos(m),h=Math.sin(m),C=new a.b,b=3;0<=b;b--)switch(C.ma(0,this.hb),b){case 0:for(m=0;m<e;m++)d.wj(C.x+g.x,C.y+g.y),C.Er(u,h);break;case 1:for(m=0;m<e;m++)d.wj(-C.y+g.x,C.x+g.y),C.Er(u,h);break;case 2:for(m=0;m<e;m++)d.wj(-C.x+g.x,-C.y+g.y),C.Er(u,h);break;default:for(d.Uy(C.y+g.x,-C.x+g.y),m=1;m<e;m++)C.Er(u,h),d.wj(C.y+g.x,-C.x+
g.y)}};m.Id=function(d){d.hg(1,0);return d};m.prototype.nS=function(d){d.hg(2,this.ka);d.hl();return d};return m}();a.UG=m})(A||(A={}));(function(a){var h=function(){function h(e){this.Qb=e;this.a=new a.fd;this.vg=new a.ga(0)}h.prototype.po=function(e,d,g){switch(d){case 0:if(e.v<g&&e.B<=g)break;else return e.v>=g?1:-1;case 1:if(e.C<g&&e.G<=g)break;else return e.C>=g?1:-1;case 2:if(e.v>=g&&e.B>g)break;else return e.B<=g?1:-1;case 3:if(!(e.C>=g&&e.G>g))return e.G<=g?1:-1}return 0};h.prototype.cL=function(e,
d){return 1736==e.D()?this.dL(e,d):this.eL(e)};h.prototype.dL=function(e,d){if(0==this.Qb.aa()||0==this.Qb.ba())return e.Pa();var g=new a.i;e.dd(g);this.U=this.a.Eb(e);var m=new a.i,u=new a.i,h=new a.b,b=new a.b,c=[0,0,0,0,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0];new a.Ag;var f=new a.yb,l=new a.ga(0);l.xb(Math.min(100,e.F()));for(var q=!1,n=0;!q&&4>n;n++){var z=!1,v=0!=(n&1),t=0;switch(n){case 0:t=this.Qb.v;z=g.v<=t&&g.B>=t;break;case 1:t=this.Qb.C;z=g.C<=t&&g.G>=t;break;case 2:t=this.Qb.B;z=g.v<=t&&g.B>=
t;break;case 3:t=this.Qb.G,z=g.C<=t&&g.G>=t}if(z)for(q=!0,z=this.a.Vb(this.U);-1!=z;){var k=-1,A=-1,y=this.a.Cb(z),w=y;do{var D=this.a.cc(w);null==D&&(D=f,this.a.w(w,h),D.ed(h),this.a.w(this.a.X(w),b),D.vd(b));D.o(m);var B=this.po(m,n,t),F=0,Q=-1;if(-1==B){D=D.nt(v,t,c,p);0<D?F=this.a.Mr(w,p,D):F=0;for(var F=F+1,J=w,G=this.a.X(J),D=0;D<F;D++){this.a.w(J,h);this.a.w(G,b);Q=this.a.cc(J);null==Q&&(Q=f,Q.ed(h),Q.vd(b));Q.o(u);Q=this.po(u,n,t);if(-1==Q){if(v)Q=Math.abs(h.y-t),I=Math.abs(b.y-t),Q<I?(h.y=
t,this.a.Yi(J,h)):(b.y=t,this.a.Yi(G,b));else{var Q=Math.abs(h.x-t),I=Math.abs(b.x-t);Q<I?(h.x=t,this.a.Yi(J,h)):(b.x=t,this.a.Yi(G,b))}Q=this.a.cc(J);null==Q&&(Q=f,Q.ed(h),Q.vd(b));Q.o(u);Q=this.po(u,n,t)}I=k;k=Q;-1==A&&(A=k);if(0!=I||1!=k)1==I&&0==k||0!=I||0!=k||l.add(J);1==k&&(q=!1);Q=J=G;G=this.a.X(G)}}if(0==F){I=k;k=B;-1==A&&(A=k);if(0!=I||1!=k)1==I&&0==k||0!=I||0!=k||l.add(w);1==k&&(q=!1);Q=this.a.X(w)}w=Q}while(w!=y);0==A&&0==k&&l.add(y);D=0;for(k=l.size;D<k;D++)A=l.get(D),this.a.vf(A,!1);
l.clear(!1);z=3>this.a.Ha(z)?this.a.Cr(z):this.a.bc(z)}}if(q)return e.Pa();this.AR();0<d&&this.gM(d);return this.a.hf(this.U)};h.prototype.eL=function(e){var d=new a.i,g=new a.i,m=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0],h=new a.Ag,b=e,c=new a.i;e.dd(c);for(var p=0;4>p;p++){var f=!1,l=0!=(p&1),q=0;switch(p){case 0:q=this.Qb.v;f=c.v<=q&&c.B>=q;break;case 1:q=this.Qb.C;f=c.C<=q&&c.G>=q;break;case 2:q=this.Qb.B;f=c.v<=q&&c.B>=q;break;case 3:q=this.Qb.G,f=c.C<=q&&c.G>=q}if(f){f=b;b=e.Pa();f=f.Ca();f.Lk();
for(var n,z=new a.b;f.kb();)for(var t,k=!0;f.La();){var v=f.ia();v.o(d);var A=this.po(d,p,q);if(-1==A){if(A=v.nt(l,q,m,u),0<A){var y=0;n=v.Mb();for(var w=0;w<=A;w++)if(t=w<A?u[w]:1,y!=t){v.Bi(y,t,h);var D=h.get();D.ed(n);w<A&&(l?(z.x=m[w],z.y=q):(z.x=q,z.y=m[w]),D.vd(z));D.o(g);var B=this.po(g,p,q);if(-1==B){n=D.Mb();y=D.oc();if(l)B=Math.abs(n.y-q),F=Math.abs(y.y-q),B<F?(n.y=q,D.ed(n)):(y.y=q,D.vd(y));else{var B=Math.abs(n.x-q),F=Math.abs(y.x-q);B<F?(n.x=q,D.ed(n)):(y.x=q,D.vd(y))}D.o(g);B=this.po(g,
p,q)}n=D.oc();y=t;t=B;1==t?(b.Bc(D,k),k=!1):k=!0}}}else t=A,1==t?(b.Bc(v,k),k=!1):k=!0}}}return b};h.prototype.AR=function(){this.vn=-1;this.Nu(!1,this.Qb.v);this.Nu(!1,this.Qb.B);this.Nu(!0,this.Qb.C);this.Nu(!0,this.Qb.G);this.vg.resize(0);this.vg.xb(100);this.vn=this.a.re();for(var e=new a.b,d=this.a.Vb(this.U);-1!=d;d=this.a.bc(d))for(var g=this.a.Cb(d),m=0,u=this.a.Ha(d);m<u;m++,g=this.a.X(g))if(this.a.w(g,e),this.Qb.v==e.x||this.Qb.B==e.x||this.Qb.C==e.y||this.Qb.G==e.y)this.a.lb(g,this.vn,
this.vg.size),this.vg.add(g);this.zu(!1,this.Qb.v);this.zu(!1,this.Qb.B);this.zu(!0,this.Qb.C);this.zu(!0,this.Qb.G);this.WM()};h.prototype.gM=function(e){for(var d=new a.b,g=new a.b,m=a.I.Lh(2048,0),u=this.a.Vb(this.U);-1!=u;u=this.a.bc(u)){var h=this.a.Cb(u),b=h;do{var c=this.a.X(b);this.a.w(b,d);var p=-1;d.x==this.Qb.v?(this.a.w(c,g),g.x==this.Qb.v&&(p=1)):d.x==this.Qb.B&&(this.a.w(c,g),g.x==this.Qb.B&&(p=1));d.y==this.Qb.C?(this.a.w(c,g),g.y==this.Qb.C&&(p=0)):d.y==this.Qb.G&&(this.a.w(c,g),g.y==
this.Qb.G&&(p=0));if(-1!=p&&(p=a.b.Fb(d,g),p=a.I.truncate(Math.min(Math.ceil(p/e),2048)),!(1>=p))){for(var f=1;f<p;f++)m[f-1]=1*f/p;this.a.Mr(b,m,p-1)}b=c}while(b!=h)}};h.prototype.Nu=function(e,d){var g=this.a.re(),m=new a.b,u=new a.ga(0);u.xb(100);for(var h=this.a.Vb(this.U);-1!=h;h=this.a.bc(h))for(var b=this.a.Cb(h),c=0,p=this.a.Ha(h);c<p;c++){var f=this.a.X(b);this.a.w(b,m);if(e?m.y==d:m.x==d)if(this.a.w(f,m),e?m.y==d:m.x==d)1!=this.a.Ra(b,g)&&(u.add(b),this.a.lb(b,g,1)),1!=this.a.Ra(f,g)&&(u.add(f),
this.a.lb(f,g,1));b=f}this.a.bf(g);if(!(3>u.size)){var l=this;u.xd(0,u.size,function(d,g){return l.kj(d,g)});g=new a.b;h=new a.b;b=new a.b;h.Eh();for(var q=-1,c=new a.ga(0),p=new a.ga(0),f=this.a.re(),n=this.a.re(),z=0,t=u.size;z<t;z++){var k=u.get(z);this.a.w(k,m);if(!m.ub(h)){if(-1!=q){for(var v=q;v<z;v++){var q=u.get(v),A=this.a.X(q),k=this.a.Ua(q),y=!1;0>this.kj(q,A)&&(this.a.w(A,g),e?g.y==d:g.x==d)&&(c.add(q),y=!0,this.a.lb(q,n,1));0>this.kj(q,k)&&(this.a.w(k,g),e?g.y==d:g.x==d)&&(y||c.add(q),
this.a.lb(q,f,1))}v=0;for(y=c.size;v<y;v++){q=c.get(v);k=this.a.Ra(q,f);A=this.a.Ra(q,n);if(1==k){k=this.a.Ua(q);this.a.w(k,b);var w=[0];w[0]=0;if(!b.ub(m)){var D=a.b.Fb(h,b);w[0]=a.b.Fb(b,m)/D;0==w[0]?w[0]=2.220446049250313E-16:1==w[0]&&(w[0]=.9999999999999998);this.a.Mr(k,w,1);k=this.a.Ua(q);this.a.Yi(k,m);p.add(k);this.a.lb(k,f,1);this.a.lb(k,n,-1)}}1==A&&(A=this.a.X(q),this.a.w(A,b),w=[0],w[0]=0,b.ub(m)||(D=a.b.Fb(h,b),w[0]=a.b.Fb(h,m)/D,0==w[0]?w[0]=2.220446049250313E-16:1==w[0]&&(w[0]=.9999999999999998),
this.a.Mr(q,w,1),k=this.a.X(q),this.a.Yi(k,m),p.add(k),this.a.lb(k,f,-1),this.a.lb(k,n,1)))}q=c;c=p;p=q;p.clear(!1)}q=z;h.J(m)}}this.a.bf(f);this.a.bf(n)}};h.prototype.zu=function(e,d){var g=new a.b,m=new a.ga(0);m.xb(100);for(var u=this.a.re(),h=0,b=this.vg.size;h<b;h++){var c=this.vg.get(h);if(-1!=c){var p=this.a.X(c);this.a.w(c,g);if(e?g.y==d:g.x==d)if(this.a.w(p,g),e?g.y==d:g.x==d)-2!=this.a.Ra(c,u)&&(m.add(c),this.a.lb(c,u,-2)),-2!=this.a.Ra(p,u)&&(m.add(p),this.a.lb(p,u,-2))}}if(0!=m.size){var f=
this;m.xd(0,m.size,function(d,g){return f.kj(d,g)});h=0;for(b=m.size;h<b;h++){var l=m.get(h);this.a.lb(l,u,h)}c=new a.b;p=new a.b;p.Eh();for(var q=-1,h=0,b=m.size;h<b;h++)if(l=m.get(h),-1!=l&&(this.a.w(l,g),!g.ub(p))){if(-1!=q)for(;;){for(var l=!1,n=1<h-q?h-1:h,z=q;z<n;z++){var k=m.get(z);if(-1!=k){var t=-1,v=this.a.X(k);0>this.kj(k,v)&&(this.a.w(v,c),e?c.y==d:c.x==d)&&(t=v);var v=-1,A=this.a.Ua(k);0>this.kj(k,A)&&(this.a.w(A,c),e?c.y==d:c.x==d)&&(v=A);if(-1!=t&&-1!=v)this.no(k,m,u),this.a.vf(k,!1),
this.no(t,m,u),this.a.vf(t,!1),l=!0;else if(-1!=t||-1!=v){for(A=z+1;A<h;A++){var w=m.get(A);if(-1!=w){var y=this.a.X(w),D=-1;0>this.kj(w,y)&&(this.a.w(y,c),e?c.y==d:c.x==d)&&(D=y);var y=this.a.Ua(w),B=-1;0>this.kj(w,y)&&(this.a.w(y,c),e?c.y==d:c.x==d)&&(B=y);if(-1!=D&&-1!=B){this.no(w,m,u);this.a.vf(w,!1);this.no(D,m,u);this.a.vf(D,!1);l=!0;break}if(-1!=t&&-1!=B){this.dF(m,k,t,w,B,u);l=!0;break}else if(-1!=v&&-1!=D){this.dF(m,w,D,k,v,u);l=!0;break}}}if(l)break}}}if(!l)break}q=h;p.J(g)}}this.a.bf(u)};
h.prototype.no=function(e,d,g){g=this.a.Ra(e,g);d.set(g,-1);g=this.a.Ra(e,this.vn);this.vg.set(g,-1);d=this.a.rd(e);-1!=d&&this.a.Cb(d)==e&&(this.a.Dh(d,-1),this.a.Wi(d,-1))};h.prototype.dF=function(e,d,g,m,a,h){this.a.Sc(d,m);this.a.Tc(m,d);this.a.Tc(g,a);this.a.Sc(a,g);this.no(m,e,h);this.a.Ui(m,!1);this.no(a,e,h);this.a.Ui(a,!0)};h.prototype.WM=function(){for(var e=0,d=this.vg.size;e<d;e++){var g=this.vg.get(e);-1!=g&&this.a.im(g,-1)}for(var m=0,a=0,h=this.a.Vb(this.U);-1!=h;){var b=this.a.Cb(h);
if(-1==b||h!=this.a.rd(b)){var c=h,h=this.a.bc(h);this.a.Dh(c,-1);this.a.yu(c)}else{g=b;c=0;do this.a.im(g,h),c++,g=this.a.X(g);while(g!=b);2>=c?(g=this.a.Ra(b,this.vn),this.vg.set(g,-1),b=this.a.vf(b,!1),2==c&&(g=this.a.Ra(b,this.vn),this.vg.set(g,-1),this.a.vf(b,!1)),c=h,h=this.a.bc(h),this.a.Dh(c,-1),this.a.yu(c)):(this.a.Jr(h,!1),this.a.Wi(h,this.a.Ua(b)),this.a.hm(h,c),a+=c,m++,h=this.a.bc(h))}}e=0;for(d=this.vg.size;e<d;e++)if(g=this.vg.get(e),-1!=g&&(h=this.a.rd(g),-1==h)){h=this.a.Cf(this.U,
-1);c=0;b=g;do this.a.im(g,h),c++,g=this.a.X(g);while(g!=b);2>=c?(g=this.a.Ra(b,this.vn),this.vg.set(g,-1),b=this.a.vf(b,!1),2==c&&(g=this.a.Ra(b,this.vn),0<=g&&this.vg.set(g,-1),this.a.vf(b,!1)),c=h,this.a.Dh(c,-1),this.a.yu(c)):(this.a.Gn(h,!0),this.a.hm(h,c),this.a.Dh(h,b),this.a.Wi(h,this.a.Ua(b)),this.a.Jr(h,!1),a+=c,m++)}this.a.gm(this.U,m);this.a.Pk(this.U,a);e=0;for(d=this.a.$c;-1!=d;d=this.a.we(d))e+=this.a.F(d);this.a.ZF(e)};h.Xk=function(e,d,g){return(new h(d)).cL(e,g)};h.clip=function(e,
d,g,m){if(e.s())return e;if(d.s())return e.Pa();g=e.D();if(33==g)return m=e.w(),d.contains(m)?e:e.Pa();if(197==g)return m=new a.i,e.o(m),m.Ga(d)?(d=new a.Vj,e.copyTo(d),d.Cu(m),d):e.Pa();var u=new a.i;e.dd(u);if(d.contains(u))return e;if(!d.jc(u))return e.Pa();u=e.pb;if(null!=u&&(u=u.hi,null!=u)){u=u.Dn(d);if(1==u){if(1736!=g)throw a.g.wa();e=new a.Ka(e.description);e.ws(d);return e}if(0==u)return e.Pa()}switch(g){case 550:g=null;for(var u=e.F(),C=e.mc(0),b=0,c=0;c<u;c++)m=new a.b,C.ec(2*c,m),d.contains(m)||
(0==b&&(g=e.Pa()),b<c&&g.Pd(e,b,c),b=c+1);0<b&&g.Pd(e,b,u);return 0==b?e:g;case 1736:case 1607:return h.Xk(e,d,m);default:throw a.g.wa();}};h.prototype.kj=function(e,d){var g=new a.b;this.a.w(e,g);e=new a.b;this.a.w(d,e);return g.compare(e)};return h}();a.Ed=h})(A||(A={}));(function(a){var h=new a.b,b=function(){function d(d,e,u,h,b){this.Ml=new a.b;this.ln=new a.b;this.Ck=new a.b;this.a=d;this.Px=u;this.bn=h;this.Ml=e;this.vk=b;this.ln.Eh();this.Ck.Eh()}d.prototype.sB=function(d){this.a.w(d,this.ln);
d=a.I.truncate((this.ln.x-this.Ml.x)*this.bn+.5);var g=a.I.truncate((this.ln.y-this.Ml.y)*this.bn+.5);return e.XC(d,g)};d.prototype.vw=function(d){return this.a.Ra(d,this.vk)};return d}();a.wT=function(){return function(){}}();var e=function(){function d(){this.Ml=new a.b;this.Zo=[0,0,0,0];this.Kq=[0,0,0,0];this.en=this.vk=-1}d.zM=function(g,e){var m=new d;m.a=g;m.ka=e;m.Px=e*e;m.Kt=2*e;m.bn=1/m.Kt;return m.fL()};d.Vw=function(d,e,a,h,b){d-=a;e-=h;return d*d+e*e<=b};d.XC=function(d,e){return a.I.kg(e,
a.I.kg(d))};d.prototype.hL=function(g,e){this.a.uc(g,h);for(var m=(h.y-this.Ml.y)*this.bn,C=a.I.truncate((h.x-this.Ml.x)*this.bn),b=a.I.truncate(m),c=m=0;1>=c;c+=1)for(var p=0;1>=p;p+=1){var f=d.XC(C+c,b+p),l=this.uk.DN(f);-1!=l&&(this.Zo[m]=l,this.Kq[m]=f,m++)}for(C=m-1;1<=C;C--)for(l=this.Zo[C],b=C-1;0<=b;b--)if(l==this.Zo[b]){this.Kq[b]=-1;m--;C!=m&&(this.Kq[C]=this.Kq[m],this.Zo[C]=this.Zo[m]);break}for(b=0;b<m;b++)this.iL(g,this.Kq[b],h,this.Zo[b],e)};d.prototype.iL=function(g,e,u,h,b){for(var m=
new a.b;-1!=h;h=this.uk.SN(h)){var C=this.uk.da(h);g==C||-1!=e&&this.a.Ra(C,this.vk)!=e||(this.a.uc(C,m),d.Vw(u.x,u.y,m.x,m.y,this.Px)&&b.add(h))}};d.prototype.Tl=function(d,e,a){var g=this.a.Ra(d,this.en),m=this.a.Ra(e,this.en);-1==g&&(g=this.nd.jh(),this.nd.addElement(g,d),this.a.lb(d,this.en,g));-1==m?this.nd.addElement(g,e):this.nd.Qv(g,m);this.a.lb(e,this.en,-2);e=this.aQ(d,e);a&&(a=this.St.sB(d),this.a.lb(d,this.vk,a));return e};d.$P=function(g,e,u){g.lc(e);u=g;var m=new a.b;d.HH(g.w(),e.w(),
m);u.ic(m)};d.HH=function(d,e,a){var g=d.x;d.x!=e.x&&(g=(1*d.x+1*e.x)/2);var m=d.y;d.y!=e.y&&(m=(1*d.y+1*e.y)/2);a.ma(g,m)};d.prototype.aQ=function(d,e){var g=new a.b;this.a.w(d,g);var m=new a.b;this.a.w(e,m);var h=this.a.RC(d);e=this.a.RC(e);var b=h+e,c=0,p=g.x;g.x!=m.x&&(p=(g.x*h+m.x*e)/b,c++);var f=g.y;g.y!=m.y&&(f=(g.y*h+m.y*e)/b,c++);0<c&&this.a.ic(d,p,f);this.a.pS(d,b);return 0!=c};d.prototype.fL=function(){var d=this.a.pd,e=this.a.wC();this.Ml=e.yw();e=Math.max(e.ba(),e.aa())/2147483646;this.Kt<
e&&(this.Kt=e,this.bn=1/this.Kt);this.nd=new a.Ur;this.nd.Dr(a.I.truncate(this.a.pd/3+1));this.nd.$l(a.I.truncate(this.a.pd/3+1));this.vk=this.a.re();this.en=this.a.re();this.St=new b(this.a,this.Ml,this.Px,this.bn,this.vk);this.uk=new a.AH(a.I.truncate(4*d/3),this.St);this.uk.wR(this.a.pd);d=!1;for(e=this.a.$c;-1!=e;e=this.a.we(e))for(var u=this.a.Vb(e);-1!=u;u=this.a.bc(u))for(var h=this.a.Cb(u),c=0,p=this.a.Ha(u);c<p;c++){var f=this.St.sB(h);this.a.lb(h,this.vk,f);this.uk.addElement(h,f);h=this.a.X(h)}var l=
new a.ga(0);l.xb(10);for(e=this.a.$c;-1!=e;e=this.a.we(e))for(u=this.a.Vb(e);-1!=u;u=this.a.bc(u))for(h=this.a.Cb(u),c=0,p=this.a.Ha(u);c<p;c++){if(-2!=this.a.Ra(h,this.en))for(f=this.a.Ra(h,this.vk),this.uk.Jc(h,f);;){this.hL(h,l);if(0==l.size)break;for(var f=!1,q=0,n=l.size;q<n;q++){var z=l.get(q),k=this.uk.da(z);this.uk.kd(z);f=this.Tl(h,k,q+1==n)||f}d=d||f;l.clear(!1);if(!f)break}h=this.a.X(h)}d&&this.ZJ();this.St=this.uk=null;this.a.bf(this.vk);this.a.bf(this.en);return d};d.prototype.ZJ=function(){for(var d=
new a.b,e=this.nd.Wd;-1!=e;e=this.nd.Cw(e)){var u=this.nd.gc(e);this.a.w(this.nd.da(u),d);for(u=this.nd.bb(u);-1!=u;u=this.nd.bb(u))this.a.Yi(this.nd.da(u),d)}};return d}();a.Sr=e})(A||(A={}));(function(a){var h=Math.PI,b=2*Math.PI,e=Math.PI/2,d=function(){function d(){}d.yL=function(g,e){var m=new d;m.x=g;m.y=e;m.type=0;m.mh=0;return m};d.um=function(g){var e=new d;e.x=g.x;e.y=g.y;e.type=0;e.mh=0;return e};d.xL=function(g){var e=new d;e.x=g.x;e.y=g.y;e.type=g.type;e.mh=g.mh;return e};d.Ad=function(g,
e,m){var a=new d;a.x=g.x+e*Math.cos(m);a.y=g.y+e*Math.sin(m);a.type=g.type;a.mh=g.mh;return a};d.Js=function(g,e){var m=new d;m.x=.5*(g.x+e.x);m.y=.5*(g.y+e.y);m.type=g.type;m.mh=g.mh;return m};d.LB=function(g,e){var m=new d;m.x=g.x+.001*(e.x-g.x);m.y=g.y+.001*(e.y-g.y);m.type=g.type;m.mh=g.mh;return m};return d}(),g=function(){return function(){}}();(function(d){d[d.Round=0]="Round";d[d.Bevel=1]="Bevel";d[d.Miter=2]="Miter";d[d.Square=3]="Square"})(a.EH||(a.EH={}));var m=function(){function m(d){this.Kx=
this.Ib=this.dg=null;this.oe=d}m.$=function(d,g,e,u,h,b){if(null==d)throw a.g.N();if(1>d.fb())throw a.g.N();if(0==g||d.s())return d;b=new m(b);b.$m=d;b.Da=g;b.ka=h;b.bi=e;b.Dx=u;return b.hv()};m.prototype.hJ=function(){var d=this.$m,g=d.Mb(),e=d.oc(),m=new a.b;m.pc(e,g);m.normalize();m.tt();m.scale(this.Da);g.add(m);e.add(m);m=d.Pa();d.ed(g);d.vd(e);return m};m.prototype.gJ=function(){var d=this.$m;if(0<this.Da&&2!=this.bi){var g=new a.Ka;g.Wc(d,!1);this.$m=g;return this.hv()}d=new a.Vj(d.R);d.P(this.Da,
this.Da);return d};m.prototype.rF=function(d,g,e,m){return(g.x-d.x)*(m.x-e.x)+(g.y-d.y)*(m.y-e.y)};m.prototype.Ub=function(g,m){if(void 0===m)this.Ib.push(g),this.Xe++;else if(0==this.Xe)this.Ub(g);else{var a=this.eu,u,h;u=this.dg[0==m?a-1:m-1];h=this.dg[m];var C=this.rF(u,h,this.Ib[this.Xe-1],g);0<C?this.Ub(g):0>C&&(0<this.rF(u,h,h,this.Ib[this.Xe-1])?(h=this.dg[0==m?a-2:1==m?a-1:m-2],a=d.Ad(u,this.Da,Math.atan2(u.y-h.y,u.x-h.x)-e),this.Ib[this.Xe-1]=a,1==this.bi||2==this.bi?(a=d.Js(a,u),this.Ub(a),
a=d.Ad(u,this.Da,this.vt+e),u=d.Js(a,u),u.type|=256,this.Ub(u)):(a=d.Ad(u,this.Da,this.vt+e),a.type|=256),this.Ub(a),this.Ub(g,m)):(a=d.Ad(h,this.Da,this.vt+e),this.Ub(a),1==this.bi||2==this.bi?(a=d.Js(a,h),this.Ub(a),a=d.Ad(h,this.Da,this.gx-e),u=d.Js(a,h),u.type|=256,this.Ub(u)):(a=d.Ad(h,this.Da,this.gx-e),a.type|=256),this.Ub(a)))}};m.prototype.mB=function(){var g,m,u,c,p,f,l=this.eu;this.Xe=0;var q=.5*this.ka,n=0,z=0;for(g=0;g<l;g++){c=this.dg[g];p=0==g?this.dg[l-1]:this.dg[g-1];f=g==l-1?this.dg[0]:
this.dg[g+1];var k=p.x-c.x,t=p.y-c.y,v=f.x-c.x,A=f.y-c.y;m=Math.atan2(t,k);u=Math.atan2(A,v);this.vt=m;this.gx=u;0==g&&(n=m,z=u);k=k*A-v*t;t=u;u<m&&(u+=b);if(0<k*this.Da)1==this.bi||2==this.bi?(m=d.Ad(c,this.Da,m+e),this.Ub(m),m=d.LB(c,m),this.Ub(m),m=d.Ad(c,this.Da,u-e),c=d.LB(c,m),c.type|=256,this.Ub(c),this.Ub(m)):(k=.5*(u-m),k=this.Da/Math.abs(Math.sin(k)),m=d.Ad(c,k,.5*(m+u)),this.Ub(m,g));else if(0!=(c.type&512)){k=1-q/Math.abs(this.Da);p=1;f=0>this.Da?-h:h;-1<k&&1>k&&(t=2*Math.acos(k),.017453292519943295>
t&&(t=.017453292519943295),p=a.I.truncate(h/t+1.5),1<p&&(f/=p));t=m+e;m=d.Ad(c,this.Da,t);0==g&&(m.type|=1024);this.Ub(m,g);k=this.Da/Math.cos(f/2);t+=f/2;m=d.Ad(c,k,t);m.type|=1024;for(this.Ub(m);0<--p;)t+=f,m=d.Ad(c,k,t),m.type|=1024,this.Ub(m);m=d.Ad(c,this.Da,u-e);m.type|=1024;this.Ub(m)}else if(1==this.bi)m=d.Ad(c,this.Da,m+e),this.Ub(m,g),m=d.Ad(c,this.Da,u-e),this.Ub(m);else if(0==this.bi)for(k=1-q/Math.abs(this.Da),p=1,f=u-e-(m+e),-1<k&&1>k&&(t=2*Math.acos(k),.017453292519943295>t&&(t=.017453292519943295),
p=a.I.truncate(Math.abs(f)/t+1.5),1<p&&(f/=p)),k=this.Da/Math.cos(.5*f),t=m+e+.5*f,m=d.Ad(c,k,t),this.Ub(m,g);0<--p;)t+=f,m=d.Ad(c,k,t),this.Ub(m);else 2==this.bi?(k=p.x-c.x,t=p.y-c.y,v=f.x-c.x,A=f.y-c.y,p=(k*v+t*A)/Math.sqrt(k*k+t*t)/Math.sqrt(v*v+A*A),.99999999<p?(m=d.Ad(c,1.4142135623730951*this.Da,u-.25*h),this.Ub(m,g),m=d.Ad(c,1.4142135623730951*this.Da,u+.25*h),this.Ub(m)):(p=Math.abs(this.Da/Math.sin(.5*Math.acos(p))),f=Math.abs(this.Dx*this.Da),p>f?(k=.5*(u-m),k=this.Da/Math.abs(Math.sin(k)),
m=d.Ad(c,k,.5*(m+u)),u=a.b.Oa(m.x,m.y),m=a.b.Oa(c.x,c.y),c=new a.b,c.pc(u,m),u=new a.b,u.DR(f/c.length(),c,m),m=(p-f)*Math.abs(this.Da)/Math.sqrt(p*p-this.Da*this.Da),0<this.Da?c.tt():c.Kp(),c.scale(m/c.length()),m=new a.b,m.add(u,c),p=new a.b,p.pc(u,c),m=d.um(m),this.Ub(m,g),m=d.um(p),this.Ub(m)):(k=.5*(u-m),k=this.Da/Math.abs(Math.sin(k)),m=d.Ad(c,k,.5*(m+u)),this.Ub(m,g)))):(u=t,0<this.Da?(u>m&&(u-=b),p=m-u<e):(u<m&&(u+=b),p=u-m<e),p?(k=1.4142135623730951*this.Da,t=0>k?m+.25*h:m+.75*h,m=d.Ad(c,
k,t),this.Ub(m,g),t=0>k?u-.25*h:u-.75*h,m=d.Ad(c,k,t),this.Ub(m)):(k=.5*(u-m),k=this.Da/Math.abs(Math.sin(k)),u<m&&(u+=b),m=d.Ad(c,k,(m+u)/2),this.Ub(m,g)))}this.vt=n;this.gx=z;this.Ub(this.Ib[0],0);c=d.xL(this.Ib[this.Xe-1]);this.Ib[0]=c;return this.sR()};m.prototype.xs=function(d,g){if(!(2>g))for(var e=0;e<g;e++){var m=this.Ib[d+e];0!=e?this.Kx.Lm(a.b.Oa(m.x,m.y)):this.Kx.Nr(a.b.Oa(m.x,m.y))}};m.prototype.iJ=function(g,e,m){var a=g.Ea(e),u=g.Dc(e);this.Ib=[];this.Kx=m;if(g.vc(e)){for(e=g.Fa(a);g.Fa(u-
1).ub(e);)u--;if(2<=u-a){this.eu=u-a;this.dg=[];for(e=a;e<u;e++)this.dg.push(d.um(g.Fa(e)));this.mB()&&this.xs(0,this.Xe-1)}}else{for(e=g.Fa(a);a<u&&g.Fa(a+1).ub(e);)a++;for(e=g.Fa(u-1);a<u&&g.Fa(u-2).ub(e);)u--;if(2<=u-a){this.eu=2*(u-a)-2;this.dg=[];m=d.um(g.Fa(a));m.type|=1536;this.dg.push(m);for(e=a+1;e<u-1;e++)m=d.um(g.Fa(e)),this.dg.push(m);m=d.um(g.Fa(u-1));m.type|=512;this.dg.push(m);for(e=u-2;e>=a+1;e--)m=d.um(g.Fa(e)),m.type|=1024,this.dg.push(m);if(this.mB())if(2<=this.Ib.length){g=-1;
(u=0!=(this.Ib[this.Xe-1].type&1024))||(g=0);for(e=1;e<this.Xe;e++)(a=0!=(this.Ib[e].type&1024))?u||(u=e-1,1<u-g+1&&this.xs(g,u-g+1)):u&&(g=e-1),u=a;u||(u=this.Xe-1,1<u-g+1&&this.xs(g,u-g+1))}else g=0,u=this.Xe-1,0<=g&&1<=u-g&&this.xs(g,u-g+1)}}this.dg=null;this.eu=0;this.Ib=null;this.Xe=0};m.prototype.sR=function(){for(var d=!1,g=0;g<this.Xe;g++){var e=this.Ib[g];e.Rg=g+1;e.Ug=g-1;this.Ib[g]=e}e=this.Ib[0];e.Ug=this.Xe-2;this.Ib[0]=e;e=this.Ib[this.Xe-2];e.Rg=0;this.Ib[this.Xe-2]=e;for(g=e=0;g<this.Xe;g++)if(0!=
(this.Ib[e].type&256)){var m=this.$L(e);if(-1!=m)e=m;else{d=!0;break}}else e=this.Ib[e].Rg;if(d)return!1;this.vL(e);return!0};m.prototype.$L=function(d){for(var g=this.Xe-1,e=d,m,a,u=1;u<=g-2;u++){m=e=this.Ib[e].Rg;a=d;for(var h=1;h<=u;h++){a=this.Ib[a].Ug;if(0==(this.Ib[a].type&256)&&0==(this.Ib[m].type&256)){var C=this.oO(a,m);if(-1!=C)return C}m=this.Ib[m].Ug}}return-1};m.prototype.oO=function(d,e){var m,u,h,C;m=this.Ib[this.Ib[d].Ug];u=this.Ib[d];h=this.Ib[this.Ib[e].Ug];C=this.Ib[e];if(!this.HR(m,
u,h,C))return-1;var b=new g;return this.NM(m,u,h,C,b)&&!b.cB&&a.I.bG((u.x-m.x)*(C.y-h.y)-(u.y-m.y)*(C.x-h.x))!=a.I.bG(this.Da)?(m=this.Ib[d].Ug,b.Xl.type=u.type,b.Xl.Rg=e,b.Xl.Ug=m,this.Ib[d]=b.Xl,b.Xl=this.Ib[e],b.Xl.Ug=d,this.Ib[e]=b.Xl,e):-1};m.prototype.HR=function(d,g,e,m){return Math.max(d.x,g.x)>=Math.min(e.x,m.x)&&Math.max(e.x,m.x)>=Math.min(d.x,g.x)&&Math.max(d.y,g.y)>=Math.min(e.y,m.y)&&Math.max(e.y,m.y)>=Math.min(d.y,g.y)};m.prototype.NM=function(g,e,m,a,u){u.cB=!1;var h,C,b;h=(e.y-g.y)*
(a.x-m.x)-(e.x-g.x)*(a.y-m.y);C=(m.y-g.y)*(e.x-g.x)-(m.x-g.x)*(e.y-g.y);h=0==h?2:C/h;return 0<=h&&1>=h&&(b=h,h=(a.y-m.y)*(e.x-g.x)-(a.x-m.x)*(e.y-g.y),C=(g.y-m.y)*(a.x-m.x)-(g.x-m.x)*(a.y-m.y),h=0==h?2:C/h,0<=h&&1>=h)?(u.Xl=d.yL(g.x+h*(e.x-g.x),g.y+h*(e.y-g.y)),u.Xl.mh=m.mh+b*(a.mh-m.mh),0!=b&&1!=b||0!=h&&1!=h||(u.cB=!0),u.wU=h,u.xU=b,(0==b||1==b)&&0<h&&1>h||(0==h||1==h)&&0<b&&1>b?!1:!0):!1};m.prototype.vL=function(d){for(;this.Ib[d].Ug<d;)d=this.Ib[d].Ug;var g=0,e=d;do e=this.Ib[e],this.Ib[g]=e,
e=e.Rg,g++;while(e!=d);this.Ib[g]=this.Ib[0];this.Xe=g+1};m.prototype.qA=function(d){var g=this.$m,e=g.Ca();if(null!=e){e.Lk();for(var m=-1;e.kb();)m++,this.iJ(g,m,d)}};m.prototype.hv=function(){var d=this.$m.D();return 322==d?this.hJ():197==d?this.gJ():a.T.Lc(d)?(d=new a.Xa,d.Bc(this.$m,!0),this.$m=d,this.hv()):1607==d?(d=new a.Xa,this.qA(d),d):1736==d?(d=new a.Ka,this.qA(d),d):null};return m}();a.XG=m})(A||(A={}));(function(a){var h=function(){function d(d){this.xj=d}d.prototype.w=function(d,g){this.xj.a.w(d,
g)};d.prototype.kd=function(d){var g=this.xj.za.da(d);this.xj.za.kd(d,-1);this.xj.a.vf(g,!1)};return d}(),b=function(){function d(d){this.xj=d}d.prototype.w=function(d,g){this.xj.NP.w(d,g)};d.prototype.kd=function(d){this.xj.za.kd(d,-1)};return d}(),e=function(){function d(d){this.xj=d}d.prototype.w=function(d,g){g.J(this.xj.PP[d])};d.prototype.kd=function(d){this.xj.za.kd(d,-1)};return d}(),d=function(){function d(d){void 0===d?(this.za=new a.bj,this.za.de(20),this.a=new a.fd,this.FP=this.a.jg(550),
this.cr=this.a.Cf(this.FP,-1),this.oh=new h(this)):d instanceof Array?(this.za=new a.bj,this.za.de(20),this.PP=d,this.oh=new e(this)):(this.za=new a.bj,this.za.de(20),this.NP=d,this.oh=new b(this))}d.prototype.Eb=function(d){var g=d.D();if(a.Wr.Th(g))this.OJ(d);else if(a.al.Lc(g))this.SJ(d);else if(197==g)this.LJ(d);else if(33==g)this.RJ(d);else throw a.g.N("invalid shape type");};d.prototype.sN=function(){var d=new a.Va,g=this.za.gc(-1),e=new a.Ka(this.a.wp);this.a.Jk(this.za.da(g),d);e.df(d);for(g=
this.za.bb(g);-1!=g;g=this.za.bb(g))this.a.Jk(this.za.da(g),d),e.lineTo(d);return e};d.wL=function(g){var e=new d(g),m=g.F(),h=1,b=new a.b,c=new a.b,p=new a.b;for(g.w(0,b);;){g.w(h,c);if(!(c.Ww(b)&&h<m-1))break;h++}e.za.addElement(0,-1);e.za.qm(h);for(m=h+1;m<g.F();m++)g.w(m,p),h=e.cz(p),-1!=h&&e.za.Vi(h,m);p=new a.Va;h=e.za.gc(-1);m=new a.Ka(g.description);g.Sd(e.za.da(h),p);m.df(p);for(h=e.za.bb(h);-1!=h;h=e.za.bb(h))g.Sd(e.za.da(h),p),m.lineTo(p);return m};d.Oa=function(g,e,a){for(var m=new d(g),
u=1,h=g[0];g[u].Ww(h)&&u<e-1;)u++;m.za.addElement(0,-1);m.za.qm(u);for(u+=1;u<e;u++)h=m.cz(g[u]),-1!=h&&m.za.Vi(h,u);g=0;for(e=m.za.gc(-1);-1!=e;e=m.za.bb(e))a[g++]=m.za.da(e);return g};d.sD=function(g,e){var m=g.Ea(e),u=g.Dc(e);e=!g.vc(e)&&g.Oo(e);g=g.mc(0);m*=2;u*=2;e&&(u-=2);if(6>u-m)return!0;e=new a.b;var h=new a.b,b=new a.b;g.ec(m,e);g.ec(m+2,h);g.ec(m+4,b);var c=d.Bd(h,b,e);if(c.Dq()||!d.ac(c.value()))return!1;for(var p=a.b.Oa(h.x,h.y),f=new a.b,m=m+6;m<u;m+=2){f.J(h);h.J(b);g.ec(m,b);c=d.Bd(h,
b,e);if(c.Dq()||!d.ac(c.value()))return!1;c=d.Bd(p,b,e);if(c.Dq()||!d.ac(c.value()))return!1;c=d.Bd(h,b,f);if(c.Dq()||!d.ac(c.value()))return!1}return!0};d.prototype.OJ=function(d){for(var g=new a.Va,e=new a.b,m=0;m<d.F();m++){d.w(m,e);var h=this.hq(e);if(-1!=h){d.Sd(m,g);var b=this.a.Ub(this.cr,g);this.za.Vi(h,b)}}};d.prototype.LJ=function(d){for(var g=new a.Va,e=new a.b,m=0;4>m;m++){d.vu(m,e);var h=this.hq(e);if(-1!=h){d.uf(m,g);var b=this.a.Ub(this.cr,g);this.za.Vi(h,b)}}};d.prototype.SJ=function(d){var g=
new a.Va,e=d.Mb(),e=this.hq(e);if(-1!=e){d.En(g);var m=this.a.Ub(this.cr,g);this.za.Vi(e,m)}e=d.oc();e=this.hq(e);-1!=e&&(d.Bn(g),d=this.a.Ub(this.cr,g),this.za.Vi(e,d))};d.prototype.RJ=function(d){var g=d.w(),g=this.hq(g);-1!=g&&(d=this.a.Ub(this.cr,d),this.za.Vi(g,d))};d.prototype.hq=function(d){var g=-1;if(0==this.za.size(-1))return g=this.za.addElement(-4,-1);if(1==this.za.size(-1)){var e=this.a.Fa(this.za.da(this.za.gc(-1)));d.Ww(e)||(g=this.za.qm(-5));return g}return g=this.cz(d)};d.prototype.cz=
function(g){var e=-1,m=this.za.gc(-1),h=this.za.tc(-1),b=this.za.da(m),c=this.za.da(h),p=new a.b,f=new a.b;this.oh.w(b,p);this.oh.w(c,f);b=a.b.yn(f,g,p);if(d.ac(b))e=this.za.qm(-1),p=this.az(g,h,m),p!=m&&this.bz(g,m,this.za.ge(p));else if(d.ti(b)){for(var f=this.za.dt(-1),l=this.za.gc(-1),q=this.za.tc(-1),n,b=new a.b,c=new a.b;l!=this.za.ge(q);)n=this.za.da(f),this.oh.w(n,b),n=a.b.yn(b,g,p),d.ti(n)?(q=f,f=this.za.ik(f)):(l=f,f=this.za.Jo(f));f=q;p=l;n=this.za.da(f);l=this.za.da(p);this.oh.w(n,b);
this.oh.w(l,c);if(p==m||(b=a.b.yn(c,g,b),d.ac(b)))e=this.za.vs(p,f,-2,!1),this.bz(g,f,h),this.az(g,p,m)}else null==this.ib&&(this.ib=new a.yb),this.ib.ed(f),this.ib.vd(p),p=this.ib.Gd(g,!0),0>p?(p=this.za.ge(h),this.za.kd(h,-1),e=this.za.qm(-3),this.az(g,p,m)):1<p&&(p=this.za.bb(m),this.za.kd(m,-1),e=this.za.vs(-1,p,-3,!1),this.bz(g,p,h));return e};d.prototype.bz=function(g,e,h){if(e!=h){var m=this.za.da(e),u=this.za.bb(e),b=new a.b,C=new a.b;for(this.oh.w(m,b);e!=h&&2<this.za.size(-1);){this.oh.w(this.za.da(u),
C);m=a.b.yn(C,g,b);if(d.ac(m))break;m=e;e=u;b.J(C);u=this.za.bb(e);this.oh.kd(m)}}};d.prototype.az=function(g,e,h){if(e==h)return h;var m=this.za.da(e),u=this.za.ge(e),b=new a.b,C=new a.b;for(this.oh.w(m,b);e!=h&&2<this.za.size(-1);){this.oh.w(this.za.da(u),C);m=a.b.yn(b,g,C);if(d.ac(m))break;m=e;e=u;b.J(C);u=this.za.ge(e);this.oh.kd(m)}return e};d.Bd=function(d,g,e){var m=new a.$k;m.set(g.x);m.sub(d.x);var u=new a.$k;u.set(e.y);u.sub(d.y);var h=new a.$k;h.set(g.y);h.sub(d.y);g=new a.$k;g.set(e.x);
g.sub(d.x);m.Ap(u);h.Ap(g);m.sub(h);return m};d.ac=function(d){return 0>d};d.ti=function(d){return 0<d};d.ao=function(d){return 0==d};return d}();a.Tr=d})(A||(A={}));(function(a){var h=function(){function h(e){this.oe=this.a=null;this.WD=!0;this.oe=e}h.HE=function(e,d,g){e=a.Ia.As(e);return a.Sr.Vw(d.lk(),d.mk(),g.lk(),g.mk(),a.vi.Ty(e))};h.gL=function(e,d){var g=new a.Va;a.Sr.$P(e,d,g);return g};h.$=function(e,d,g,m){g=new h(g);g.a=e;g.ka=d;g.WD=m;return g.rJ()};h.prototype.lJ=function(e){return a.Sr.zM(this.a,
e)};h.prototype.oJ=function(e){return a.Zu.$(this.a,e,this.oe)};h.prototype.rJ=function(){for(var e=this.ka,d=a.Ia.As(e),e=a.Ia.UJ(e),g=1.00001*e,e=1.000001*e,m=!1,u=30<this.a.pd+10?1E3:(this.a.pd+10)*(this.a.pd+10),h=0,b=this.a.pO();;h++){if(h>u)throw a.g.ra("Internal Error: max number of iterations exceeded");var c=this.lJ(d),m=m||c;this.WD&&(c=0!=this.a.xo(d,!0,!1),m=m||c);c=!1;if(0==h||b||a.Zu.DE(!0,this.a,e,null,this.oe))c=this.oJ(g),m=m||c;if(!c)break}return m};return h}();a.aj=h})(A||(A={}));
(function(a){var h=function(){function h(e){this.Ld=this.zc=null;this.Yb=e;this.hx=!0}h.prototype.et=function(e,d){var g=this.a.cc(e);if(null==g){if(!this.a.Oc(e,d))return null;g=d}return g};h.prototype.LL=function(){var e=this.a.Gp(!1),d=!1,g=new a.yb,m=new a.yb,u=new a.i;u.Ja();var h=new a.i;h.Ja();for(var b=new a.Va,c=new a.gA,p=e.next();-1!=p;p=e.next()){var f=null,l=!1;if(!a.T.Km(this.a.Lb(e.mj))){f=this.et(p,g);if(null==f)continue;f.o(u);u.P(this.ka,this.ka);if(f.mg(this.ka))if(f.mg(0))l=!0,
f=null;else continue}var q=this.a.Gp(e),n=q.next();for(-1!=n&&(n=q.next());-1!=n;n=q.next()){var z=null,k=!1;if(!a.T.Km(this.a.Lb(q.mj))){z=this.et(n,m);if(null==z)continue;z.o(h);if(z.mg(this.ka))if(z.mg(0))k=!0,z=null;else continue}var t=0,v=0;if(null!=f&&null!=z)u.rD(h)&&(c.zn(f),c.zn(z),c.Ga(this.ka,!1),t=c.kk(0),v=c.kk(1),0<t+v&&(this.a.Tp(p,c,0,!0),this.a.Tp(n,c,1,!0)),c.clear());else if(null!=f){var A=new a.b;this.a.w(n,A);if(u.contains(A)){c.zn(f);this.a.Jk(n,b);c.Tw(this.ka,b,!1);t=c.kk(0);
if(0<t)if(this.a.Tp(p,c,0,!0),k){k=-1;for(A=this.a.X(n);-1!=A&&A!=n&&(z=this.et(A,m),k=A,null!=z&&z.mg(0));A=this.a.X(A));for(A=n;-1!=A&&(this.a.bh(A,c.nf),A!=k);A=this.a.X(A));}else this.a.bh(n,c.nf);c.clear()}}else if(null!=z){if(A=new a.b,this.a.w(p,A),h.P(this.ka,this.ka),h.contains(A)){c.zn(z);this.a.Jk(p,b);c.Tw(this.ka,b,!1);v=c.kk(0);if(0<v)if(this.a.Tp(n,c,0,!0),l){k=-1;for(A=this.a.X(p);-1!=A&&A!=p&&(z=this.et(A,m),k=A,null!=z&&z.mg(0));A=this.a.X(A));for(A=p;-1!=A&&(this.a.bh(A,c.nf),A!=
k);A=this.a.X(A));}else this.a.bh(p,c.nf);c.clear()}}else continue;if(0!=t+v){if(0!=t){f=this.a.cc(p);if(null==f){if(!this.a.Oc(p,g))continue;f=g;g.o(u)}else f.o(u);if(f.mg(this.ka))break}d=!0}}}return d};h.prototype.ML=function(){return this.HQ()};h.prototype.HQ=function(){return(new a.aA).GS(this.a,this.ka)};h.prototype.EE=function(){var e=!1,d,g;null==this.zc&&(this.zc=new a.bj);var m=new a.ga(0);m.xb(this.a.pd+1);for(var u=this.a.Gp(),h=u.next();-1!=h;h=u.next())m.add(h);this.a.Mu(m,m.size);m.add(-1);
u=this.a.re();h=this.a.re();this.Ld=new a.hA(this.a,this.ka,!this.hx);this.zc.Hn(this.Ld);var b=new a.ga(0),c=new a.ga(0),p=0;new a.b;var f=this.a.cd;this.a.wb.kc();for(var l=this.a.wb.Ba[0].f,q,n,z=m.get(p++);-1!=z;){n=f.O(z,0);q=l[2*n];n=l[2*n+1];var k=q,t=n;do{var A=f.O(z,2),v=f.O(z,1);-1!=A&&(d=f.O(A,0),g=l[2*d],d=l[2*d+1],0>(t<d?-1:t>d?1:k<g?-1:k>g?1:0)&&(c.add(z),c.add(A)));-1!=v&&(d=f.O(v,0),g=l[2*d],d=l[2*d+1],0>(t<d?-1:t>d?1:k<g?-1:k>g?1:0)&&(c.add(v),c.add(v)));g=this.a.Ra(z,u);-1!=g&&(b.add(g),
this.a.lb(z,u,-1));g=this.a.Ra(z,h);-1!=g&&(b.add(g),this.a.lb(z,h,-1));z=m.get(p++);-1!==z&&(t=f.O(z,0),k=l[2*t],t=l[2*t+1])}while(-1!=z&&k===q&&t===n);k=1==b.size&&2==c.size;g=t=-1;A=0;for(v=b.size;A<v;A++){d=b.get(A);var w=this.zc.ge(d);-1==w||b.Nw(w)||(t=w);d=this.zc.bb(d);-1==d||b.Nw(d)||(g=d);if(-1!=t&&-1!=g)break}this.Ld.XF(n,q);A=0;for(v=b.size;A<v;A++)d=b.get(A),this.zc.kd(d,-1);b.clear(!1);if(!k&&-1!=t&&-1!=g&&this.SK(t,g)){e=!0;this.ei=this.Ld.rl();break}A=0;for(v=c.size;A<v;A+=2){n=c.get(A);
q=c.get(A+1);k?(n=this.zc.vs(t,g,n,!0),k=!1):n=this.zc.addElement(n,-1);if(this.Ld.Zf){this.ei=this.Ld.rl();e=!0;break}-1==this.a.Ra(q,u)?this.a.lb(q,u,n):this.a.lb(q,h,n)}if(e)break;c.cf(0)}this.a.bf(u);this.a.bf(h);return e};h.prototype.SK=function(e,d){this.Ld.compare(this.zc,this.zc.da(e),d);e=this.Ld.Zf;this.Ld.lq();return e};h.Gh=function(e){for(var d=e.$c;-1!=d;d=e.we(d))if(a.T.Kc(e.Lb(d)))return!0;return!1};h.Yk=function(e,d,g,m){if(!h.Gh(e))return!1;d=new h(m);d.a=e;d.ka=g;if(15>e.pd)e=d.LL();
else return d.ML();return e};h.$=function(e,d,g){return h.Yk(e,e.wC(),d,g)};h.DE=function(e,d,g,m,u){if(!h.Gh(d))return!1;var b=new h(u);b.a=d;b.ka=g;b.hx=e;if(b.EE())return null!=m&&m.aq(b.ei),!0;var c=new a.Bg;c.Oy();d.Oe(c);b=new h(u);b.a=d;b.ka=g;b.hx=e;e=b.EE();c.Oy();d.Oe(c);return e?(null!=m&&m.aq(b.ei),!0):!1};return h}();a.Zu=h})(A||(A={}));(function(a){(function(d){d[d.Left=0]="Left";d[d.Right=1]="Right";d[d.Coincident=2]="Coincident";d[d.Undefined=3]="Undefined";d[d.Uncut=4]="Uncut"})(a.ZG||
(a.ZG={}));var h=function(){return function(d,e,a,h,b,c,p,f,l,q,n){this.U=d;this.cu=e;this.Yq=a;this.ag=h;this.Il=q;this.xk=n}}();a.yT=h;var b=function(){function d(d,g){this.jE=d;this.Zh=g}d.prototype.nJ=function(d,g){var e=new a.b;this.Zh.w(d,e);var m=new a.b;this.Zh.w(g,m);e=e.compare(m);if(0!=e)return e;e=this.Zh.Ra(d,this.jE);m=this.Zh.Ra(g,this.jE);return e<m?-1:e==m?0:1};return d}(),e=function(){return function(d,e,a,h,b,c,p,f,l){this.ag=d;this.Yq=e;this.Lx=a;this.sE=h;this.Wh=b;this.xk=c;
this.Il=p;this.tE=f;this.RP=l}}();a.xT=e;var d=function(){function d(){}d.YG=function(g,e,b,c,p,f){if(e.s())g=new h(e,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1,NaN,-1,-1,NaN),p.push(g);else{var m=new a.fd;m.Eb(e);m.Eb(b);a.aj.$(m,c,f,!0);e=0;b=m.re();for(c=m.$c;-1!=c;c=m.we(c))for(f=m.Vb(c);-1!=f;f=m.bc(f))for(var u=m.Cb(f),C=0,l=m.Ha(f);C<l;u=m.X(u),C++)m.lb(u,b,e++);e=d.qM(b,m);d.CI(g,e,m,p)}};d.qM=function(g,e){for(var m=e.pd,u=new a.ga(0),h=e.$c;-1!=h;h=e.we(h))for(var c=e.Vb(h);-1!=c;c=e.bc(c))for(var p=
e.Cb(c),f=0,l=e.Ha(c);f<l;p=e.X(p),f++)u.add(p);var q=new b(g,e);u.xd(0,m,function(d,g){return q.nJ(d,g)});g=[];var n=[],z=e.re(),k=e.re(),h=e.$c,c=e.we(h),l=new a.b,t=new a.b,A=u.get(0),v=e.rd(A),w=e.Vf(v);e.w(A,l);for(var y=1,p=0;y<m-1;){for(var D=!1,f=y;f<m;f++)if(f!=p){var B=u.get(f),F=e.rd(B),Q=e.Vf(F);e.w(B,t);if(l.ub(t))w==h&&Q==c&&(D=d.SI(z,k,e,g,n,v,A,F,B));else break}if(D||p==y-1){D&&p==y-1&&y--;if(++p==m)break;A=u.get(p);v=e.rd(A);w=e.Vf(v);e.w(A,l)}D||(y=p+1)}m=[];for(h=e.$c;-1!=h;h=e.we(h))for(c=
e.Vb(h);-1!=c;c=e.bc(c))for(u=e.Cb(c),f=0,l=e.Ha(c);f<l;u=e.X(u),f++){p=e.Ra(u,k);if(0<=p)for(;p<n.length&&n[p].ag==u;)m.push(n[p++]);p=e.Ra(u,z);if(0<=p)for(;p<g.length&&g[p].ag==u;)m.push(g[p++])}e.bf(z);e.bf(k);return m};d.SI=function(g,e,a,h,b,c,p,f,l){var m=a.hk(c),u=a.hk(f),C=a.Cb(c),M=a.Cb(f),q=a.Ua(p),n=a.Ua(l),z=!1,k=!1,t=!1,A=!1;p!=C&&(l!=M&&(z=d.VI(g,a,h,c,q,f,n)),l!=u&&(k=d.YI(g,a,h,c,q,f,l)));p!=m&&(l!=M&&(t=d.aJ(e,a,b,c,p,f,n,C)),l!=u&&(A=d.dJ(e,a,b,c,p,f,l,C)));z&&k&&t?(g=h.length-
1,2==b[A?b.length-2:b.length-1].Wh&&(h[g-1]=h[g],--h.length)):z&&k&&A&&2==b[b.length-1].Wh&&(b=h[h.length-1],--h.length,a.Ra(b.ag,g)==h.length&&a.lb(b.ag,g,-1));return z||k||t||A};d.VI=function(d,g,h,b,c,p,f){var m,u;u=new a.yb;var C=new a.yb,l=[0,0],M=[0,0];m=g.cc(c);null==m&&(g.Oc(c,u),m=u);u=g.cc(f);null==u&&(g.Oc(f,C),u=C);m=m.Ga(u,null,l,M,0);2>m&&(b=new e(c,b,l[0],NaN,m,f,p,M[0],NaN),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1));return!0};d.YI=function(d,g,h,b,c,p,f){var m,u;u=new a.yb;var C=
new a.yb,l=[0,0],M=[0,0];m=g.cc(c);null==m&&(g.Oc(c,u),m=u);u=g.cc(f);null==u&&(g.Oc(f,C),u=C);m=m.Ga(u,null,l,M,0);return 2>m?(b=new e(c,b,l[0],NaN,m,f,p,M[0],NaN),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1),!0):!1};d.aJ=function(d,g,h,b,c,p,f,l){var m,u;u=new a.yb;var C=new a.yb,M=[0,0],q=[0,0];m=g.cc(c);null==m&&(g.Oc(c,u),m=u);u=g.cc(f);null==u&&(g.Oc(f,C),u=C);m=m.Ga(u,null,M,q,0);if(2==m)return b=new e(c,b,M[0],M[1],m,f,p,q[0],q[1]),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1),!0;C=!1;
c==l&&(b=new e(c,b,M[0],NaN,m,f,p,q[0],NaN),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1),C=!0);return C};d.dJ=function(d,g,h,b,c,p,f,l){var m,u;u=new a.yb;var C=new a.yb,M=[0,0],q=[0,0];m=g.cc(c);null==m&&(g.Oc(c,u),m=u);u=g.cc(f);null==u&&(g.Oc(f,C),u=C);m=m.Ga(u,null,M,q,0);if(2==m)return b=new e(c,b,M[0],M[1],m,f,p,q[0],q[1]),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1),!0;C=!1;c==l&&(b=new e(c,b,M[0],NaN,m,f,p,q[0],NaN),h.push(b),b=g.Ra(c,d),0>b&&g.lb(c,d,h.length-1),C=!0);return C};d.CI=
function(g,e,b,c){var m,u=[];u[0]=new a.b;u[1]=new a.b;u[2]=new a.b;u[3]=new a.b;var C=new a.b,p=new a.b,f=new a.b,l=new a.b,M=null;null!=c&&(M=new a.Ag,M.mq());var q,n=0,z=null,k=new a.yb;new a.yb;for(var t=b.Vb(b.$c);-1!=t;t=b.bc(t)){var A,v=4,w=-1,y,D,B,F=-1,Q,J,G,I,r=-1,K=-1,L=NaN;A=!0;var ca=!1,O=!0,P=!0,U=!0,N=0;B=t;Q=0;for(var V=b.Cb(t),T=b.Ha(t),R=0;R<T;V=b.X(V),R++){q=b.cc(V);if(null==q){if(!b.Oc(V,k))continue;q=k}-1==F&&(F=V);for(var x=0;n<e.length&&V==e[n].ag;){w=e[n].Yq;y=e[n].ag;D=e[n].Lx;
J=e[n].Il;G=e[n].xk;I=e[n].tE;if(2==e[n].Wh){if(ca||(B=w,F=y,Q=D,r=J,K=G,L=I,v=2,null!=c?z=new a.Xa:N=0,U=!1,P=!0),D=e[n].sE,I=e[n].RP,null!=c?(q.Bi(x,e[n].sE,M),z.Bc(M.get(),P)):N++,x=D,ca=!0,P=A=!1,n+1==e.length||2!=e[n+1].Wh||e[n+1].ag==y&&e[n+1].Lx!=x)null!=c?(m=new h(z,2,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N),B=w,F=y,Q=D,r=J,K=G,L=I,v=2,ca=A=!1,P=U=!0}else{var S=b.X(y);if(n<e.length-1&&e[n+1].ag==S&&e[n+1].xk==G&&2==e[n+1].Wh)D!=x&&(U&&(null!=c?z=new a.Xa:N=0),A=0<n&&e[n-1].Yq==w?
1==v?0:0==v?1:3:3,null!=c?(q.Bi(x,D,M),z.Bc(M.get(),P),m=new h(z,A,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):(N++,null.add(N)),x=D,B=w,F=y,Q=D,r=J,K=G,L=I,v=A,A=O=!1,P=U=!0);else if(!d.KK(g,b,e,n,C,p)){d.KG(b,e,n,t,V,f,l);var ka=!1,S=!1;m=!0;if(!(C.ub(f)||p.ub(f)||C.ub(l)||p.ub(l))){u[0].J(C);u[1].J(p);u[2].J(f);u[3].J(l);u.sort(a.b.cq);var Ka=u[0],La=u[1],Ha=u[2],Va=u[3];Ka.ub(C)?La.ub(p)?g?(S=ka=!0,m=!1):ka=!1:Va.ub(p)?g?m=S=ka=!0:ka=!1:(ka=!0,m=La.ub(f)):La.ub(C)?Ha.ub(p)?g?(S=ka=!0,m=!1):ka=!1:Ka.ub(p)?
g?m=S=ka=!0:ka=!1:(ka=!0,m=Ha.ub(f)):Ha.ub(C)?Va.ub(p)?g?(S=ka=!0,m=!1):ka=!1:La.ub(p)?g?m=S=ka=!0:ka=!1:(ka=!0,m=Va.ub(f)):Ka.ub(p)?g?(S=ka=!0,m=!1):ka=!1:Ha.ub(p)?g?m=S=ka=!0:ka=!1:(ka=!0,m=Ka.ub(f))}if(ka){ka=V==y;if(D!=x||ka&&0==x)U&&(null!=c?z=new a.Xa:N=0),null!=c?(q.Bi(x,D,M),z.Bc(M.get(),P)):N++;if(m)if(1!=v){if(D!=x||ka&&0==x)null!=c?(m=new h(z,1,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N);if(!S)v=1;else if(n==e.length-2||e[n+2].Yq!=w)v=0}else{if(D!=x||ka&&0==x)null!=c?(m=new h(z,3,
w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N);v=1}else if(0!=v){if(D!=x||ka&&0==x)null!=c?(m=new h(z,0,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N);if(!S)v=0;else if(n==e.length-2||e[n+2].Yq!=w)v=1}else{if(D!=x||ka&&0==x)null!=c?(m=new h(z,3,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N);v=0}if(D!=x||ka&&0==x)x=D,B=w,F=y,Q=D,r=J,K=G,L=I,A=O=!1,P=U=!0}}}n++}1!=x&&(U&&(null!=c?z=new a.Xa:N=0),null!=c?(q.Bi(x,1,M),z.Bc(M.get(),P)):N++,P=U=!1,O=!0)}O&&(D=1,y=b.hk(t),y=b.Ua(y),G=J=-1,I=NaN,
A?null!=c?(m=new h(z,4,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N):(A=1==v?0:0==v?1:3,null!=c?(m=new h(z,A,w,y,D,v,B,F,Q,J,G,I,r,K,L),c.push(m)):null.add(N)))}};d.KK=function(g,e,h,b,c,p){var m=h[b].tE;if(1==m)return d.GJ(g,e,h,b,c,p);if(0==m)return d.dK(g,e,h,b,c,p);throw a.g.wa();};d.GJ=function(d,g,e,h,b,c){var m=new a.yb,u=e[h].ag,C=e[h].Il,p=e[h].xk,f=-1,l=-1,M=-1,q=-1;if(!d&&0<h)var n=e[h-1],f=n.ag,l=n.Il,M=n.xk,q=n.Wh;var z=-1,k=-1,t=-1,A=-1;h<e.length-1&&(n=e[h+1],z=n.ag,k=n.Il,t=n.xk,
A=n.Wh);var v=g.X(u),n=g.X(p);if(!d)return 0<h&&f==u&&l==C&&M==n&&2==q||h<e.length-1&&z==v&&k==C&&t==n&&2==A?(d=g.cc(p),null==d&&(g.Oc(p,m),d=m),c.J(d.Pf(1)),b.qr(c),c.normalize(),b.normalize(),!1):h<e.length-1&&z==u&&k==C&&t==n?(d=g.cc(p),null==d&&(g.Oc(p,m),d=m),b.J(d.Pf(1)),d=g.cc(n),null==d&&(g.Oc(n,m),d=m),c.J(d.Pf(0)),b.Bp(),c.normalize(),b.normalize(),!1):!0;if(h==e.length-1||z!=u||k!=C||t!=n||2==A)return d=g.cc(p),null==d&&(g.Oc(p,m),d=m),c.J(d.Pf(1)),b.qr(c),c.normalize(),b.normalize(),!1;
d=g.cc(p);null==d&&(g.Oc(p,m),d=m);b.J(d.Pf(1));d=g.cc(n);null==d&&(g.Oc(n,m),d=m);c.J(d.Pf(0));b.Bp();c.normalize();b.normalize();return!1};d.dK=function(d,g,e,h,b,c){var m=new a.yb,u=e[h].ag,C=e[h].Il,p=e[h].xk,f=-1,l=-1,q=-1,M=-1;if(!d&&h<e.length-1)var n=e[h+1],f=n.ag,l=n.Il,q=n.xk,M=n.Wh;var z=-1,k=-1,t=-1,n=-1;0<h&&(n=e[h-1],z=n.ag,k=n.Il,t=n.xk,n=n.Wh);var A=g.X(u),v=g.Ua(p);return d?0==h||z!=u||k!=C||t!=v||2==n?(d=g.cc(p),null==d&&(g.Oc(p,m),d=m),c.J(d.Pf(0)),b.qr(c),c.normalize(),b.normalize(),
!1):!0:0<h&&z==u&&k==C&&t==v&&2==n||h<e.length-1&&f==A&&l==C&&q==v&&2==M?(d=g.cc(p),null==d&&(g.Oc(p,m),d=m),c.J(d.Pf(0)),b.qr(c),c.normalize(),b.normalize(),!1):!0};d.KG=function(d,g,e,h,b,c,p){var m=new a.yb,u=d.cc(b);null==u&&(d.Oc(b,m),u=m);e=g[e];g=e.ag;e=e.Lx;b=d.X(g);if(1==e)c.J(u.Pf(1)),-1!=b&&b!=d.hk(h)?(u=d.cc(b),null==u&&(d.Oc(b,m),u=m),p.J(u.Pf(0)),u=d.cc(g),null==u&&d.Oc(g,m)):p.J(c),c.Bp(),p.normalize(),c.normalize();else if(0==e)p.J(u.Pf(e)),c.qr(p),p.normalize(),c.normalize();else throw a.g.wa();
};return d}();a.$G=d})(A||(A={}));(function(a){(function(d){d[d.Linear=0]="Linear";d[d.Angular=1]="Angular";d[d.Area=2]="Area"})(a.RI||(a.RI={}));var h=function(){function d(d,g,e){this.Nc=g;this.Dj=e;this.wx=d}d.PC=function(g){return 0!==g.Nc?null:-1===g.wx?new d(-1,2,g.Dj*g.Dj):d.Qd(m[g.wx])};d.Qd=function(d){d=g[d];return void 0===d?null:d};d.EL=function(g,e,m){var a=null;if(void 0!==m&&null!==m)try{"EPSG"===m.values[0]&&(a=d.Qd(parseInt(m.values[1])))}catch(fa){}null===a&&(a=new d(-1,g,e));return a};
d.prototype.Qc=function(){return this.wx};d.prototype.rC=function(d){if(d.Nc!=this.Nc)throw a.g.xa();return this.Dj/d.Dj};d.ih=function(d,g,e){return g.rC(e)*d};d.OB=function(d,g,e,m,a){e=e.rC(m);for(m=0;m<g;m++)a[m]=d[m]*e};return d}();a.Tb=h;for(var b=[109402,4046.8564224,109403,4046.87260987425,109463,100,109401,1E4,109461,225E8,109460,25E8,109451,1E-4,109444,404.68564224000005,109424,404.6849341289498,109428,404.68493792602754,109416,404.67838076760535,109420,404.68423895571647,109448,404.683871963536,
109411,404.6872609874253,109450,.01,109408,3.34450944,109405,.09290304,109430,.09290354800069446,109423,.0929028774400711,109427,.09290287831176021,109441,.09290349665192114,109407,.09290137299531805,109440,.09290286332673177,109431,.09290274144751023,109432,.09290207073852812,109433,.09290279616016,109434,.09290273520025,109419,.09290271785025629,109447,.0929026336004445,109406,.09290341161327487,109453,6.4516E-4,109454,6.451625806477421E-4,109414,1E6,109445,.04046856422400001,109425,.04046849341289498,
109429,.04046849379260275,109417,.04046783807676053,109421,.04046842389557164,109449,.0404683871963536,109412,.04046872609874253,109404,1,109410,1.000027193184865,109413,2589998.4703195216,109452,1E-6,109409,3429904,109458,3434290.937856,109457,3434528.1495040003,109464,1.244521604938272E-7,109455,25.292852640000003,109456,25.29295381171408,109459,2.89612324,109439,2589988.110336,109462,.7168473118308245,109442,.83612736,109422,.83612589696064,109426,.836125904805842,109415,.8361123569578626,109435,
.836124673027592,109436,.836118636646753,109437,.8361251654414399,109438,.83612461680225,109418,.8361244606523066,109446,.8361237024040001,109443,.8361307045194736],e=[9103,2.908882086657216E-4,9104,4.84813681109536E-6,9102,.0174532925199433,9106,.01570796326794897,9105,.01570796326794897,9109,1E-6,9114,9.817477042468104E-4,1031,4.84813681109536E-9,9112,1.570796326794897E-4,9101,1,9113,1.570796326794897E-6],d=[109031,15E4,109461,109030,5E4,109460,1033,.01,109451,9097,20.1168,109444,9052,20.1167824,
109424,9062,20.116782494375872,109428,9038,20.1166195164,109416,9042,20.116765121552632,109420,9301,20.116756,109448,9033,20.11684023368047,109411,109005,.1,109450,9014,1.8288,109408,9002,.3048,109405,9070,.3048008333333334,109430,9051,.3047997333333333,109423,9061,.3047997347632708,109427,9095,.3048007491,109441,9005,.3047972654,109407,9094,.3047997101815088,109440,9080,.3047995102481469,109431,9081,.30479841,109432,9082,.3047996,109433,9083,.3047995,109434,9041,.304799471538676,109419,9300,.3047993333333334,
109447,9003,.3048006096012192,109406,109008,.0254,109453,109009,.0254000508001016,109454,9036,1E3,109414,9098,.201168,109445,9053,.201167824,109425,9063,.2011678249437587,109429,9039,.201166195164,109417,9043,.2011676512155263,109421,9302,.20116756,109449,9034,.2011684023368047,109412,9001,1,109404,9031,1.0000135965,109410,9035,1609.3472186944375,109413,1025,.001,109452,9030,1852,109409,109013,1853.184,109458,109012,1853.248,109457,109016,3.527777777777778E-4,109464,109010,5.0292,109455,109011,5.029210058420118,
109456,109014,1.7018,109459,9093,1609.344,109439,109015,.8466683600033867,109462,9096,.9144,109442,9050,.9143992,109422,9060,.9143992042898124,109426,9037,.9143917962000001,109415,9084,.9143985307444408,109435,9085,.91439523,109436,9086,.9143988,109437,9087,.9143985,109438,9040,.9143984146160287,109418,9099,.914398,109446,109002,.9144018288036576,109443,109001,.9144,109442,109003,20.1168,109444,109004,.201168,109445,109006,.01,109451,109007,.001,109452],g=[],m=[],u=0;u<b.length;u+=2)g[b[u]]=new h(b[u],
2,b[u+1]);b=null;for(u=0;u<e.length;u+=2)g[e[u]]=new h(e[u],1,e[u+1]);e=null;for(u=0;u<d.length;u+=3)g[d[u]]=new h(d[u],0,d[u+1]),m[d[u]]=d[u+2];d=null})(A||(A={}));(function(a){var h=function(){function a(){}a.prototype.set=function(e,d){void 0!==d?(this.Lf=e,this.Og=d):"number"===typeof e?(this.Lf=e,this.Og=0):(this.Lf=e.Lf,this.Og=e.Og)};a.prototype.value=function(){return this.Lf};a.prototype.sub=function(e){if("number"===typeof e){var d=this.Lf-e;e=this.Og+2.220446049250313E-16*Math.abs(d)}else d=
this.Lf-e.Lf,e=this.Og+e.Og+2.220446049250313E-16*Math.abs(d);this.Lf=d;this.Og=e};a.prototype.Ap=function(e){var d=this.Lf*e.Lf;this.Og=this.Og*Math.abs(e.Lf)+e.Og*Math.abs(this.Lf)+this.Og*e.Og+2.220446049250313E-16*Math.abs(d);this.Lf=d};a.prototype.eP=function(){return Math.abs(this.Lf)<=this.Og};a.prototype.Dq=function(){return this.eP()&&0!=this.Og};return a}();a.$k=h})(A||(A={}));var J=new A.b,I=new A.b,K=new A.b,L=new A.b,O=new A.b;(function(a){var h;(function(e){e[e.closedPath=1]="closedPath";
e[e.exteriorPath=2]="exteriorPath";e[e.ringAreaValid=4]="ringAreaValid"})(h||(h={}));var b=function(){function e(d,g,e,a,h,b,c){void 0!==g?(this.ab=d,this.mj=g,this.$j=e,this.zh=a,this.ua=b,this.mx=c,this.Pt=h):(this.ab=d.ab,this.mj=d.mj,this.$j=d.$j,this.zh=d.zh,this.ua=d.ua,this.mx=d.mx,this.Pt=d.Pt);this.JD=!0}e.prototype.next=function(){return this.JD?(this.JD=!1,this.zh):-1!=this.zh?(this.zh=this.ab.X(this.zh),this.ua++,-1!=this.zh&&this.zh!=this.Pt?this.zh:this.cQ()):-1};e.prototype.cQ=function(){this.$j=
this.ab.bc(this.$j);for(this.ua=0;-1!=this.mj;){for(;-1!=this.$j;this.$j=this.ab.bc(this.$j))if(this.Pt=this.zh=this.ab.Cb(this.$j),-1!=this.zh)return this.zh;this.mj=this.ab.we(this.mj);if(-1==this.mj)break;if(!this.mx||a.T.Kc(this.ab.Lb(this.mj)))this.$j=this.ab.Vb(this.mj)}return-1};e.UL=function(d,g,m,a,h,b,c){return new e(d,g,m,a,h,b,c)};return e}();a.CT=b;h=function(){function e(){this.Zm=this.Al=this.Ej=this.Mc=this.Jj=this.jn=this.fi=this.Rc=this.sh=this.wg=this.Ge=this.wp=this.zp=this.wb=
this.Hk=null;this.Xt=this.$c=-1;this.pd=0;this.kx=!1;this.wp=this.zp=this.wb=null}e.prototype.Fi=function(d){return null!=this.Ge?this.Ge[d]:null};e.prototype.Fh=function(d,g){if(null==this.Ge){if(null==g)return;this.Ge=[];for(var e=0,a=this.wb.F();e<a;e++)this.Ge.push(null)}this.Ge[d]=g};e.prototype.Mn=function(d,g){this.Rc.L(d,1,g)};e.prototype.Ln=function(d,g){this.Rc.L(d,2,g)};e.prototype.Iy=function(d,g){this.Rc.L(d,6,g)};e.prototype.Ho=function(d){return this.Rc.O(d,6)};e.prototype.Hu=function(d,
g){this.Rc.L(d,7,g)};e.prototype.bt=function(d){return this.Rc.O(d,0)};e.prototype.MF=function(d,g){this.Mc.L(d,1,g)};e.prototype.QF=function(d,g){this.Mc.L(d,0,g)};e.prototype.xC=function(d){return this.Mc.O(d,7)};e.prototype.Jn=function(d,g){this.Mc.L(d,3,g)};e.prototype.Kn=function(d,g){this.Mc.L(d,4,g)};e.prototype.jQ=function(d){null==this.Mc&&(this.Mc=new a.Fc(8));var g=this.Mc.be();this.Mc.L(g,2,d);this.Mc.L(g,5,0);this.Mc.L(g,6,0);this.Mc.L(g,7,g);return g};e.prototype.bN=function(d){this.Mc.Jc(d)};
e.prototype.lQ=function(d){null==this.Rc&&(this.Rc=new a.Fc(8),this.cd=new a.Fc(5),this.fi=new a.qd(0),this.jn=new a.qd(0));var g=this.Rc.be();this.Rc.L(g,0,g);this.Rc.L(g,3,0);this.Rc.L(g,6,0);this.Hu(g,d);g>=this.fi.size&&(d=16>g?16:a.I.truncate(3*g/2),this.fi.resize(d),this.jn.resize(d));this.fi.set(g,0);this.jn.set(g,0);return g};e.prototype.iC=function(d){this.Rc.Jc(d)};e.prototype.dw=function(d){this.cd.Jc(d);this.pd--};e.prototype.mQ=function(d){null==this.Rc&&(this.Rc=new a.Fc(8),this.cd=
new a.Fc(5),this.fi=new a.qd(0),this.jn=new a.qd(0));var g=this.cd.be(),e=0<=d?d:g;this.cd.L(g,0,e);if(0>d){if(e>=this.wb.F()){d=16>e?16:a.I.truncate(3*e/2);this.wb.resize(d);if(null!=this.Ge)for(var u=0;u<d;u++)this.Ge.push(null);null!=this.wg&&this.wg.resize(d);this.zp=this.wb.mc(0)}this.wb.ic(e,-1E38,-1E38);null!=this.Ge&&(this.Ge[e]=null);null!=this.wg&&this.wg.write(e,1)}this.cd.L(g,4,2*e);this.pd++;return g};e.prototype.vl=function(d,g,e){var m=-1!=g?this.Ua(g):this.hk(d),a=-1!=m?this.X(m):
-1,h=this.mQ(null==e?this.pd:-1),b=this.gb(h);null!=e&&this.wb.Iu(b,e);this.im(h,d);this.Sc(h,a);this.Tc(h,m);-1!=a&&this.Tc(a,h);-1!=m&&this.Sc(m,h);e=this.vc(d);m=this.Cb(d);-1==g&&this.Wi(d,h);g==m&&this.Dh(d,h);e&&-1==a&&(this.Sc(h,h),this.Tc(h,h));this.hm(d,this.Ha(d)+1);d=this.Vf(d);this.Pk(d,this.F(d)+1);return h};e.prototype.Fo=function(){null==this.Zm&&(this.Zm=new a.Va(this.wb.description));return this.Zm};e.prototype.Pp=function(d,g){this.Mc.L(d,2,this.Mc.O(d,2)&-134217729||(1==g?134217728:
0))};e.prototype.Cm=function(d){return 0!=(this.Mc.O(d,2)&134217728)?1:0};e.prototype.MJ=function(d){var g=this.jg(d.D(),d.description);1736==d.D()&&this.Pp(g,d.Cm());this.WA(g,d);return g};e.prototype.NJ=function(d){var g=this.jg(d.D(),d.description);this.XA(g,d);return g};e.prototype.TQ=function(d,g){null==this.Rc&&(this.Rc=new a.Fc(8),this.cd=new a.Fc(5),this.fi=new a.qd(0),this.jn=new a.qd(0));this.Rc.de(this.Rc.Xc+d);this.cd.de(this.cd.Xc+g);this.fi.xb(this.fi.size+d);this.jn.xb(this.jn.size+
d)};e.prototype.WA=function(d,g){this.TQ(g.ea(),g.F());this.Hk.Pd(g,0,g.F());this.zp=this.wb.mc(0);for(var e=null!=this.Ge&&null!=g.Fe,u=0,h=g.ea();u<h;u++)if(!(2>g.Ha(u))){var b=this.Cf(d,-1);this.Gn(b,g.vc(u));for(var c=g.Ea(u),p=g.Dc(u);c<p;c++){var f=this.vl(b,-1,null);if(e)if(f=this.gb(f),0!=(g.NC(c)&1))this.Fh(f,null);else{var l=new a.Ag;g.cc(c,l,!0);this.Fh(f,l.get())}}}};e.prototype.XA=function(d,g){this.Hk.Pd(g,0,g.F());this.zp=this.wb.mc(0);d=this.Cf(d,-1);var e=0;for(g=g.F();e<g;e++)this.vl(d,
-1,null)};e.prototype.DS=function(d,g,e){var m=this.X(d);if(-1==m)throw a.g.wa();for(var h=this.Fo(),b=this.rd(d),c=0,p=g.kk(e);c<p;c++){var f=this.gb(d),l=this.X(d),q=g.Io(e,c);0==c&&(q.En(h),this.bh(d,h));322==q.D()?this.Fh(f,null):this.Fh(f,a.T.Yj(q));q.Bn(h);c<p-1?d=this.vl(b,l,h):this.bh(m,h)}};e.prototype.CS=function(d,g,e){var m=this.X(d);if(-1==m)throw a.g.wa();for(var h=this.Fo(),b=this.rd(d),c=0,p=g.kk(e);c<p;c++){var f=this.gb(d),l=this.X(d),q=g.Io(e,p-c-1);0==c&&(q.Bn(h),this.bh(d,h));
322==q.D()?this.Fh(f,null):this.Fh(f,a.T.Yj(q));q.En(h);c<p-1?d=this.vl(b,l,h):this.bh(m,h)}};e.prototype.wC=function(){var d=new a.i;d.Ja();for(var g=this.Gp(),e=new a.b,h=!0,b=g.next();-1!=b;b=g.next())this.w(b,e),h?d.Db(e.x,e.y):d.Oj(e.x,e.y),h=!1;return d};e.prototype.Eb=function(d){var g=d.D();if(a.T.Kc(g))return this.MJ(d);if(550==g)return this.NJ(d);throw a.g.wa();};e.prototype.YJ=function(d,g){var e=g.D();if(a.T.Kc(e))this.WA(d,g);else if(550==e)this.XA(d,g);else throw a.g.wa();};e.prototype.QJ=
function(d,g){var e=this.jg(1736,d.description);if(2>d.Ha(g))return e;this.Hk.Pd(d,d.Ea(g),d.Dc(g));this.zp=this.wb.mc(0);var h=this.Cf(e,-1);this.Gn(h,d.vc(g)||!0);var b=null!=this.Ge&&null!=d.Fe,c=d.Ea(g);for(g=d.Dc(g);c<g;c++){var p=this.vl(h,-1,null);if(b)if(p=this.gb(p),0!=(d.NC(c)&1))this.Fh(p,null);else{var f=new a.Ag;d.cc(c,f,!0);this.Fh(p,f.get())}}return e};e.prototype.hf=function(d){var g=this.Lb(d),e=a.sH.jg(g,this.Hk.description),h=this.F(d);if(0==h)return e;if(a.T.Kc(g)){for(var g=this.ea(d),
b=a.Ac.Dg(g+1),c=a.Ac.to(g+1,0),p=e.description,f=0,l=p.Aa;f<l;f++){for(var q=p.Hd(f),n=a.pa.Wa(q),z=a.Ac.Tv(q,h),k=this.wb.mc(q),t=0,A=0,v=0,y=this.Vb(d);-1!=y;y=this.bc(y)){var w=0;this.vc(y)&&(w|=1);this.VO(y)&&(w|=4);0!=w&&c.xy(A,w);var D=this.Ha(y);b.write(A++,v);v+=D;if(0==q)for(var D=k,B=z,F=new a.b,w=this.Cb(y);t<v;w=this.X(w),t++){var Q=this.gb(w);D.ec(2*Q,F);B.Rn(2*t,F)}else for(w=this.Cb(y);t<v;w=this.X(w),t++)for(Q=this.gb(w),B=0;B<n;B++)F=k.Bh(Q*n+B),z.Uk(t*n+B,F)}e.bm(q,z);b.write(g,
h)}e.NF(c);e.OF(b);e.ce(16777215)}else if(550==g){p=e.description;e.resize(h);f=0;for(l=p.Aa;f<l;f++){q=p.Hd(f);n=a.pa.Wa(q);z=e.mc(q);k=this.wb.mc(q);t=0;y=this.Vb(d);D=this.Ha(y);for(w=this.Cb(y);t<D;w=this.X(w),t++)for(Q=this.gb(w),B=0;B<n;B++)F=k.Bh(Q*n+B),z.Uk(t*n+B,F);e.bm(q,z)}e.ce(16777215)}return e};e.prototype.sy=function(d){for(var g=this.Vb(d);-1!=g;g=this.Cr(g));var g=this.aO(d),e=this.we(d);-1!=g?this.MF(g,e):this.$c=e;-1!=e?this.QF(e,g):this.Xt=g;this.bN(d)};e.prototype.jg=function(d,
g){return void 0===g?this.QB(d,a.Od.Tf()):this.QB(d,g)};e.prototype.QB=function(d,g){d=this.jQ(d);null==this.wb?this.wb=this.Hk=new a.pe(g):this.Hk.Ik(g);this.wp=this.Hk.description;this.kx=1<this.wp.Aa;-1==this.$c?this.$c=d:(this.QF(d,this.Xt),this.MF(this.Xt,d));return this.Xt=d};e.prototype.we=function(d){return this.Mc.O(d,1)};e.prototype.aO=function(d){return this.Mc.O(d,0)};e.prototype.Lb=function(d){return this.Mc.O(d,2)&2147483647};e.prototype.EF=function(d,g,e){g=this.Ej[g];d=this.xC(d);
d>=g.size&&g.resize(Math.max(a.I.truncate(1.25*d),16),-1);g.write(d,e)};e.prototype.yC=function(d,g){d=this.xC(d);g=this.Ej[g];return d<g.size?g.read(d):-1};e.prototype.RB=function(){null==this.Ej&&(this.Ej=[]);for(var d=0;d<this.Ej.length;d++)if(null==this.Ej[d])return this.Ej[d]=a.Ac.Dg(0),d;this.Ej.push(a.Ac.Dg(0));return this.Ej.length-1};e.prototype.tR=function(d){this.Ej[d]=null};e.prototype.Vb=function(d){return this.Mc.O(d,3)};e.prototype.Ys=function(d){return this.Mc.O(d,4)};e.prototype.F=
function(d){return this.Mc.O(d,5)};e.prototype.ea=function(d){return this.Mc.O(d,6)};e.prototype.xo=function(d,g,e){for(var m=0,h=this.$c;-1!=h;h=this.we(h)){var b=this.Lb(h);if(a.T.Kc(b)&&(!e||1736==b))for(var b=1736==this.Lb(h),c=this.Vb(h);-1!=c;){for(var p=0,f=this.Cb(c);p<a.I.truncate(this.Ha(c)/2);){var l=this.X(f);if(-1==l)break;var q=this.gb(f),n=this.Fi(q);null!=n?q=n.$b():(n=this.gb(l),q=this.wb.mv(q,n));q<=d?(0==q?0==m&&(m=-1):m=1,l!=this.hk(c)&&(this.Zy(l,f),this.vf(l,!0))):f=this.X(f);
p++}p=this.Cb(c);for(f=this.vc(c)?p:this.hk(c);0<this.Ha(c);)if(l=this.Ua(f),-1!=l){var z=this.gb(l),n=this.Fi(z);null!=n?q=n.$b():(q=this.gb(f),q=this.wb.mv(q,z));if(q<=d)0==q?0==m&&(m=-1):m=1,this.Zy(l,f),this.vf(l,!1),p==l&&(p=this.Cb(c));else if(f=this.Ua(f),f==p)break}else{this.vf(f,!0);0==m&&(m=-1);break}f=this.Ha(c);g&&(b?3>f:2>f)?(c=this.Cr(c),m=0<f?1:0==m?-1:m):c=this.bc(c)}}return m};e.prototype.Zy=function(d,g){var e=this.gb(d),a=this.gb(g);null!=this.wg&&(e=this.wg.read(e),this.wg.write(a,
e));if(null!=this.sh)for(a=0,e=this.sh.length;a<e;a++)if(null!=this.sh[a]){var h=this.Ra(d,a);-1!=h&&this.lb(g,a,h)}};e.prototype.Mr=function(d,g,e){var m=0,h=this.X(d);if(-1==h)throw a.g.wa();for(var b=this.gb(d),c=this.gb(h),p=this.Fi(b),f=null==p?this.wb.mv(b,c):p.$b(),l=0;l<e;l++){var q=g[l];if(0<q&&1>q){var n=q;null!=p&&(n=0<f?p.rA(q)/f:0);this.wb.vJ(b,c,n,this.Fo());var z=this.vl(this.rd(d),h,this.Fo());m++;if(null!=p){var k=p.xm(0,q),n=this.gb(this.Ua(z));this.Fh(n,k);this.Yi(z,k.oc());if(l==
e-1||1==g[l+1])q=p.xm(q,1),this.Fh(n,q)}}}return m};e.prototype.bh=function(d,g){var e=this.gb(d);this.wb.Iu(e,g);e=this.Fi(e);null!=e&&e.setStart(g);d=this.Ua(d);-1!=d&&(d=this.gb(d),null!=this.Fi(d)&&e.setEnd(g))};e.prototype.Jk=function(d,g){d=this.gb(d);this.wb.Sd(d,g)};e.prototype.Yi=function(d,g){this.ic(d,g.x,g.y)};e.prototype.ic=function(d,g,e){var m=this.gb(d);this.wb.ic(m,g,e);m=this.Fi(m);null!=m&&m.Ny(g,e);d=this.Ua(d);-1!=d&&(d=this.gb(d),null!=this.Fi(d)&&m.Ok(g,e))};e.prototype.w=function(d,
g){this.wb.w(this.cd.O(d,0),g)};e.prototype.uc=function(d,g){this.wb.Ba[0].ec(2*this.cd.O(d,0),g)};e.prototype.Fa=function(d){var g=new a.b;this.wb.w(this.cd.O(d,0),g);return g};e.prototype.SC=function(d,g){this.zp.ec(2*d,g)};e.prototype.ld=function(d,g,e){return this.wb.ld(d,this.gb(g),e)};e.prototype.setAttribute=function(d,g,e,a){this.wb.setAttribute(d,this.gb(g),e,a)};e.prototype.gb=function(d){return this.cd.O(d,0)};e.prototype.mk=function(d){var g=new a.b;this.w(d,g);return g.y};e.prototype.Cq=
function(d,g){d=this.gb(d);g=this.gb(g);var e=this.wb.Ba[0].f;return e[2*d]===e[2*g]&&e[2*d+1]===e[2*g+1]};e.prototype.pt=function(d,g){d=this.gb(d);var e=this.wb.Ba[0].f;return e[2*d]===g.x&&e[2*d+1]===g.y};e.prototype.pS=function(d,g){1>g&&(g=1);if(null==this.wg){if(1==g)return;this.wg=a.Ac.kl(this.wb.F(),1)}d=this.gb(d);d>=this.wg.size&&this.wg.resize(d+1,1);this.wg.write(d,g)};e.prototype.RC=function(d){d=this.gb(d);return null==this.wg||d>=this.wg.size?1:this.wg.read(d)};e.prototype.lb=function(d,
g,e){g=this.sh[g];d=this.gb(d);g.size<this.wb.F()&&g.resize(this.wb.F(),-1);g.write(d,e)};e.prototype.Ra=function(d,g){d=this.gb(d);g=this.sh[g];return d<g.size?g.read(d):-1};e.prototype.re=function(){null==this.sh&&(this.sh=[]);for(var d=0;d<this.sh.length;d++)if(null==this.sh[d])return this.sh[d]=a.Ac.Dg(0,-1),d;this.sh.push(a.Ac.Dg(0,-1));return this.sh.length-1};e.prototype.bf=function(d){this.sh[d]=null};e.prototype.cc=function(d){return null!=this.Ge?(d=this.gb(d),this.Ge[d]):null};e.prototype.Oc=
function(d,g){var e=this.cd.O(d,2);if(-1==e)return!1;if(this.kx){var h=new a.Va;this.Jk(d,h);g.setStart(h);this.Jk(e,h);g.setEnd(h)}else this.wb.uc(this.cd.O(d,0),J),g.gl(0,J),this.wb.uc(this.cd.O(e,0),J),g.gl(1,J);return!0};e.prototype.gR=function(d,g,e){if(this.kx){var m=new a.Va;this.Jk(d,m);e.setStart(m);this.Jk(g,m);e.setEnd(m)}else this.wb.uc(d,J),e.gl(0,J),this.wb.uc(g,J),e.gl(1,J)};e.prototype.Cf=function(d,g){var e;if(-1!=g){if(d!=this.Vf(g))throw a.g.wa();e=this.wq(g)}else e=this.Ys(d);
var h=this.lQ(d);-1!=g&&this.Mn(g,h);this.Ln(h,g);this.Mn(h,e);-1!=e?this.Ln(e,h):this.Jn(d,h);-1==g&&this.Kn(d,h);this.gm(d,this.ea(d)+1);return h};e.prototype.aD=function(d,g,e,a){d=this.Cf(d,-1);for(var m=0,h=g,u=!1;h==e&&(u=!0),this.im(h,d),m++,h=this.X(h),h!=g;);this.Gn(d,!0);this.hm(d,m);u&&(g=e);this.Dh(d,g);this.Wi(d,this.Ua(g));this.Jr(d,!1);null!=a&&(a[0]=u);return d};e.prototype.Cr=function(d){var g=this.wq(d),e=this.bc(d),a=this.Vf(d);-1!=g?this.Ln(g,e):this.Jn(a,e);-1!=e?this.Mn(e,g):
this.Kn(a,g);this.bL(d);this.gm(a,this.ea(a)-1);this.iC(d);return e};e.prototype.bL=function(d){var g=this.Cb(d);if(-1!=g){for(var e=0,a=this.Ha(d);e<a;e++){var h=g,g=this.X(g);this.dw(h)}g=this.Vf(d);this.Pk(g,this.F(g)-this.Ha(d))}this.hm(d,0)};e.prototype.bc=function(d){return this.Rc.O(d,2)};e.prototype.wq=function(d){return this.Rc.O(d,1)};e.prototype.Ha=function(d){return this.Rc.O(d,3)};e.prototype.vc=function(d){return 0!=(this.Ho(d)&1)};e.prototype.Gn=function(d,g){if(this.vc(d)!=g){if(0<
this.Ha(d)){var e=this.Cb(d),a=this.hk(d);g?(this.Sc(a,e),this.Tc(e,a)):(this.Sc(a,-1),this.Tc(e,-1));e=this.gb(a);this.Fh(e,null)}this.Iy(d,(this.Ho(d)|1)-1|(g?1:0))}};e.prototype.Vf=function(d){return this.Rc.O(d,7)};e.prototype.VO=function(d){return 0!=(this.Ho(d)&2)};e.prototype.Dy=function(d,g){this.Iy(d,(this.Ho(d)|2)-2|(g?2:0))};e.prototype.Gw=function(d){if(this.bP(d))return this.fi.get(this.bt(d));var g=new a.yb,e=this.Cb(d);if(-1==e)return 0;var h=new a.b;this.w(e,h);for(var b=0,c=0,p=this.Ha(d);c<
p;c++,e=this.X(e)){var f=this.cc(e);if(null==f){if(!this.Oc(e,g))continue;f=g}b+=f.kv(h.x,h.y)}this.Jr(d,!0);this.fi.set(this.bt(d),b);return b};e.prototype.Rp=function(d,g,e){g=this.Jj[g];d=this.bt(d);g.size<this.fi.size&&g.resize(this.fi.size,-1);g.write(d,e)};e.prototype.Ei=function(d,g){d=this.bt(d);g=this.Jj[g];return d<g.size?g.read(d):-1};e.prototype.Uv=function(){null==this.Jj&&(this.Jj=[]);for(var d=0;d<this.Jj.length;d++)if(null==this.Jj[d])return this.Jj[d]=a.Ac.Dg(0),d;this.Jj.push(a.Ac.Dg(0));
return this.Jj.length-1};e.prototype.ty=function(d){this.Jj[d]=null};e.prototype.bQ=function(d,g,e){if(-1==e)throw a.g.N();if(g!=e){var m=this.bc(e),h=this.wq(e),b=this.Vf(e);-1==h?this.Jn(b,m):this.Ln(h,m);-1==m?this.Kn(b,h):this.Mn(m,h);this.Pk(b,this.F(b)-this.Ha(e));this.gm(b,this.ea(b)-1);h=-1==g?this.Ys(d):this.wq(g);this.Mn(e,h);this.Ln(e,g);-1==g?this.Kn(d,e):this.Mn(g,e);-1==h?this.Jn(d,e):this.Ln(h,e);this.Pk(d,this.F(d)+this.Ha(e));this.gm(d,this.ea(d)+1);this.Hu(e,d)}};e.prototype.zi=
function(d,g){this.wb.Sd(this.gb(g),this.Fo());this.vl(d,-1,this.Fo())};e.prototype.vf=function(d,g){var e=this.rd(d),h=this.Ua(d),b=this.X(d);-1!=h&&this.Sc(h,b);var c=this.Ha(e);d==this.Cb(e)&&this.Dh(e,1<c?b:-1);-1!=b&&this.Tc(b,h);d==this.hk(e)&&this.Wi(e,1<c?h:-1);if(-1!=h&&-1!=b){var h=this.gb(h),p=this.gb(b);g?(g=this.Fi(h),null!=g&&(h=new a.b,this.wb.w(p,h),g.vd(h))):(p=this.gb(d),g=this.Fi(p),this.Fh(h,g),null!=g&&(h=this.wb.Fa(h),g.ed(h)))}this.hm(e,c-1);e=this.Vf(e);this.Pk(e,this.F(e)-
1);this.dw(d);return b};e.prototype.Cb=function(d){return this.Rc.O(d,4)};e.prototype.hk=function(d){return this.Rc.O(d,5)};e.prototype.X=function(d){return this.cd.O(d,2)};e.prototype.Ua=function(d){return this.cd.O(d,1)};e.prototype.rd=function(d){return this.cd.O(d,3)};e.prototype.Ub=function(d,g){return this.vl(d,-1,g)};e.prototype.Gp=function(d){if(void 0===d)return this.Gp(!1);if(d instanceof b)return new b(d);var g,e=-1,h=-1,C=-1,c=0,p=!1;for(g=this.$c;-1!=g;g=this.we(g))if(!d||a.T.Kc(this.Lb(g))){for(e=
this.Vb(g);-1!=e;e=this.bc(e))if(C=h=this.Cb(e),c=0,-1!=h){p=!0;break}if(p)break}return b.UL(this,g,e,h,C,c,d)};e.prototype.Oe=function(d){this.Hk.Oe(d);if(null!=this.Ge)for(var g=0,e=this.Ge.length;g<e;g++)null!=this.Ge[g]&&this.Ge[g].Oe(d)};e.prototype.Tp=function(d,g,e,a){a?this.DS(d,g,e):this.CS(d,g,e)};e.prototype.Tc=function(d,g){this.cd.L(d,1,g)};e.prototype.Sc=function(d,g){this.cd.L(d,2,g)};e.prototype.im=function(d,g){this.cd.L(d,3,g)};e.prototype.hm=function(d,g){this.Rc.L(d,3,g)};e.prototype.Dh=
function(d,g){this.Rc.L(d,4,g)};e.prototype.Wi=function(d,g){this.Rc.L(d,5,g)};e.prototype.gm=function(d,g){this.Mc.L(d,6,g)};e.prototype.Pk=function(d,g){this.Mc.L(d,5,g)};e.prototype.lF=function(d){var g=d;do{var e=this.X(g);this.Sc(g,this.Ua(g));this.Tc(g,e);g=e}while(g!=d)};e.prototype.ZF=function(d){this.pd=d};e.prototype.yu=function(d){var g=this.wq(d),e=this.bc(d),a=this.Vf(d);-1!=g?this.Ln(g,e):this.Jn(a,e);-1!=e?this.Mn(e,g):this.Kn(a,g);this.Dh(d,-1);this.Wi(d,-1);this.iC(d)};e.prototype.Ui=
function(d,g){var e=this.Ua(d),h=this.X(d);-1!=e&&this.Sc(e,h);-1!=h&&this.Tc(h,e);if(-1!=e&&-1!=h)if(e=this.gb(e),h=this.gb(h),g){if(g=this.Fi(e),null!=g){var b=new a.b;this.wb.w(h,b);g.vd(b)}}else h=this.gb(d),g=this.Fi(h),this.Fh(e,g),null!=g&&(b=new a.b,this.wb.w(e,b),g.ed(b));this.dw(d)};e.prototype.bP=function(d){return 0!=(this.Ho(d)&4)};e.prototype.Jr=function(d,g){this.Iy(d,(this.Ho(d)|4)-4|(g?4:0))};e.prototype.Mu=function(d,g){var e=this.cd.f;this.wb.kc();var a=this.wb.Ba[0].f;d.xd(0,g,
function(d,g){d=e[5*d];g=e[5*g];var m=a[2*d];d=a[2*d+1];var h=a[2*g];g=a[2*g+1];return d<g?-1:d>g?1:m<h?-1:m>h?1:0})};e.prototype.pO=function(){for(var d=this.$c;-1!=d;d=this.we(d))if(!a.T.Kc(this.Lb(d)))return!0;return!1};e.prototype.Vy=function(d,g){for(var e=this.Vb(d),a=this.Vb(g),h=this.Ys(d),b=this.Ys(g),c=this.Vb(d);-1!=c;c=this.bc(c))this.Hu(c,g);for(c=this.Vb(g);-1!=c;c=this.bc(c))this.Hu(c,d);this.Jn(d,a);this.Jn(g,e);this.Kn(d,b);this.Kn(g,h);e=this.F(d);a=this.ea(d);h=this.ea(g);this.Pk(d,
this.F(g));this.Pk(g,e);this.gm(d,h);this.gm(g,a);e=this.Mc.O(d,2);this.Mc.L(d,2,this.Mc.O(g,2));this.Mc.L(g,2,e)};return e}();a.fd=h})(A||(A={}));(function(a){var h=function(h){function e(d,g,e,u){h.call(this);this.R=new a.i;void 0===d?this.MB():"number"===typeof d?this.AL(d,g,e,u):d instanceof a.Va?void 0!==g?this.Ks(d,g,e):this.BL(d):d instanceof a.pa?void 0!==g?this.DL(d,g):this.CL(d):d instanceof a.i?this.zL(d):this.MB()}z(e,h);e.prototype.Ks=function(d,g,e){this.description=a.Od.Tf();this.R.Ja();
d.s()||this.sv(d,g,e)};e.prototype.zL=function(d){this.description=a.Od.Tf();this.R.K(d);this.R.normalize()};e.prototype.CL=function(d){if(null==d)throw a.g.N();this.description=d;this.R.Ja()};e.prototype.DL=function(d,g){if(null==d)throw a.g.N();this.description=d;this.R.K(g);this.R.normalize()};e.prototype.MB=function(){this.description=a.Od.Tf();this.R.Ja()};e.prototype.BL=function(d){this.description=a.Od.Tf();this.R.Ja();d.s()||this.sv(d)};e.prototype.AL=function(d,g,e,h){this.description=a.Od.Tf();
this.K(d,g,e,h)};e.prototype.K=function(d,g,e,a){this.qc();if("number"===typeof d)this.R.K(d,g,e,a);else for(this.Ja(),g=0,e=d.length;g<e;g++)this.Db(d[g])};e.prototype.Cu=function(d){this.qc();if(!d.dP())throw a.g.N();this.R.K(d)};e.prototype.Ja=function(){this.qc();this.R.Ja()};e.prototype.s=function(){return this.R.s()};e.prototype.aa=function(){return this.R.aa()};e.prototype.ba=function(){return this.R.ba()};e.prototype.lw=function(){return this.R.lw()};e.prototype.Vs=function(){return this.R.Vs()};
e.prototype.qq=function(){return this.R.Af()};e.prototype.Db=function(d){if(d instanceof a.b)this.qc(),this.R.Db(d);else if(d instanceof a.i)this.qc(),this.R.Db(d);else if(d instanceof a.Va){if(this.qc(),!d.sc()){var g=d.description;this.description!=g&&this.Ik(g);if(this.s())this.sv(d);else{this.R.Db(d.w());for(var m=1,h=g.Aa;m<h;m++)for(var b=g.Fd(m),c=a.pa.Wa(b),p=0;p<c;p++){var f=d.ld(b,p),l=this.Ah(b,p);l.Db(f);setInterval(b,p,l)}}}}else if(d instanceof e&&!d.s())for(g=d.description,g!=this.description&&
this.Ik(g),this.R.Db(d.R),m=1,h=g.Aa;m<h;m++)for(b=g.Hd(m),c=a.pa.Wa(b),p=0;p<c;p++)f=d.Ah(b,p),l=this.Ah(b,p),l.Db(f),setInterval(b,p,l)};e.prototype.sv=function(d,g,e){if(void 0!==g){this.R.K(d.w(),g,e);g=d.description;e=1;for(var m=g.Aa;e<m;e++)for(var h=g.Fd(e),b=a.pa.Wa(h),c=0;c<b;c++){var p=d.ld(h,c);this.setInterval(h,c,p,p)}}else for(this.R.K(d.fa[0],d.fa[1]),g=d.description,e=1,m=g.Aa;e<m;e++)for(h=g.Fd(e),b=a.pa.Wa(h),c=0;c<b;c++)p=d.ld(h,c),this.setInterval(h,c,p,p)};e.prototype.setInterval=
function(d,g,e,h){var m=null;"number"===typeof e?m=new a.Nd(e,h):m=e;this.qc();if(0==d)if(0==g)this.R.v=m.qa,this.R.B=m.va;else if(1==g)this.R.C=m.qa,this.R.G=m.va;else throw a.g.Uc();else this.DA(0,d,g,m.qa),this.DA(1,d,g,m.va)};e.prototype.P=function(d,g){this.qc();this.R.P(d,g)};e.prototype.Oe=function(d){if(d instanceof a.Bg)this.qc(),d.$y(this.R);else if(this.qc(),!this.R.s()){var g=new a.fH;this.Cn(g);g.UO()?g.Ja():d.$y(g)}};e.prototype.copyTo=function(d){if(d.D()!=this.D())throw a.g.N();d.qc();
d.description=this.description;d.R.K(this.R);d.fa=null;if(null!=this.fa){d.ns();for(var g=0;g<2*(this.description.le.length-2);g++)d.fa[g]=this.fa[g]}};e.prototype.Pa=function(){return new e(this.description)};e.prototype.Mh=function(){return this.R.rN()};e.prototype.$b=function(){return this.R.CC()};e.prototype.D=function(){return 197};e.prototype.fb=function(){return 2};e.prototype.Fp=function(d){this.copyTo(d)};e.prototype.o=function(d){d.v=this.R.v;d.C=this.R.C;d.B=this.R.B;d.G=this.R.G};e.prototype.Cn=
function(d){d.v=this.R.v;d.C=this.R.C;d.B=this.R.B;d.G=this.R.G;d.K(this.R.v,this.R.C,this.yd(0,1,0),this.R.B,this.R.G,this.yd(1,1,0))};e.prototype.Ah=function(d,g){var e=new a.Nd;e.K(this.yd(0,d,g),this.yd(1,d,g));return e};e.prototype.uf=function(d,g){g.Qf(this.description);var e=this.description.Aa-1;switch(d){case 0:for(d=0;d<e;d++)for(var h=this.description.Hd(d),b=a.pa.Wa(h),c=0;c<b;c++)g.setAttribute(h,c,this.yd(0,h,c));g.ic(this.R.v,this.R.C);break;case 1:for(d=0;d<e;d++)for(h=this.description.Hd(d),
b=a.pa.Wa(h),c=0;c<b;c++)g.setAttribute(h,c,this.yd(1,h,c));g.ic(this.R.v,this.R.G);break;case 2:for(d=0;d<e;d++)for(h=this.description.Hd(d),b=a.pa.Wa(h),c=0;c<b;c++)g.setAttribute(h,c,this.yd(0,h,c));g.ic(this.R.B,this.R.G);break;case 3:for(d=0;d<e;d++)for(h=this.description.Hd(d),b=a.pa.Wa(h),c=0;c<b;c++)g.setAttribute(h,c,this.yd(1,h,c));g.ic(this.R.B,this.R.C);break;default:throw a.g.Uc();}};e.prototype.vu=function(d,g){d=this.R.vu(d);g.ma(d.x,d.y)};e.prototype.zN=function(d,g){return g*(d.up-
2)};e.prototype.mC=function(d,g,e){if(this.R.s())throw a.g.ra("empty geometry");if(0==g)return 0!=d?0!=e?this.R.G:this.R.B:0!=e?this.R.C:this.R.v;if(e>=a.pa.Wa(g))throw a.g.N();var m=this.description.zf(g);this.ns();return 0<=m?this.fa[this.zN(this.description,d)+this.description.XN(m)-2+e]:a.pa.ue(g)};e.prototype.ns=function(){this.qc();if(null==this.fa&&2<this.description.le.length){this.fa=[];for(var d=e.V(this.description,0),g=e.V(this.description,1),m=0,h=1,b=this.description.Aa;h<b;h++)for(var c=
this.description.Hd(h),p=a.pa.Wa(c),c=a.pa.ue(c),f=0;f<p;f++)this.fa[d+m]=c,this.fa[g+m]=c,m++}};e.prototype.nm=function(d){if(null!=this.fa)if(2<d.le.length){for(var g=a.Od.iu(d,this.description),m=[],h=e.V(this.description,0),b=e.V(this.description,1),c=e.V(d,0),p=e.V(d,1),f=0,l=1,q=d.Aa;l<q;l++){var n=d.Hd(l),z=a.pa.Wa(n);if(-1==g[l])for(var k=a.pa.ue(n),n=0;n<z;n++)m[c+f]=k,m[p+f]=k,f++;else for(k=this.description.fj(g[l])-2,n=0;n<z;n++)m[c+f]=this.fa[h+k],m[p+f]=this.fa[b+k],f++,k++}this.fa=
m}else this.fa=null;this.description=d};e.prototype.yd=function(d,g,m){if(this.R.s())throw a.g.ra("This operation was performed on an Empty Geometry.");if(0==g)return 0!=d?0!=m?this.R.G:this.R.B:0!=m?this.R.C:this.R.v;if(m>=a.pa.Wa(g))throw a.g.Uc();var h=this.description.zf(g);return 0<=h?(this.ns(),this.fa[e.V(this.description,d)+this.description.fj(h)-2+m]):a.pa.ue(g)};e.prototype.DA=function(d,g,m,h){this.qc();if(0==g)0!=d?0!=m?this.R.G=h:this.R.B=h:0!=m?this.R.C=h:this.R.v=h;else{if(m>=a.pa.Wa(g))throw a.g.Uc();
if(!this.hasAttribute(g)){if(a.pa.nD(g,h))return;this.Ne(g)}g=this.description.zf(g);this.ns();this.fa[e.V(this.description,d)+this.description.fj(g)-2+m]=h}};e.V=function(d,g){return g*(d.le.length-2)};e.prototype.Ga=function(d){this.qc();var g=new a.i;d.o(g);return this.R.Ga(g)};e.prototype.jc=function(d){return d instanceof a.i?this.R.jc(d):this.R.jc(d.R)};e.prototype.offset=function(d,g){this.qc();this.R.offset(d,g)};e.prototype.normalize=function(){this.qc();this.R.normalize()};e.prototype.Af=
function(d){if(void 0!==d)if(d.Qf(this.description),this.s())d.Ja();else{for(var g=this.description.Aa,e=1;e<g;e++)for(var h=this.description.Hd(e),b=a.pa.Wa(h),c=0;c<b;c++){var p=.5*(this.mC(0,h,c)+this.mC(1,h,c));d.setAttribute(h,c,p)}d.ic(this.R.Af())}else{d=new a.Va(this.description);if(this.s())return d;g=this.description.Aa;for(e=1;e<g;e++)for(h=this.description.Fd(e),b=a.pa.Wa(h),c=0;c<b;c++)p=.5*(this.yd(0,h,c)+this.yd(1,h,c)),d.setAttribute(h,c,p);d.ic(this.R.lw(),this.R.Vs());return d}};
e.prototype.yw=function(){return new a.Va(this.R.yw())};e.prototype.contains=function(d){return d instanceof a.Va?d.s()?!1:this.R.contains(d.lk(),d.mk()):this.R.contains(d.R)};e.prototype.lc=function(d){if(d==this)return!0;if(!(d instanceof e)||this.description!=d.description)return!1;if(this.s())return d.s()?!0:!1;if(!this.R.lc(d.R))return!1;for(var g=0,m=2*(this.description.le.length-2);g<m;g++)if(this.fa[g]!=d.fa[g])return!1;return!0};e.prototype.hc=function(){var d=this.description.hc(),d=a.I.kg(d,
this.R.hc());if(!this.s()&&null!=this.fa)for(var g=0,e=2*(this.description.le.length-2);g<e;g++)d=a.I.kg(d,this.fa[g]);return d};e.prototype.Rf=function(){return a.Hh.il(this,null)};e.prototype.toString=function(){return this.s()?"Envelope: []":"Envelope: ["+this.R.v+", "+this.R.C+", "+this.R.B+", "+this.R.G+"]"};return e}(a.T);a.Vj=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m){void 0===e?this.Ja():(this.v=e,this.C=d,this.B=g,this.G=m)}h.Oa=function(e,d,g,m){var a=new h;a.v=e;a.C=
d;a.B=g;a.G=m;return a};h.prototype.K=function(e,d,g,m){"number"===typeof e?void 0!==g?(this.v=e,this.C=d,this.B=g,this.G=m,this.normalize()):(this.v=e,this.C=d,this.B=e,this.G=d):e instanceof a.b?void 0!==d?(this.v=e.x-.5*d,this.B=this.v+d,this.C=e.y-.5*g,this.G=this.C+g,this.normalize()):(this.v=e.x,this.C=e.y,this.B=e.x,this.G=e.y):e instanceof h?this.K(e.v,e.C,e.B,e.G):e instanceof a.Nd&&(e.s()||d.s()?this.Ja():(this.v=e.qa,this.B=e.va,this.C=d.qa,this.G=d.va))};h.prototype.IN=function(e,d){var g=
new h;g.K(this.v,this.C,this.B,this.G);g.P(e,d);return g};h.prototype.Ey=function(e,d){if(void 0!==d)if(0==d)this.Ja();else{this.v=e[0].x;this.C=e[0].y;this.B=this.v;this.G=this.C;for(var g=1;g<d;g++){var m=e[g];m.x<this.v?this.v=m.x:m.x>this.B&&(this.B=m.x);m.y<this.C?this.C=m.y:m.y>this.G&&(this.G=m.y)}}else if(null==e||0==e.length)this.Ja();else for(m=e[0],this.K(m.x,m.y),g=1;g<e.length;g++)m=e[g],this.Oj(m.x,m.y)};h.prototype.Ja=function(){this.G=this.B=this.C=this.v=NaN};h.prototype.s=function(){return isNaN(this.v)};
h.prototype.Db=function(e,d){"number"===typeof e?this.s()?(this.v=e,this.C=d,this.B=e,this.G=d):(this.v>e?this.v=e:this.B<e&&(this.B=e),this.C>d?this.C=d:this.G<d&&(this.G=d)):e instanceof a.b?this.Db(e.x,e.y):e instanceof a.ee?this.Db(e.x,e.y):e instanceof h&&!e.s()&&(this.Db(e.v,e.C),this.Db(e.B,e.G))};h.prototype.Oj=function(e,d){this.v>e?this.v=e:this.B<e&&(this.B=e);this.C>d?this.C=d:this.G<d&&(this.G=d)};h.prototype.P=function(e,d){this.s()||(this.v-=e,this.B+=e,this.C-=d,this.G+=d,(this.v>
this.B||this.C>this.G)&&this.Ja())};h.prototype.scale=function(e){0>e&&this.Ja();this.s()||(this.v*=e,this.B*=e,this.C*=e,this.G*=e)};h.prototype.jc=function(e){return!this.s()&&!e.s()&&(this.v<=e.v?this.B>=e.v:e.B>=this.v)&&(this.C<=e.C?this.G>=e.C:e.G>=this.C)};h.prototype.rD=function(e){return(this.v<=e.v?this.B>=e.v:e.B>=this.v)&&(this.C<=e.C?this.G>=e.C:e.G>=this.C)};h.prototype.Ga=function(e){if(this.s()||e.s())return!1;e.v>this.v&&(this.v=e.v);e.B<this.B&&(this.B=e.B);e.C>this.C&&(this.C=e.C);
e.G<this.G&&(this.G=e.G);(e=this.v<=this.B&&this.C<=this.G)||this.Ja();return e};h.prototype.vu=function(e){switch(e){case 0:return a.b.Oa(this.v,this.C);case 1:return a.b.Oa(this.v,this.G);case 2:return a.b.Oa(this.B,this.G);case 3:return a.b.Oa(this.B,this.C);default:throw a.g.Uc();}};h.prototype.hy=function(e){if(null==e||4>e.length)throw a.g.N();null!=e[0]?e[0].ma(this.v,this.C):e[0]=a.b.Oa(this.v,this.C);null!=e[1]?e[1].ma(this.v,this.G):e[1]=a.b.Oa(this.v,this.G);null!=e[2]?e[2].ma(this.B,this.G):
e[2]=a.b.Oa(this.B,this.G);null!=e[3]?e[3].ma(this.B,this.C):e[3]=a.b.Oa(this.B,this.C)};h.prototype.rN=function(){return this.s()?0:this.aa()*this.ba()};h.prototype.CC=function(){return this.s()?0:2*(this.aa()+this.ba())};h.prototype.lw=function(){return(this.B+this.v)/2};h.prototype.Vs=function(){return(this.G+this.C)/2};h.prototype.aa=function(){return this.B-this.v};h.prototype.ba=function(){return this.G-this.C};h.prototype.move=function(e,d){this.s()||(this.v+=e,this.C+=d,this.B+=e,this.G+=
d)};h.prototype.offset=function(e,d){this.v+=e;this.B+=e;this.C+=d;this.G+=d};h.prototype.normalize=function(){if(!this.s()){var e=Math.min(this.v,this.B),d=Math.max(this.v,this.B);this.v=e;this.B=d;e=Math.min(this.C,this.G);d=Math.max(this.C,this.G);this.C=e;this.G=d}};h.prototype.Yl=function(e){e.ma(this.v,this.C)};h.prototype.YE=function(e){e.ma(this.B,this.C)};h.prototype.aF=function(e){e.ma(this.v,this.G)};h.prototype.Zl=function(e){e.ma(this.B,this.G)};h.prototype.dP=function(){return this.s()||
this.v<=this.B&&this.C<=this.G};h.prototype.Af=function(){return a.b.Oa((this.B+this.v)/2,(this.G+this.C)/2)};h.prototype.yw=function(){return a.b.Oa(this.v,this.C)};h.prototype.contains=function(e,d){if(void 0!==d)return e>=this.v&&e<=this.B&&d>=this.C&&d<=this.G;if(e instanceof a.Va)return this.contains(e.lk(),e.mk());if(e instanceof a.b)return this.contains(e.x,e.y);if(e instanceof h)return e.v>=this.v&&e.B<=this.B&&e.C>=this.C&&e.G<=this.G;throw a.g.N();};h.prototype.jl=function(e,d){if(void 0!==
d)return e>this.v&&e<this.B&&d>this.C&&d<this.G;if(e instanceof a.b)return this.jl(e.x,e.y);if(e instanceof h)return e.v>this.v&&e.B<this.B&&e.C>this.C&&e.G<this.G;throw a.g.N();};h.prototype.lc=function(e){return e==this?!0:e instanceof h?this.s()&&e.s()?!0:this.v!=e.v||this.C!=e.C||this.B!=e.B||this.G!=e.G?!1:!0:!1};h.prototype.hc=function(){var e=this.v,e=a.I.truncate(e^e>>>32),d=a.I.kg(e),e=this.B,e=a.I.truncate(e^e>>>32),d=a.I.kg(e,d),e=this.C,e=a.I.truncate(e^e>>>32),d=a.I.kg(e,d),e=this.G,
e=a.I.truncate(e^e>>>32);return d=a.I.kg(e,d)};h.prototype.vv=function(e){var d=new a.b;d.J(e);if(d.pv())return d;if(this.s())return d.FA(),d;d.x<this.v?d.x=this.v:d.x>this.B&&(d.x=this.B);d.y<this.C?d.y=this.C:d.y>this.G&&(d.y=this.G);if(!d.lc(e))return d;e=this.Af();(d.x<e.x?d.x-this.v:this.B-d.x)<(d.y<e.y?d.y-this.C:this.G-d.y)?d.x=d.x<e.x?this.v:this.B:d.y=d.y<e.y?this.C:this.G;return d};h.prototype.ms=function(e){if(this.s())return NaN;if(e.x==this.v)return e.y-this.C;var d=this.G-this.C,g=this.B-
this.v;return e.y==this.G?d+e.x-this.v:e.x==this.B?d+g+this.G-e.y:e.y==this.C?2*d+g+this.B-e.x:this.ms(this.vv(e))};h.prototype.vA=function(e){if(this.s())return-1;e=this.ms(e);var d=this.G-this.C,g=this.B-this.v;return e<d?0:(e-=d)<g?1:e-g<d?2:3};h.prototype.lv=function(){return this.s()?2.220446049250313E-14:2.220446049250313E-14*(Math.abs(this.v)+Math.abs(this.B)+Math.abs(this.C)+Math.abs(this.G)+1)};h.prototype.Nv=function(e,d){var g=this.ej(e),m=this.ej(d);if(0!=(g&m))return 0;if(0==(g|m))return 4;
var a=(0!=g?1:0)|(0!=m?2:0);do{var b=d.x-e.x,c=d.y-e.y;b>c?0!=(g&h.Cc)?(0!=(g&h.ob)?(e.y+=c*(this.v-e.x)/b,e.x=this.v):(e.y+=c*(this.B-e.x)/b,e.x=this.B),g=this.ej(e)):0!=(m&h.Cc)?(0!=(m&h.ob)?(d.y+=c*(this.v-d.x)/b,d.x=this.v):(d.y+=c*(this.B-d.x)/b,d.x=this.B),m=this.ej(d)):0!=g?(0!=(g&h.ac)?(e.x+=b*(this.C-e.y)/c,e.y=this.C):(e.x+=b*(this.G-e.y)/c,e.y=this.G),g=this.ej(e)):(0!=(m&h.ac)?(d.x+=b*(this.C-d.y)/c,d.y=this.C):(d.x+=b*(this.G-d.y)/c,d.y=this.G),m=this.ej(d)):0!=(g&h.Bd)?(0!=(g&h.ac)?
(e.x+=b*(this.C-e.y)/c,e.y=this.C):(e.x+=b*(this.G-e.y)/c,e.y=this.G),g=this.ej(e)):0!=(m&h.Bd)?(0!=(m&h.ac)?(d.x+=b*(this.C-d.y)/c,d.y=this.C):(d.x+=b*(this.G-d.y)/c,d.y=this.G),m=this.ej(d)):0!=g?(0!=(g&h.ob)?(e.y+=c*(this.v-e.x)/b,e.x=this.v):(e.y+=c*(this.B-e.x)/b,e.x=this.B),g=this.ej(e)):(0!=(m&h.ob)?(d.y+=c*(this.v-d.x)/b,d.x=this.v):(d.y+=c*(this.B-d.x)/b,d.x=this.B),m=this.ej(d));if(0!=(g&m))return 0}while(0!=(g|m));return a};h.prototype.ej=function(e){return(e.x<this.v?1:0)|(e.x>this.B?
1:0)<<1|(e.y<this.C?1:0)<<2|(e.y>this.G?1:0)<<3};h.prototype.mg=function(e){return!this.s()&&(this.aa()<=e||this.ba()<=e)};h.prototype.Fb=function(e){return e instanceof a.b?Math.sqrt(this.gG(e)):Math.sqrt(this.Ou(e))};h.prototype.Ou=function(e){var d=0,g=0,m;m=this.v-e.B;m>d&&(d=m);m=this.C-e.G;m>g&&(g=m);m=e.v-this.B;m>d&&(d=m);m=e.C-this.G;m>g&&(g=m);return d*d+g*g};h.prototype.gG=function(e){var d=0,g=0,m;m=this.v-e.x;m>d&&(d=m);m=this.C-e.y;m>g&&(g=m);m=e.x-this.B;m>d&&(d=m);m=e.y-this.G;m>g&&
(g=m);return d*d+g*g};h.prototype.wu=function(e){this.s()?e.Ja():e.K(this.v,this.B)};h.ob=1;h.ac=4;h.Cc=3;h.Bd=12;return h}();a.i=h})(A||(A={}));(function(a){var h;(function(e){e[e.initialize=0]="initialize";e[e.initializeRed=1]="initializeRed";e[e.initializeBlue=2]="initializeBlue";e[e.initializeRedBlue=3]="initializeRedBlue";e[e.sweep=4]="sweep";e[e.sweepBruteForce=5]="sweepBruteForce";e[e.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce";e[e.sweepRedBlue=7]="sweepRedBlue";e[e.sweepRed=8]="sweepRed";
e[e.sweepBlue=9]="sweepBlue";e[e.iterate=10]="iterate";e[e.iterateRed=11]="iterateRed";e[e.iterateBlue=12]="iterateBlue";e[e.iterateBruteForce=13]="iterateBruteForce";e[e.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce";e[e.resetRed=15]="resetRed";e[e.resetBlue=16]="resetBlue"})(h||(h={}));var b=function(){function e(d,g){this.th=d;this.KD=g}e.prototype.Zp=function(d,g,e){this.th.BS(e,d,g,this.KD)};e.prototype.Mo=function(d){return this.th.pq(d,this.KD)};return e}();h=function(){function e(){this.Vt=
this.cn=this.Ve=this.ad=null;this.fp=new a.i;this.Al=this.Mi=this.Ni=this.od=this.rf=this.ud=this.Nt=this.Wm=this.Zc=this.vb=null;this.Hb=-1;this.ka=0;this.Rj()}e.prototype.Vp=function(){this.Rj();this.At=!0;null==this.vb?(this.Wm=new a.ga(0),this.vb=[]):(this.Wm.cf(0),this.vb.length=0)};e.prototype.Wc=function(d,g){if(!this.At)throw a.g.xa();var e=new a.i;e.K(g);this.Wm.add(d);this.vb.push(e)};e.prototype.wo=function(){if(!this.At)throw a.g.xa();this.At=!1;null!=this.vb&&0<this.vb.length&&(this.Hb=
0,this.Ec=!1)};e.prototype.jG=function(){this.Rj();this.zt=!0;null==this.vb?(this.Wm=new a.ga(0),this.vb=[]):(this.Wm.cf(0),this.vb.length=0)};e.prototype.OA=function(d,g){if(!this.zt)throw a.g.xa();var e=new a.i;e.K(g);this.Wm.add(d);this.vb.push(e)};e.prototype.$B=function(){if(!this.zt)throw a.g.xa();this.zt=!1;null!=this.vb&&0<this.vb.length&&null!=this.Zc&&0<this.Zc.length&&(-1==this.Hb?this.Hb=3:2==this.Hb?this.Hb=3:3!=this.Hb&&(this.Hb=1),this.Ec=!1)};e.prototype.iG=function(){this.Rj();this.yt=
!0;null==this.Zc?(this.Nt=new a.ga(0),this.Zc=[]):(this.Nt.cf(0),this.Zc.length=0)};e.prototype.LA=function(d,g){if(!this.yt)throw a.g.xa();var e=new a.i;e.K(g);this.Nt.add(d);this.Zc.push(e)};e.prototype.ZB=function(){if(!this.yt)throw a.g.xa();this.yt=!1;null!=this.vb&&0<this.vb.length&&null!=this.Zc&&0<this.Zc.length&&(-1==this.Hb?this.Hb=3:1==this.Hb?this.Hb=3:3!=this.Hb&&(this.Hb=2),this.Ec=!1)};e.prototype.next=function(){if(this.Ec)return!1;for(var d=!0;d;)switch(this.Hb){case 0:d=this.Qw();
break;case 1:d=this.yO();break;case 2:d=this.vO();break;case 3:d=this.xO();break;case 4:d=this.LS();break;case 5:d=this.HS();break;case 6:d=this.IS();break;case 7:d=this.JS();break;case 8:d=this.Qu();break;case 9:d=this.Wy();break;case 10:d=this.$w();break;case 11:d=this.iP();break;case 12:d=this.fP();break;case 13:d=this.gP();break;case 14:d=this.hP();break;case 15:d=this.hF();break;case 16:d=this.gF();break;default:throw a.g.wa();}return this.Ec?!1:!0};e.prototype.YF=function(d){this.ka=d};e.prototype.Fw=
function(d){return this.vb[d]};e.prototype.jw=function(d){return this.Zc[d]};e.prototype.jk=function(d){return this.Wm.read(d)};e.prototype.ek=function(d){return this.Nt.read(d)};e.Cv=function(d){return 1==(d&1)};e.Yk=function(d){return 0==(d&1)};e.prototype.Rj=function(){this.At=this.yt=this.zt=!1;this.pf=this.qf=this.tg=this.ae=-1;this.Ec=!0};e.prototype.Qw=function(){this.mf=this.Ff=-1;if(10>this.vb.length)return this.ae=this.vb.length,this.Hb=5,!0;null==this.ad&&(this.ad=new a.bq(!0),this.cn=
this.ad.Re(),this.ud=new a.ga(0));this.ad.Vp();for(var d=0;d<this.vb.length;d++){var g=this.vb[d];this.ad.gq(g.v,g.B)}this.ad.wo();this.ud.xb(2*this.vb.length);this.ud.resize(0);for(d=0;d<2*this.vb.length;d++)this.ud.add(d);this.Lr(this.ud,2*this.vb.length,!0);this.ae=2*this.vb.length;this.Hb=4;return!0};e.prototype.yO=function(){this.mf=this.Ff=-1;if(10>this.vb.length||10>this.Zc.length)return this.ae=this.vb.length,this.Hb=6,!0;null==this.ad&&(this.ad=new a.bq(!0),this.cn=this.ad.Re(),this.ud=new a.ga(0));
this.ad.Vp();for(var d=0;d<this.vb.length;d++){var g=this.vb[d];this.ad.gq(g.v,g.B)}this.ad.wo();this.ud.xb(2*this.vb.length);this.ud.resize(0);for(d=0;d<2*this.vb.length;d++)this.ud.add(d);this.Lr(this.ud,this.ud.size,!0);this.ae=this.ud.size;-1!=this.qf&&(this.od.Fg(this.qf),this.Ni.resize(0),this.qf=-1);this.Hb=7;return this.gF()};e.prototype.vO=function(){this.mf=this.Ff=-1;if(10>this.vb.length||10>this.Zc.length)return this.ae=this.vb.length,this.Hb=6,!0;null==this.Ve&&(this.Ve=new a.bq(!0),
this.Vt=this.Ve.Re(),this.rf=new a.ga(0));this.Ve.Vp();for(var d=0;d<this.Zc.length;d++){var g=this.Zc[d];this.Ve.gq(g.v,g.B)}this.Ve.wo();this.rf.xb(2*this.Zc.length);this.rf.resize(0);for(d=0;d<2*this.Zc.length;d++)this.rf.add(d);this.Lr(this.rf,this.rf.size,!1);this.tg=this.rf.size;-1!=this.pf&&(this.od.Fg(this.pf),this.Mi.resize(0),this.pf=-1);this.Hb=7;return this.hF()};e.prototype.xO=function(){this.mf=this.Ff=-1;if(10>this.vb.length||10>this.Zc.length)return this.ae=this.vb.length,this.Hb=
6,!0;null==this.ad&&(this.ad=new a.bq(!0),this.cn=this.ad.Re(),this.ud=new a.ga(0));null==this.Ve&&(this.Ve=new a.bq(!0),this.Vt=this.Ve.Re(),this.rf=new a.ga(0));this.ad.Vp();for(var d=0;d<this.vb.length;d++){var g=this.vb[d];this.ad.gq(g.v,g.B)}this.ad.wo();this.Ve.Vp();for(d=0;d<this.Zc.length;d++)g=this.Zc[d],this.Ve.gq(g.v,g.B);this.Ve.wo();this.ud.xb(2*this.vb.length);this.rf.xb(2*this.Zc.length);this.ud.resize(0);this.rf.resize(0);for(d=0;d<2*this.vb.length;d++)this.ud.add(d);for(d=0;d<2*this.Zc.length;d++)this.rf.add(d);
this.Lr(this.ud,this.ud.size,!0);this.Lr(this.rf,this.rf.size,!1);this.ae=this.ud.size;this.tg=this.rf.size;-1!=this.qf&&(this.od.Fg(this.qf),this.Ni.resize(0),this.qf=-1);-1!=this.pf&&(this.od.Fg(this.pf),this.Mi.resize(0),this.pf=-1);this.Hb=7;return!0};e.prototype.LS=function(){var d=this.ud.get(--this.ae),g=d>>1;if(e.Yk(d))return this.ad.remove(g),0==this.ae?(this.mf=this.Ff=-1,this.Ec=!0,!1):!0;this.cn.uy(this.vb[g].v,this.vb[g].B,this.ka);this.Ff=g;this.Hb=10;return!0};e.prototype.HS=function(){if(-1==
--this.ae)return this.mf=this.Ff=-1,this.Ec=!0,!1;this.tg=this.Ff=this.ae;this.Hb=13;return!0};e.prototype.IS=function(){if(-1==--this.ae)return this.mf=this.Ff=-1,this.Ec=!0,!1;this.Ff=this.ae;this.tg=this.Zc.length;this.Hb=14;return!0};e.prototype.JS=function(){var d=this.ud.get(this.ae-1),g=this.rf.get(this.tg-1),m=this.pq(d,!0),a=this.pq(g,!1);return m>a?this.Qu():m<a?this.Wy():e.Cv(d)?this.Qu():e.Cv(g)?this.Wy():this.Qu()};e.prototype.Qu=function(){var d=this.ud.get(--this.ae),g=d>>1;if(e.Yk(d))return-1!=
this.qf&&-1!=this.Ni.get(g)?(this.od.Jc(this.qf,this.Ni.get(g)),this.Ni.set(g,-1)):this.ad.remove(g),0==this.ae?(this.mf=this.Ff=-1,this.Ec=!0,!1):!0;if(-1!=this.pf&&0<this.od.vq(this.pf))for(d=this.od.gc(this.pf);-1!=d;){var m=this.od.getData(d);this.Ve.lg(m);this.Mi.set(m,-1);m=this.od.bb(d);this.od.Jc(this.pf,d);d=m}0<this.Ve.size()?(this.Vt.uy(this.vb[g].v,this.vb[g].B,this.ka),this.Ff=g,this.Hb=12):(-1==this.qf&&(null==this.od&&(this.od=new a.$n),this.Ni=new a.ga(0),this.Ni.resize(this.vb.length,
-1),this.Ni.dh(-1,0,this.vb.length),this.qf=this.od.jh(1)),this.Ni.set(g,this.od.addElement(this.qf,g)),this.Hb=7);return!0};e.prototype.Wy=function(){var d=this.rf.get(--this.tg),g=d>>1;if(e.Yk(d))return-1!=this.pf&&-1!=this.Mi.get(g)?(this.od.Jc(this.pf,this.Mi.get(g)),this.Mi.set(g,-1)):this.Ve.remove(g),0==this.tg?(this.mf=this.Ff=-1,this.Ec=!0,!1):!0;if(-1!=this.qf&&0<this.od.vq(this.qf))for(d=this.od.gc(this.qf);-1!=d;){var m=this.od.getData(d);this.ad.lg(m);this.Ni.set(m,-1);m=this.od.bb(d);
this.od.Jc(this.qf,d);d=m}0<this.ad.size()?(this.cn.uy(this.Zc[g].v,this.Zc[g].B,this.ka),this.mf=g,this.Hb=11):(-1==this.pf&&(null==this.od&&(this.od=new a.$n),this.Mi=new a.ga(0),this.Mi.resize(this.Zc.length,-1),this.Mi.dh(-1,0,this.Zc.length),this.pf=this.od.jh(0)),this.Mi.set(g,this.od.addElement(this.pf,g)),this.Hb=7);return!0};e.prototype.$w=function(){this.mf=this.cn.next();if(-1!=this.mf)return!1;var d=this.ud.get(this.ae)>>1;this.ad.lg(d);this.Hb=4;return!0};e.prototype.iP=function(){this.Ff=
this.cn.next();if(-1!=this.Ff)return!1;this.mf=this.Ff=-1;var d=this.rf.get(this.tg)>>1;this.Ve.lg(d);this.Hb=7;return!0};e.prototype.fP=function(){this.mf=this.Vt.next();if(-1!=this.mf)return!1;var d=this.ud.get(this.ae)>>1;this.ad.lg(d);this.Hb=7;return!0};e.prototype.gP=function(){if(-1==--this.tg)return this.Hb=5,!0;this.fp.K(this.vb[this.ae]);var d=this.vb[this.tg];this.fp.P(this.ka,this.ka);return this.fp.jc(d)?(this.mf=this.tg,!1):!0};e.prototype.hP=function(){if(-1==--this.tg)return this.Hb=
6,!0;this.fp.K(this.vb[this.ae]);var d=this.Zc[this.tg];this.fp.P(this.ka,this.ka);return this.fp.jc(d)?(this.mf=this.tg,!1):!0};e.prototype.hF=function(){if(null==this.ad)return this.Ec=!0,!1;this.ae=this.ud.size;0<this.ad.size()&&this.ad.reset();-1!=this.qf&&(this.od.Fg(this.qf),this.Ni.resize(0),this.qf=-1);this.Ec=!1;return!0};e.prototype.gF=function(){if(null==this.Ve)return this.Ec=!0,!1;this.tg=this.rf.size;0<this.Ve.size()&&this.Ve.reset();-1!=this.pf&&(this.od.Fg(this.pf),this.Mi.resize(0),
this.pf=-1);this.Ec=!1;return!0};e.prototype.Lr=function(d,g,e){null==this.Al&&(this.Al=new a.Rr);e=new b(this,e);this.Al.sort(d,0,g,e)};e.prototype.BS=function(d,g,m,a){var h=this;d.xd(g,m,function(d,g){var m=h.pq(d,a),u=h.pq(g,a);return m<u||m==u&&e.Yk(d)&&e.Cv(g)?-1:1})};e.prototype.pq=function(d,g){var m=.5*this.ka;if(g)return g=this.vb[d>>1],m=e.Yk(d)?g.C-m:g.G+m;g=this.Zc[d>>1];return m=e.Yk(d)?g.C-m:g.G+m};return e}();a.sz=h})(A||(A={}));(function(a){var h=function(){function h(){}h.Oa=function(e,
d,g,m,a,b){var u=new h;u.v=e;u.C=d;u.Je=g;u.B=m;u.G=a;u.ig=b;return u};h.prototype.Ja=function(){this.Je=this.v=NaN};h.prototype.s=function(){return isNaN(this.v)};h.prototype.UO=function(){return isNaN(this.Je)};h.prototype.K=function(e,d,g,m,a,h){void 0!==m?"number"===typeof e?(this.v=e,this.C=d,this.Je=g,this.B=m,this.G=a,this.ig=h):(this.v=e.x-.5*d,this.B=this.v+d,this.C=e.y-.5*g,this.G=this.C+g,this.Je=e.z-.5*m,this.ig=this.Je+m):(this.v=e,this.C=d,this.Je=g,this.B=e,this.G=d,this.ig=g)};h.prototype.move=
function(e){this.v+=e.x;this.C+=e.y;this.Je+=e.z;this.B+=e.x;this.G+=e.y;this.ig+=e.z};h.prototype.copyTo=function(e){e.v=this.v;e.C=this.C;e.B=this.B;e.G=this.G};h.prototype.Oj=function(e,d,g){this.v>e?this.v=e:this.B<e&&(this.B=e);this.C>d?this.C=d:this.G<d&&(this.G=d);0==isNaN(this.Je)?this.Je>g?this.Je=g:this.ig<g&&(this.ig=g):this.ig=this.Je=g};h.prototype.Db=function(e,d,g,m,u,b){if("number"===typeof e)m?(this.Db(e,d,g),this.Db(m,u,b)):this.s()?(this.v=e,this.C=d,this.Je=g,this.B=e,this.G=d,
this.ig=g):this.Oj(e,d,g);else if(e instanceof a.ee)this.Db(e.x,e.y,e.z);else if(e instanceof h)e.s()||(this.Db(e.v,e.C,e.Je),this.Db(e.B,e.G,e.ig));else throw a.g.N();};h.prototype.Oa=function(e,d,g){e.s()||d.s()?this.Ja():(this.v=e.qa,this.B=e.va,this.C=d.qa,this.G=d.va,this.Je=g.qa,this.ig=g.va)};h.prototype.hy=function(e){if(null==e||8>e.length)throw a.g.N();e[0]=new a.ee(this.v,this.C,this.Je);e[1]=new a.ee(this.v,this.G,this.Je);e[2]=new a.ee(this.B,this.G,this.Je);e[3]=new a.ee(this.B,this.C,
this.Je);e[4]=new a.ee(this.v,this.C,this.ig);e[5]=new a.ee(this.v,this.G,this.ig);e[6]=new a.ee(this.B,this.G,this.ig);e[7]=new a.ee(this.B,this.C,this.ig)};h.prototype.Ey=function(e){if(null==e||0==e.length)this.Ja();else{var d=e[0];this.K(d.x,d.y,d.z);for(d=1;d<e.length;d++){var g=e[d];this.Oj(g.x,g.y,g.z)}}};return h}();a.fH=h})(A||(A={}));(function(a){(function(a){a.wa=function(){var a=Error();a.message="Internal Error";return a};a.qe=function(){var a=Error();a.message="Not Implemented";return a};
a.cj=function(){var a=Error();a.message="The input unit and the spatial reference unit are not of the same unit type.ie Linear vs.Angular";return a};a.xa=function(){var a=Error();a.message="Invalid Call";return a};a.N=function(a){var e=Error();e.message="Illegal Argument Exception";void 0!==a&&(e.message+=": "+a);return e};a.BI=function(){var a=Error();a.message="Runtime Exception.";return a};a.ra=function(a){var e=Error();e.message="Geometry Exception: "+a;return e};a.PG=function(){var a=Error();
a.message="Assert Failed Exception";return a};a.Uc=function(){var a=Error();a.message="IndexOutOfBoundsException";return a};a.aU=function(a){a.message="UserCancelException";return a}})(a.g||(a.g={}))})(A||(A={}));(function(a){var h=function(){function d(d,e){this.Ma=d;this.hE=e;this.kE=-1;this.rk=!1}d.prototype.next=function(){if(++this.kE==this.hE.F())return null;var d=this.hE.Fa(this.kE);d.scale(this.Ma.Rb);var e=new a.Ka;this.Ma.Iv(d,this.rk,e);return e};d.prototype.ya=function(){return 0};return d}(),
b=function(){function d(d,e,h){this.Ma=d;this.Zt=e;this.Om=!1;this.Um=h;this.Mt=[0];this.zj=[0];this.Qi=[0];this.Sq=[0];this.rk=!1;this.$o=new a.Ka;this.Bj=[]}d.prototype.next=function(){if(this.Om){this.Om=!1;this.bd.ia();var d=a.T.Yj(this.$o);return d=a.Of.Qj(d,this.Ma.jp,!0,!0,this.Ma.Yb)}null==this.bd&&(this.bd=this.Zt.Ca(),this.bd.kb(),null!=this.Um&&this.Um.lo());if(!this.bd.La()){if(!this.bd.kb())return null;null!=this.Um&&this.Um.lo()}d=null;this.zj[0]=0;this.Fx=this.Mt[0]=0;this.uh=NaN;this.Om=
!1;for(var m=this.Bj.length=0,h=new a.b,b=new a.b,c=[0];this.bd.La()&&8>this.Fx;){var p=this.bd.ia();h.J(p.Mb());b.J(p.oc());h.scale(this.Ma.Rb);b.scale(this.Ma.Rb);a.ui.Hs(h,b)?h.x=b.x:a.ui.Fs(h,b)&&(b.x=h.x);this.Bj.length=0;a.ui.kC(this.Ma.Gb,this.Ma.Xb,this.Ma.ke,h,b,this.Ma.Nx,this.Ma.hr,c,this.Qi,this.Sq,this.Bj,this.Mt);null!=this.Um&&(p=this.Bj.slice(0),this.Um.dD(this.Um.ea()-1,p,p.length-1));a.ui.Gs(h,b)?(this.$o.Ja(),this.Ma.Iv(h,this.rk,this.$o),this.Om=!0):(this.$o.Ja(),this.Om=this.Lv(c[0],
this.$o));if(this.Om){this.bd.oi();if(this.bd.Ow()){this.bd.oi();this.bd.ia();break}this.bd.yR();break}null==d&&(d=new a.Ka,d.lo());this.TA(d);m++}this.Mt[0]=0;if(0<m){for(c=this.bd.Jb();0<m;)this.bd.oi(),h.J(this.Zt.Fa(this.bd.Jb())),b.J(this.Zt.Fa(this.bd.Bm())),h.scale(this.Ma.Rb),b.scale(this.Ma.Rb),this.rk&&(a.ui.Hs(h,b)?h.x=b.x:a.ui.Fs(h,b)&&(b.x=h.x)),this.Bj.length=0,a.ui.kC(this.Ma.Gb,this.Ma.Xb,this.Ma.ke,b,h,this.Ma.Nx,this.Ma.hr,null,this.Qi,this.Sq,this.Bj,this.Mt),this.TA(d),m--;h.J(this.Zt.Fa(this.bd.Jb()));
h.scale(this.Ma.Rb);e.kq(this.Ma.Gb,this.Ma.Xb,this.Ma.Rb,this.Ma.hb,h,this.uh+1.570796326794897,this.uh+4.71238898038469,this.Ma.Sm,this.rk,this.zj,d,NaN,NaN);this.bd.Sb(c);this.bd.ia();m=a.Ia.Cg(null,d,!0);return d=a.Of.Qj(d,m,!0,!0,this.Ma.Yb)}this.Om=!1;this.bd.ia();d=a.T.Yj(this.$o);return d=a.Of.Qj(d,this.Ma.jp,!0,!0,this.Ma.Yb)};d.prototype.TA=function(d){var g=this.Bj[0],h,b=this.Qi[0]-1.570796326794897,c=this.Sq[0]+1.570796326794897,p;if(!isNaN(this.uh)){this.uh>=this.Qi[0]?(h=this.uh+1.570796326794897,
b=h+3.141592653589793-(this.uh-this.Qi[0])):(h=this.uh+1.570796326794897,b=h+3.141592653589793-(6.283185307179586-(this.Qi[0]-this.uh)));p=this.uh>=this.Qi[0]&&3.141592653589793>=this.uh-this.Qi[0]?!1:this.uh<this.Qi[0]&&3.141592653589793<=this.Qi[0]-this.uh?!1:!0;var f=!1;if(Math.abs(b-h)<=.5*this.Ma.Sm)if(p){var l=d.Fa(d.F()-2);l.scale(this.Ma.Rb);var q=new a.ca(0);a.zb.gw(this.Ma.Gb,this.Ma.Xb,g.x,g.y,l.x,l.y,q);for(l=q.l;l<=h;)l+=6.283185307179586;for(;l>h;)l-=6.283185307179586;l<b&&(f=!0)}else f=
!0;f?(d.eF(0,d.F()-1),this.rk||(g=new a.b,g.J(d.Fa(d.F()-1)),g.scale(this.Ma.Rb),-3.141592653589793>g.x-this.zj[0]?this.zj[0]-=6.283185307179586:3.141592653589793<g.x-this.zj[0]&&(this.zj[0]+=6.283185307179586)),p||(b=.5*(b+h))):(p?(h=new a.b,h.J(g),h.scale(1/this.Ma.Rb),d.kf(0,-1,h)):e.kq(this.Ma.Gb,this.Ma.Xb,this.Ma.Rb,this.Ma.hb,this.Bj[0],h,b,this.Ma.Sm,this.rk,this.zj,d,NaN,NaN),this.Fx+=1)}e.Hv(this.Ma.Gb,this.Ma.Xb,this.Ma.Rb,this.Ma.hb,this.Ma.ke,this.Bj,b,c,this.rk,this.zj,d);this.uh=this.Sq[0]};
d.prototype.Lv=function(d,e){return this.Ma.Lv(this.Bj,d,this.Qi[0],this.Sq[0],this.rk,e)};d.prototype.ya=function(){return 0};return d}(),e=function(){function d(){}d.buffer=function(g,e,h,b,c,p){if(null==g)throw a.g.N("Geometry::Geodesic_bufferer::buffer");if(g.s())return new a.Ka(g.description);var m=new d;m.sg=e;m.wc=a.Ya.Em(e);var u=a.Ya.ft(m.wc);m.Yb=p;m.Gb=a.Ya.Ts(m.wc);m.Xb=u*(2-u);m.Rb=m.wc.Se().Dj;m.ka=m.sg.xq();m.jp=m.wc.xq();m.hr=m.jp*m.Rb;m.ip=1.570796326794897/m.Rb;m.rU=3.141592653589793/
m.Rb;m.Uq=6.283185307179586/m.Rb;m.sU=m.Uq/6;m.Ix=0;m.qU=1.5707963267948966*m.Gb/m.Ix;4==h?(m.ke=2,m.Gt=!0):(m.ke=h,m.Gt=!1);m.Da=b;m.hb=Math.abs(b);isNaN(c)||.001>c?m.sS():m.Rm=c;h=g.D();a.T.Lc(h)?(h=new a.Xa(g.description),h.Bc(g,!0),g=h,h=1607):197==h&&(h=new a.i,g.o(h),h.aa()<=m.ka||h.ba()<=m.ka?(h=new a.Xa(g.description),h.Wc(g,!1),g=h,h=1607):(h=new a.Ka(g.description),h.Wc(g,!1),g=h,h=1736));m.tS();a.T.Km(h)||m.uS();if(m.hb<=.5*m.Rm)return 1736!=h?new a.Ka(g.description):m.Gt?g:a.ui.oq(g,m.sg,
m.ke,m.Nx,-1,p);if(0>m.Da&&1736!=h)return new a.Ka(g.description);m.Gt&&a.T.Kc(h)?(e=a.ui.oq(g,e,4,NaN,m.Rm,p),g=a.Ya.Wl(e,m.sg,m.wc)):g=a.Ya.Wl(g,m.sg,m.wc);g=a.gh.qo(g,m.wc);if(g.s())return new a.Ka(g.description);!m.Gt&&a.T.Kc(h)&&(g=a.ui.IE(m.Rb,g));g=d.PS(g,m.wc);switch(h){case 1736:e=m.yK(g);break;case 1607:e=m.zK(g);break;case 550:e=m.wK(g);break;case 33:e=m.xK(g);break;default:throw a.g.ra("corrupted_geometry");}m=a.Ya.Wl(e,m.wc,m.sg);m.Ik(g.description);return m};d.prototype.yK=function(d){var g=
new a.Ka;d=new b(this,d,g);d=a.wi.local().$(d,this.wc,this.Yb).next();d=a.Vn.nl(d,this.wc,2);var e=new a.Bg;e.scale(1/this.Rb,1/this.Rb);g.Oe(e);g=a.Vn.nl(g,this.wc,2);return 0<=this.Da?a.wi.local().$(g,d,this.wc,this.Yb):a.Zr.local().$(g,d,this.wc,this.Yb)};d.prototype.zK=function(d){d=new b(this,d,null);d=a.wi.local().$(d,this.wc,this.Yb).next();return d=a.Vn.nl(d,this.wc,2)};d.prototype.wK=function(d){d=new h(this,d);d=a.wi.local().$(d,this.wc,this.Yb).next();return d=a.Vn.nl(d,this.wc,2)};d.prototype.xK=
function(d){d=d.w();d.scale(this.Rb);var g=new a.Ka;this.Iv(d,!1,g);return g=a.Vn.nl(g,this.wc,2)};d.prototype.Lv=function(g,e,h,b,c,p){var m=g[0],u=g[g.length-1],C=m.y>u.y?m.y:u.y,f=a.u.q(this.Gb,this.Xb,m.y<u.y?m.y:u.y),C=a.u.q(this.Gb,this.Xb,C);if(.001<this.Ix-(f+e+this.hb)&&.001<this.Ix+(C-e-this.hb))return!1;e=h-1.570796326794897;h=b+1.570796326794897;var f=e-3.141592653589793,C=e+3.141592653589793,l=h+3.141592653589793,q=[NaN],n=[NaN],M=[NaN],z=[NaN];b=!1;d.wG(this.Gb,this.Xb,this.hb,m,e,f,
u,h,q,n);d.wG(this.Gb,this.Xb,this.hb,u,l,h,m,f,M,z);h<q[0]&&q[0]<l?b=!0:h<n[0]&&n[0]<l&&(b=!0);b||(f<M[0]&&M[0]<e?b=!0:f<z[0]&&z[0]<e&&(b=!0));if(!b&&c)return!1;for(var k=[],t=g.length-1;0<=t;t--)k.push(g[t]);p.Ja();p.lo();t=[0];d.Hv(this.Gb,this.Xb,this.Rb,this.hb,this.ke,g,e,h,c,t,p);d.kq(this.Gb,this.Xb,this.Rb,this.hb,u,h,l,this.Sm,c,t,p,q[0],n[0]);d.Hv(this.Gb,this.Xb,this.Rb,this.hb,this.ke,k,l,C,c,t,p);d.kq(this.Gb,this.Xb,this.Rb,this.hb,m,f,e,this.Sm,c,t,p,M[0],z[0]);g=!1;c||(g=this.zB(this.Rb,
p));return b||g};d.prototype.Iv=function(g,e,a){a.Ja();a.lo();d.kq(this.Gb,this.Xb,this.Rb,this.hb,g,-this.Sm,6.283185307179586,this.Sm,e,[0],a,NaN,NaN);e||this.zB(this.Rb,a)};d.prototype.zB=function(d,e){var g=this.XK(d,e);d=this.YK(d,e);return g||d};d.prototype.XK=function(d,e){var g=e.F(),m=!1,h=new a.i;e.o(h);if(!a.j.S(h.G*d,1.570796326794897)&&!a.j.S(h.C*d,-1.570796326794897))return!1;for(var b=new a.b,g=g-1;0<=g;g--)e.w(g,b),b.y==h.G&&a.j.S(b.y*d,1.570796326794897)?(m=!0,this.RE(b,g,e)):b.y==
h.C&&a.j.S(b.y*d,-1.570796326794897)&&(m=!0,this.RE(b,g,e));return m};d.prototype.YK=function(d,e){var g=e.Fa(0),a=e.Fa(e.F()-1);return 3.141592653589793<Math.abs(g.x-a.x)*d?(this.RQ(e),!0):this.WK(e)};d.prototype.WK=function(d){return 0>d.Mh()?(this.QQ(d),!0):!1};d.prototype.RE=function(d,e,h){var g=h.F(),m=0<e?e-1:g-1,g=h.Fa(e<g-1?e+1:0),m=h.Fa(m);if(!a.j.S(g.y,d.y)&&!a.j.S(g.x,d.x)){var u=new a.b;u.ma(g.x,d.y);h.ic(e,u)}a.j.S(m.y,d.y)||a.j.S(m.x,d.x)||(g=new a.b,g.ma(m.x,d.y),h.kf(0,e,g))};d.prototype.RQ=
function(d){var g=new a.Ka,e=new a.Ka,h=new a.Bg,b=d.Fa(0),c=d.Fa(d.F()-1),p=new a.b;b.x>c.x?(c=this.ip,h.Nn(-this.Uq,0)):(c=-this.ip,h.Nn(this.Uq,0));g.add(d,!1);d.Ja();e.add(g,!1);e.Oe(h);b=new a.i;e.o(b);b.P((this.Uq-b.aa())/2,0);b.C=-this.ip;b.G=this.ip;for(var f=0;f<e.F();f++)e.w(f,p),g.kf(0,-1,p);e.Oe(h);for(f=0;f<e.F();f++)e.w(f,p),g.kf(0,-1,p);e=g.Fa(0);h=g.Fa(g.F()-1);p.ma(h.x,c);g.kf(0,-1,p);p.ma(.5*(h.x+e.x),c);g.kf(0,-1,p);p.ma(e.x,c);g.kf(0,-1,p);g=a.gh.Rw(g,this.wc,2,b.v);g=a.gh.Rw(g,
this.wc,2,b.B);g=a.Ed.clip(g,b,this.jp,NaN);d.add(g,!1)};d.prototype.QQ=function(d){var g=new a.i;d.o(g);g.P((this.Uq-g.aa())/2,0);g.C=-this.ip;g.G=this.ip;d.lo();var e=new a.b;e.ma(g.v,g.C);d.kf(1,-1,e);e.ma(g.v,g.G);d.kf(1,-1,e);e.ma(.5*(g.v+g.B),g.G);d.kf(1,-1,e);e.ma(g.B,g.G);d.kf(1,-1,e);e.ma(g.B,g.C);d.kf(1,-1,e);e.ma(.5*(g.v+g.B),g.C);d.kf(1,-1,e)};d.Hv=function(g,e,h,b,c,p,f,l,q,n,z){var m=null;q||(m=new a.b,m.Eh(),0<z.F()&&(m.J(z.Fa(z.F()-1)),m.scale(h)));var u=new a.ca(0),C=new a.ca(0),
M=new a.ca(0),k=new a.b,t=new a.b,A=p[p.length-1];h=1/h;for(var v=0;v<p.length;v++){var w=p[v],y;0==v?y=f:v==p.length-1?y=l:(a.zb.Rd(g,e,A.x,A.y,w.x,w.y,null,null,u,c),y=u.l-1.570796326794897);a.zb.Ph(g,e,w.x,w.y,b,y,C,M);q?t.ma(C.l,M.l):(k.ma(C.l,M.l),d.Gz(w.x,k.x,m.x,n),t.ma(n[0]+k.x,k.y),m.J(t));t.scale(h);z.kf(0,-1,t)}};d.kq=function(g,e,h,b,c,p,f,l,q,n,z,k,t){if(!(f-p<l)){var m=new a.ca(0),u=new a.ca(0),C=new a.b,M=new a.b,v=null;q||(v=new a.b,v.Eh(),0<z.F()&&(v.J(z.Fa(z.F()-1)),v.scale(h)));
var A=a.I.truncate(Math.ceil(p/l)),w=A++*l;w==p&&(w=A++*l);for(h=1/h;w<f+l;){p<k&&k<w?(w=k,A--):p<t&&t<w&&(w=t,A--);if(w>=f)break;a.zb.Ph(g,e,c.x,c.y,b,w,m,u);q?M.ma(m.l,u.l):(C.ma(m.l,u.l),d.Gz(c.x,C.x,v.x,n),M.ma(n[0]+C.x,C.y),v.J(M));M.scale(h);z.kf(0,-1,M);p=w;w=A++*l}}};d.wG=function(d,e,h,b,c,p,f,l,q,n){var g=new a.b,m=new a.b,u=new a.ca(0),C=new a.ca(0);a.zb.Ph(d,e,b.x,b.y,h,c,u,C);g.ma(u.l,C.l);a.zb.Ph(d,e,b.x,b.y,h,p,u,C);m.ma(u.l,C.l);h=new a.ca(0);a.zb.gw(d,e,f.x,f.y,g.x,g.y,h);q[0]=h.l;
a.zb.gw(d,e,f.x,f.y,m.x,m.y,h);for(n[0]=h.l;q[0]<=n[0];)q[0]+=6.283185307179586;for(;q[0]>n[0];)q[0]-=6.283185307179586;for(;q[0]>=l;)q[0]-=6.283185307179586,n[0]-=6.283185307179586;for(;q[0]<l;)q[0]+=6.283185307179586,n[0]+=6.283185307179586};d.Gz=function(d,e,a,h){if(isNaN(a)){for(;3.141592653589793<h[0]+e-d;)h[0]-=6.283185307179586;for(;3.141592653589793<d-(h[0]+e);)h[0]+=6.283185307179586}else 3.141592653589793<h[0]+e-a?h[0]-=6.283185307179586:3.141592653589793<a-(h[0]+e)&&(h[0]+=6.283185307179586)};
d.PS=function(d,e){var g=d.D(),m;a.T.Kc(g)?m=d.ea():550==g?m=d.F():m=1;if(1==m)return d;var h=new a.ga(0);h.resize(m);for(var b=[],c=new a.i,p=0;p<m;p++){h.write(p,p);var f;a.T.Kc(g)?(d.Ti(p,c),f=c.Af()):f=d.Fa(p);f=a.qH.QS(e,f);b[p]=f}h.xd(0,h.size,function(d,g){return b[d]<b[g]?-1:b[d]>b[g]?1:0});c=d.Pa();for(p=0;p<m;p++)f=h.read(p),a.T.Kc(g)?c.Zj(d,f,!0):c.Pd(d,f,f+1);return c};d.prototype.tS=function(){var d=Math.min(3.141592653589793*this.Gb-this.hb,this.hb),d=Math.min(d,.39269908169872414*this.Gb),
e=new a.b;e.ma(0,10*this.Rb);var h=45*this.Rb,b=new a.ca(0),c=new a.ca(0),p=new a.ca(0),f=new a.ca(0),l=new a.ca(0),q=new a.ca(0),n=new a.ca(0),z=new a.ca(0),k=new a.b,t=new a.b,v=new a.b,A=new a.b;a.zb.Ph(this.Gb,this.Xb,e.x,e.y,d,0,b,c);k.ma(b.l,c.l);a.zb.Ph(this.Gb,this.Xb,e.x,e.y,d,h,p,f);t.ma(p.l,f.l);for(var b=new a.ca(0),c=new a.ca(0),w=new a.ca(0);;){a.zb.Ph(this.Gb,this.Xb,e.x,e.y,d,.5*(0+h),l,q);v.ma(l.l,q.l);a.zb.Rd(this.Gb,this.Xb,k.x,k.y,t.x,t.y,b,c,null,2);a.zb.dk(this.Gb,this.Xb,k.x,
k.y,.5*b.l,c.l,n,z,2);A.ma(n.l,z.l);a.zb.Rd(this.Gb,this.Xb,v.x,v.y,A.x,A.y,w,null,null,2);if(w.l<=this.Rm)break;h*=.9;a.zb.Ph(this.Gb,this.Xb,e.x,e.y,d,h,p,f);t.ma(p.l,f.l)}this.Sm=6.283185307179586/Math.ceil(6.283185307179586/(h-0))};d.prototype.uS=function(){var d=Math.min(3.141592653589793*this.Gb-this.hb,this.hb),d=Math.min(d,.39269908169872414*this.Gb),e=new a.b,h=new a.b;e.ma(0,10*this.Rb);h.ma(10*this.Rb,10*this.Rb);var b=new a.ca(0),c=new a.ca(0),p=new a.ca(0);a.zb.Rd(this.Gb,this.Xb,e.x,
e.y,h.x,h.y,p,b,c,this.ke);var f=new a.ca(0),l=new a.ca(0),q=new a.ca(0),n=new a.ca(0),z=new a.b,k=new a.ca(0),t=new a.ca(0),v=new a.ca(0),A=new a.ca(0),w=new a.ca(0),y=new a.ca(0),D=new a.ca(0),B=new a.ca(0),F=new a.ca(0),J=new a.b,Q=new a.b,G=new a.b,I=new a.b,r=1,b=b.l,c=c.l+1.570796326794897,p=p.l;a.zb.Ph(this.Gb,this.Xb,e.x,e.y,d,b-1.570796326794897,t,v);J.ma(t.l,v.l);a.zb.Ph(this.Gb,this.Xb,h.x,h.y,d,c,A,w);Q.ma(A.l,w.l);for(var t=new a.ca(0),v=new a.ca(0),c=new a.ca(0),K=new a.ca(0);;){a.zb.dk(this.Gb,
this.Xb,e.x,e.y,.5*(0+r)*p,b,f,l,this.ke);z.ma(f.l,l.l);a.zb.Rd(this.Gb,this.Xb,e.x,e.y,z.x,z.y,null,null,k,this.ke);a.zb.Ph(this.Gb,this.Xb,z.x,z.y,d,k.l+1.570796326794897,y,D);G.ma(y.l,D.l);a.zb.Rd(this.Gb,this.Xb,J.x,J.y,Q.x,Q.y,t,v,null,2);a.zb.dk(this.Gb,this.Xb,J.x,J.y,.5*t.l,v.l,B,F,2);I.ma(B.l,F.l);a.zb.Rd(this.Gb,this.Xb,G.x,G.y,I.x,I.y,c,null,null,2);if(c.l<=this.Rm)break;r*=.9;a.zb.dk(this.Gb,this.Xb,e.x,e.y,r*p,b,q,n,this.ke);h.ma(q.l,n.l);a.zb.Rd(this.Gb,this.Xb,e.x,e.y,h.x,h.y,null,
null,K,this.ke);a.zb.Ph(this.Gb,this.Xb,h.x,h.y,d,K.l+1.570796326794897,A,w);Q.ma(A.l,w.l)}d=r*p;1E5<d&&(d=1E5);this.Nx=d};d.prototype.sS=function(){var d;d=5E4<this.hb?100:1E4<this.hb?10:1;500>this.hb/d&&(d=this.hb/500);.01>d&&(d=.01);this.Rm=d};return d}();a.pH=e})(A||(A={}));(function(a){var h=function(){function h(){}h.ac=function(e,d){var g=new a.b;g.J(d);e.push(g)};h.$i=function(e,d){e.add(d.x);e.add(d.y)};h.cx=function(e){e.cf(e.size-2)};h.cy=function(e,d){d.ma(e.get(e.size-2),e.get(e.size-
1))};h.oq=function(e,d,g,m,u,b){if(null==e)throw a.g.N();var c=e.D();if(e.s()||a.T.Km(c))return e;var C=new h;C.sg=d;C.wc=a.Ya.Em(d);var p=a.Ya.ft(C.wc);C.Yb=b;C.Gb=a.Ya.Ts(C.wc);C.Xb=p*(2-p);C.Rb=C.wc.Se().Dj;C.jp=C.wc.xq();C.hr=C.jp*C.Rb;C.Bx=m;C.Ax=u;C.ke=g;197==c?(g=new a.Ka(e.description),g.Wc(e,!1)):a.T.Lc(c)?(g=new a.Xa(e.description),g.Bc(e,!0)):g=e;if(4!=C.ke){d=0==C.sg.lc(C.wc)?a.Ya.Wl(g,C.sg,C.wc):a.gh.qo(g,C.wc);if(d.s())return d;d=h.IE(C.Rb,d);d=C.hw(d);d=a.Vn.nl(d,C.wc,C.ke);C=a.Ya.Wl(d,
C.wc,C.sg)}else{2==a.Nf.Am(d)?(e=a.Ya.TN(),d=a.$r.local().$(g,e,d,b),d==e&&(d=new a.Ka,e.copyTo(d))):d=a.gh.qo(g,C.wc);if(d.s())return d;C=C.wS(d)}return C};h.IE=function(e,d){var g=new a.i;d.dd(g);if(3.141592653589793>g.aa()*e)return d;for(var m=!1,g=d.Ca(),u=new a.b,b=new a.b;g.kb();)for(;g.La();){var c=g.ia();u.J(c.Mb());b.J(c.oc());u.scale(e);b.scale(e);if(3.141592653589793<Math.abs(u.x-b.x)){var p=h.Gs(u,b);if(!p){m=!0;break}if(6.283185307179586<Math.abs(u.x-b.x)){m=!0;break}}}if(!m)return d;
var m=d.Pa(),f=1<d.description.Aa,l=new a.b,q=new a.b,n=new a.b,z=new a.b,k=new a.Va;for(g.Lk();g.kb();)for(var t=NaN,v=[0];g.La();){c=g.ia();u.J(c.Mb());b.J(c.oc());u.scale(e);b.scale(e);isNaN(t)?(h.Bd(u.x,NaN,v),q.J(u)):q.J(n);t=q.x;if(p=h.Gs(u,b)){if(6.283185307179586<b.x-u.x)for(;6.283185307179586<b.x-u.x;)b.x-=6.283185307179586;if(-6.283185307179586>b.x-u.x)for(;-6.283185307179586>b.x-u.x;)b.x+=6.283185307179586;h.Bd(b.x,NaN,v);n.J(b)}else l.J(b),h.eK(l),h.Bd(l.x,t,v),n.ma(v[0]+l.x,l.y);.5>Math.abs(n.x-
b.x)&&n.J(b);f?(c.uu(0,k),z.J(q),z.scale(1/e),k.ic(z),(p=g.wl())?m.df(k):m.lineTo(k),g.Jm()&&!d.vc(g.Qa)&&(c.uu(1,k),z.J(n),z.scale(1/e),k.ic(z),m.lineTo(k))):((p=g.wl())&&m.Sw(),c=m.ea()-1,z.J(q),z.scale(1/e),m.kf(c,-1,z),g.Jm()&&!d.vc(g.Qa)&&(z.J(n),z.scale(1/e),m.kf(c,-1,z)))}return m};h.kC=function(e,d,g,m,u,b,c,p,f,l,q,n){var C=new a.b,M=new a.b,z=0<m.compare(u);h.Ez(z,m,u,C,M);h.Jz(e,d,g,C,M,b,NaN,c,p,f,l,null,q,n);z&&h.gy(f,l,null,q)};h.prototype.hw=function(e){var d=e.Pa(),g=e.Ca(),m=[],u=
null,b=null,c=1<e.description.Aa;c&&(u=new a.qd(0),b=new a.Ag);for(var p=[0],f=new a.b,l=new a.b,q=new a.b,n=new a.b;g.kb();)for(p[0]=0;g.La();){var z=g.ia();f.J(z.Mb());l.J(z.oc());f.scale(this.Rb);l.scale(this.Rb);var k=0<f.compare(l);h.Ez(k,f,l,q,n);m.length=0;null!=u&&u.cf(0);0<this.Bx?h.Jz(this.Gb,this.Xb,this.ke,q,n,this.Bx,this.Ax,this.hr,null,null,null,c?u:null,m,p):h.dH(this.Gb,this.Xb,this.ke,q,n,this.Ax,this.hr,c?u:null,m,p);k&&h.gy(null,null,c?u:null,m);m[0].J(z.Mb());m[m.length-1].J(z.oc());
for(var t=1;t<m.length-1;t++)m[t].scale(1/this.Rb);c?(k=h.Cz(k,z,b),h.oz(g.wl(),g.Jm()&&!e.vc(g.Qa),z,k,u,m,d)):h.mz(g.wl(),g.Jm()&&!e.vc(g.Qa),m,d)}return d};h.prototype.wS=function(e){var d=e.Pa(),g=e.Ca(),m=[],u=null,b=new a.Ag,c=1<e.description.Aa;for(c&&(u=new a.qd(0));g.kb();)for(;g.La();){var p=g.ia(),f=p.Mb(),l=p.oc(),f=0<f.compare(l),l=h.Cz(f,p,b);m.length=0;null!=u&&u.cf(0);h.FR(this.Gb,this.Xb,this.Rb,l,this.sg,this.Bx,this.Ax,c?u:null,m);f&&h.gy(null,null,c?u:null,m);c?h.oz(g.wl(),g.Jm()&&
!e.vc(g.Qa),p,l,u,m,d):h.mz(g.wl(),g.Jm()&&!e.vc(g.Qa),m,d)}return d};h.mz=function(e,d,g,a){e&&a.Sw();e=a.ea()-1;var m=g.slice(0);a.dD(e,m,m.length-1);d&&a.kf(e,-1,g[g.length-1])};h.oz=function(e,d,g,m,h,b,c){var u=new a.Va;g.En(u);e?c.df(u):c.lineTo(u);if(2<b.length){e=m.$b();for(var C=1;C<b.length-1;C++){var p=m.AD(h.get(C)*e);m.uu(p,u);u.ic(b[C]);c.lineTo(u)}}d&&(g.Bn(u),c.lineTo(u))};h.Jz=function(e,d,g,m,b,c,p,f,l,q,n,z,k,t){var u=new a.ca(0),C=new a.ca(0),M=new a.ca(0);a.zb.Rd(e,d,m.x,m.y,
b.x,b.y,M,u,C,g);var M=M.l,v=u=u.l,C=C.l;0>v&&(v+=6.283185307179586);0>C&&(C+=6.283185307179586);null!=l&&(l[0]=M);null!=q&&(q[0]=v);null!=n&&(n[0]=C);q=l=NaN;null!=z&&(q=a.u.gg(e,d),n=a.u.q(e,d,m.y),l=(q-n)/M,q=(q+n)/M);n=h.Hs(m,b);var C=h.Fs(m,b),v=n||C,A=h.wz(m,b,f),w=new a.ca(0),y=new a.ca(0),D=new a.b,B=new a.b,F=new a.b;h.Bd(m.x,NaN,t);var Y=[t[0]];if(M<=c)h.ac(k,m),h.Bd(b.x,NaN,t),null!=z&&z.add(0),v?(n&&h.by(m,b,z,k),C&&h.Vx(m,b,z,k)):A?h.Xx(m,b,u,l,q,z,k):0<p&&(B.ma(m.x-Y[0],m.y),D.ma(b.x-
t[0],b.y),h.yv(e,d,g,m,M,u,B,D,0,1,p,z,k,Y)),h.ac(k,b);else{c=1+a.I.truncate(Math.ceil(M/c));var W=M/(c-1),J=new a.b,G=0;h.ac(k,m);J.J(m);B.ma(m.x-t[0],m.y);null!=z&&z.add(0);for(var Q=1;Q<c;Q++){var I;Q<c-1?(a.zb.dk(e,d,m.x,m.y,Q*W,u,w,y,g),D.ma(w.l,y.l),h.Bd(D.x,J.x,t),F.ma(t[0]+D.x,D.y),I=Q/(c-1)):(h.Bd(b.x,NaN,t),D.ma(b.x-t[0],b.y),F.J(b),I=1);v?(1==Q&&n&&h.by(m,F,z,k),Q==c-1&&C&&h.Vx(J,b,z,k)):A?h.uz(J,F,f)&&(m.x<b.x?J.x>F.x&&(t[0]+=6.283185307179586,F.ma(t[0]+D.x,D.y)):J.x<F.x&&(t[0]-=6.283185307179586,
F.ma(t[0]+D.x,D.y)),h.Xx(J,F,u,l,q,z,k)):0<p&&h.yv(e,d,g,m,M,u,B,D,G,I,p,z,k,Y);h.ac(k,F);null!=z&&z.add(I);J.J(F);B.J(D);Y[0]=t[0];G=I}}};h.dH=function(e,d,g,m,b,c,p,f,l,q){var u=new a.ca(0),C=new a.ca(0),n=new a.ca(0);a.zb.Rd(e,d,m.x,m.y,b.x,b.y,n,u,C,g);var C=n.l,u=u.l,z=n=NaN;if(null!=f)var z=a.u.gg(e,d),M=a.u.q(e,d,m.y),n=(z-M)/C,z=(z+M)/C;var M=h.Hs(m,b),k=h.Fs(m,b),t=M||k;p=h.wz(m,b,p);var v=h.Gs(m,b),v=t||p||v;h.Bd(m.x,NaN,q);var A=new a.b;h.ac(l,m);A.J(m);null!=f&&f.add(0);v?(t?(M&&h.by(m,
b,f,l),k&&h.Vx(m,b,f,l)):p&&h.Xx(m,b,u,n,z,f,l),h.Bd(b.x,NaN,q),h.ac(l,b)):C<=c?(h.Bd(b.x,NaN,q),h.ac(l,b)):(n=new a.b,p=new a.b,n.J(m),p.J(b),n.x-=q[0],p.x-=q[0],-3.141592653589793>p.x?p.x+=6.283185307179586:3.141592653589793<p.x&&(p.x-=6.283185307179586),h.yv(e,d,g,m,C,u,n,p,0,1,c,f,l,q),h.ac(l,b),h.Bd(b.x,NaN,q));null!=f&&f.add(1)};h.yv=function(e,d,g,m,b,c,p,f,l,q,n,z,k,t){var u=new a.b,C=new a.b;u.ma(p.x+t[0],p.y);new a.ca(0);new a.ca(0);new a.ca(0);new a.ca(0);var M=new a.ca(0),v=new a.ca(0),
A=new a.ca(0),w=new a.b,y=new a.b,D=new a.b,B=new a.b;w.J(p);y.J(f);p=new a.qd(0);f=new a.qd(0);h.$i(p,y);f.add(q);var F=new a.b,Y=new a.yb,W=[];for(h.Kz(4,W);0<p.size;){for(var J=!1,G,Q=NaN,I=0;3>I;I++)if(G=W[I]*q+(1-W[I])*l,a.zb.dk(e,d,m.x,m.y,G*b,c,M,v,g),D.ma(M.l,v.l),0==I&&(Q=G,B.J(D)),h.mR(w,D,y,Y),Y.Kb(Y.Gd(D,!0),F),a.zb.Rd(e,d,D.x,D.y,F.x,F.y,A,null,null,2),A.l>n){J=!0;break}J?(y.J(B),q=Q,h.$i(p,y),f.add(q)):(h.cx(p),f.oj(f.size-1,1,f.size-1),0<p.size&&(h.Bd(y.x,u.x,t),C.ma(t[0]+y.x,y.y),
h.ac(k,C),u.J(C),null!=z&&z.add(q),w.J(y),l=q,h.cy(p,y),q=f.get(f.size-1)))}};h.FR=function(e,d,g,m,b,c,p,f,l){var u=new a.b,C=new a.b,q=new a.b,n=new a.b,z=new a.b,M=new a.b,k=new a.b,t=new a.b,v=new a.b,A=new a.b,w=new a.ca(0),y=new a.ca(0),D=new a.b,B=[[],[]],F=1==a.Nf.Am(b);b=b.Ko();var W=m.Mb(),Y=m.oc();F?(M.ma(W.x*g,W.y*g),k.ma(Y.x*g,Y.y*g)):(B[0][0]=W.x,B[0][1]=W.y,B[1][0]=Y.x,B[1][1]=Y.y,a.Ya.tu(),M.x=B[0][0]*g,M.y=B[0][1]*g,k.x=B[1][0]*g,k.y=B[1][1]*g);var J=0,G=0,Q=1,I=m.mD();u.J(W);C.J(Y);
var Y=new a.qd(0),r=new a.qd(0),K=new a.qd(0);h.$i(Y,C);h.$i(r,k);K.add(Q);h.ac(l,u);null!=f&&f.add(G);var L=[],O;O=0<p?I?5:3:I?5:1;h.Kz(O,L);for(var ca=new a.ca(0),P=new a.ca(0),U=new a.ca(0),N=new a.ca(0),V=new a.ca(0),T=new a.ca(0),x=new a.ca(0);0<r.size;){var R=!1,S,ka=NaN;a.zb.Rd(e,d,M.x,M.y,k.x,k.y,ca,P,null,2);for(W=0;W<O;W++){if(0==W){if(!I&&0>=p&&ca.l<=c&&3.141592653589793>Math.abs(M.x-k.x))break;if(m.rA(G,Q)<=b)break}S=L[W]*Q+(1-L[W])*G;m.Kb(S,q);F?t.ma(q.x*g,q.y*g):(B[0][0]=q.x,B[0][1]=
q.y,a.Ya.tu(),t.x=B[0][0]*g,t.y=B[0][1]*g);if(0==W&&(ka=S,z.J(q),A.J(t),0<c&&(ca.l>c||3.141592653589793<=Math.abs(M.x-k.x)))){R=!0;break}if(I&&0<c){if(a.zb.Rd(e,d,M.x,M.y,t.x,t.y,U,null,null,2),U.l>c||3.141592653589793<=Math.abs(M.x-t.x)){R=!0;break}}else if(0<p)if(I?(n.OO(u,C,L[W]),F?v.ma(n.x*g,n.y*g):(B[0][0]=n.x,B[0][1]=n.y,a.Ya.tu(),v.x=B[0][0]*g,v.y=B[0][1]*g)):(n.J(q),v.J(t)),a.zb.Rd(e,d,M.x,M.y,v.x,v.y,N,null,null,2),N.l<=ca.l){a.zb.dk(e,d,M.x,M.y,N.l,P.l,w,y,2);D.ma(w.l,y.l);a.zb.Rd(e,d,D.x,
D.y,t.x,t.y,V,null,null,2);if(V.l>p){R=!0;break}if(I){a.zb.Rd(e,d,D.x,D.y,v.x,v.y,T,null,null,2);if(T.l>p){R=!0;break}a.zb.Rd(e,d,v.x,v.y,t.x,t.y,x,null,null,2);if(x.l>p){R=!0;break}}}else{R=!0;break}}R?(C.J(z),k.J(A),Q=ka,h.$i(Y,C),h.$i(r,k),K.add(Q)):(h.cx(Y),h.cx(r),K.oj(K.size-1,1,K.size-1),h.ac(l,C),J+=ca.l,null!=f&&f.add(J),0<r.size&&(u.J(C),M.J(k),G=Q,h.cy(Y,C),h.cy(r,k),Q=K.get(K.size-1)))}if(null!=f)for(e=1/J,W=0;W<f.size;W++)f.write(W,f.read(W)*e)};h.gy=function(e,d,g,a){a.reverse();null!=
g&&g.Jp(0,g.size,1);g=null!=e?e[0]:NaN;a=null!=d?d[0]:NaN;null!=e&&(e[0]=a);null!=d&&(d[0]=g)};h.Ez=function(e,d,g,a,h){e?(a.J(g),h.J(d)):(a.J(d),h.J(g))};h.Cz=function(e,d,g){if(!e)return d;g.create(d.D());d.copyTo(g.get());g.get().reverse();return g.get()};h.Bd=function(e,d,g){if(isNaN(d)){for(;3.141592653589793<g[0]-e;)g[0]-=6.283185307179586;for(;3.141592653589793<e-g[0];)g[0]+=6.283185307179586}else 3.141592653589793<g[0]+e-d?g[0]-=6.283185307179586:3.141592653589793<d-(g[0]+e)&&(g[0]+=6.283185307179586)};
h.mR=function(e,d,g,a){3.141592653589793>Math.abs(d.x-e.x)?(a.ed(e),3.141592653589793<=g.x-e.x?a.Ok(g.x-6.283185307179586,g.y):3.141592653589793<=e.x-g.x?a.Ok(g.x+6.283185307179586,g.y):a.Ok(g.x,g.y)):(a.ed(g),3.141592653589793<=e.x-g.x?a.Ok(e.x-6.283185307179586,e.y):3.141592653589793<=g.x-e.x?a.Ok(e.x+6.283185307179586,e.y):a.Ok(e.x,e.y))};h.Kz=function(e,d){for(var g=0;g<e;g++){var a=Math.ceil(g/2)/(e+1);0!=g%2&&(a=-a);d[g]=.5+a}};h.Hs=function(e,d){return a.j.S(e.y,1.570796326794897)&&!a.j.S(d.y,
1.570796326794897)||a.j.S(e.y,-1.570796326794897)&&!a.j.S(d.y,-1.570796326794897)?!0:!1};h.Fs=function(e,d){return a.j.S(d.y,1.570796326794897)&&!a.j.S(e.y,1.570796326794897)||a.j.S(d.y,-1.570796326794897)&&!a.j.S(e.y,-1.570796326794897)?!0:!1};h.wz=function(e,d,g){return!h.uz(e,d,g)||a.j.S(e.y,1.570796326794897)||a.j.S(e.y,-1.570796326794897)||a.j.S(d.y,1.570796326794897)||a.j.S(d.y,-1.570796326794897)?!1:!0};h.uz=function(e,d,g){return Math.abs(Math.abs(e.x-d.x)-3.141592653589793)<=g?!0:!1};h.Gs=
function(e,d){return a.j.S(e.y,1.570796326794897)&&a.j.S(d.y,1.570796326794897)||a.j.S(e.y,-1.570796326794897)&&a.j.S(d.y,-1.570796326794897)?!0:!1};h.by=function(e,d,g,m){if(0<e.y){var b=new a.b;b.ma(d.x,1.570796326794897)}else b=new a.b,b.ma(d.x,-1.570796326794897);a.j.S(e.x,b.x)||a.j.S(d.y,b.y)||(h.ac(m,b),null!=g&&g.add(0))};h.Vx=function(e,d,g,m){if(0<d.y){var b=new a.b;b.ma(e.x,1.570796326794897)}else b=new a.b,b.ma(e.x,-1.570796326794897);a.j.S(d.x,b.x)||a.j.S(e.y,b.y)||(h.ac(m,b),null!=g&&
g.add(1))};h.Xx=function(e,d,g,m,b,c,p){a.j.Vc(g)?(0<1.570796326794897-e.y&&(g=new a.b,g.ma(e.x,1.570796326794897),h.ac(p,g),null!=c&&c.add(m)),0<1.570796326794897-d.y&&(g=new a.b,g.ma(d.x,1.570796326794897),h.ac(p,g),null!=c&&c.add(m))):(0<1.570796326794897+e.y&&(g=new a.b,g.ma(e.x,-1.570796326794897),h.ac(p,g),null!=c&&c.add(b)),0<1.570796326794897+d.y&&(g=new a.b,g.ma(d.x,-1.570796326794897),h.ac(p,g),null!=c&&c.add(b)))};h.eK=function(e){if(-3.141592653589793>e.x)for(;-3.141592653589793>e.x;)e.x+=
6.283185307179586;if(3.141592653589793<e.x)for(;3.141592653589793<e.x;)e.x-=6.283185307179586};return h}();a.ui=h})(A||(A={}));(function(a){var h=function(){function h(){}h.nl=function(e,d,g){if(null==e||null==d||!a.Ya.Qo(d))throw a.g.N();if(e.s())return e;var m=e,b=m.D();if(a.T.Kc(b)){m=a.gh.qo(e,d);e=new a.i;m.o(e);for(var b=a.Ia.zd(d,e,!1),c=a.Ya.Fm(d),p=Math.floor((e.v-c.v)/c.aa())*c.aa()+c.v;p<e.B;)p>e.v+b&&p<e.B-b&&(m=a.gh.Rw(m,d,g,p)),p+=c.aa()}else{if(197==b)return e=new a.Ka(m.description),
e.Wc(m,!1),h.nl(e,d,g);if(a.T.Lc(b))return e=new a.Xa(m.description),e.Bc(m,!0),h.nl(e,d,g)}return h.VG(m,d)};h.VG=function(e,d){if(null==e||null==d||!a.Ya.Qo(d))throw a.g.N();if(e.s())return e;var g;g=e.D();197==g?(g=new a.Ka(e.description),g.Wc(e,!1)):a.T.Lc(g)?(g=new a.Xa(e.description),g.Bc(e,!0)):g=e;g=a.gh.qo(g,d);return g.s()?g:1==a.Nf.Am(d)?a.gh.aN(g,d,g!=e):h.SG(g,d,g!=e)};h.SG=function(e,d,g){if(!a.Ya.Qo(d))throw a.g.N();if(e.s())return e;var m=a.Ya.IC(d),h=0-180*m,m=360*m;2==a.Nf.Am(d)&&
(h=a.Ya.Fm(d),m=h.B,h=h.v,m-=h);return a.gh.gC(e,h,m,d,g)};return h}();a.Vn=h})(A||(A={}));(function(a){var h=function(){function h(){}h.OH=function(e,d){var g=Math.abs(e%d);return isNaN(g)||g==e||g<=Math.abs(d)/2?g:0>e?-1*(g-d):0<e?1*(g-d):0*(g-d)};h.H=function(e){return 0>e?-e:e};h.nb=function(e,d){return 0<=d?h.H(e):-h.H(e)};h.S=function(e,d){return e==d||h.H(e-d)<=h.bF*(1+(h.H(e)+h.H(d))/2)};h.Vc=function(e){return 0==e||h.H(e)<=h.bF};h.bs=function(e){e=h.OH(e,h.fv);return h.H(e)<=h.$g?e:0>e?
e+h.fv:e-h.fv};h.Yz=function(e,d){e.l=h.bs(e.l);d.l=h.bs(d.l);h.H(d.l)>h.Vr&&(e.l=h.bs(e.l+h.$g),d.l=h.nb(h.$g,d.l)-d.l)};h.gg=function(e,d){d=Math.sqrt(1-d);d=(1-d)/(1+d);var g=d*d;return e/(1+d)*(1+g*(.25+g*(.015625+1/256*g)))*h.Vr};h.pN=function(e,d,g,m,b){var u,c,p,f,l,q,n,z=0,k=q=0,t=0,v=0,A=0;l=0;var w,y,D;n=0;var B,F,J;D=new a.ca;u=new a.ca;if(null!=b)if(D.l=e,u.l=d,h.Yz(D,u),e=D.l,d=u.l,D.l=g,u.l=m,h.Yz(D,u),g=D.l,m=u.l,g=h.bs(g-e),h.S(d,m)&&(h.Vc(g)||h.S(h.H(d),h.Vr)))null!=b&&(b.l=0);else{if(h.S(d,
-m)){if(h.S(h.H(d),h.Vr)){null!=b&&(b.l=2*h.gg(6378137,.0066943799901413165));return}if(h.S(h.H(g),h.$g)){null!=b&&(b.l=2*h.gg(6378137,.0066943799901413165));return}}if(h.Vc(.0066943799901413165))v=Math.cos(d),A=Math.cos(m),null!=b&&(z=Math.sin((m-d)/2),q=Math.sin(g/2),n=2*Math.asin(Math.sqrt(z*z+v*A*q*q)),b.l=6378137*n);else{D=1-Math.sqrt(.9933056200098587);e=1-D;u=Math.atan(e*Math.tan(d));d=Math.sin(u);u=Math.cos(u);c=Math.atan(e*Math.tan(m));m=Math.sin(c);c=Math.cos(c);f=p=g;F=0;J=1;B=g;for(y=
!0;1==y;)F+=1,1==J&&(l=Math.sin(B),q=Math.cos(B),z=c*l,n=u*m-d*c*q,z=Math.sqrt(z*z+n*n),q=d*m+u*c*q,n=Math.atan2(z,q),k=1E-15>h.H(z)?u*c*l/h.nb(1E-15,z):u*c*l/z,t=1-k*k,v=1E-15>h.H(t)?q-d*m/h.nb(1E-15,t)*2:q-d*m/t*2,A=v*v,l=((-3*t+4)*D+4)*t*D/16),w=(1-l)*D*(n+l*z*(v+q*l*(2*A-1))),1==J?(B=g+w*k,1E-14>h.H(B-f)?y=!1:h.H(B)>h.$g?(J=2,B=h.$g,0>g&&(B=-B),k=0,t=1,p=f=2,n=h.$g-h.H(Math.atan(d/u)+Math.atan(m/c)),z=Math.sin(n),q=Math.cos(n),l=((-3*t+4)*D+4)*t*D/16,1E-14>h.H(k-p)?y=!1:(v=1E-15>h.H(t)?q-d*m/
h.nb(1E-15,t)*2:q-d*m/t*2,A=v*v)):(0>(B-f)*(f-p)&&5<F&&(B=(2*B+3*f+p)/6),p=f,f=B)):(k=(B-g)/w,0>(k-f)*(f-p)&&5<F&&(k=(2*k+3*f+p)/6),p=f,f=k,t=1-k*k,l=k*z/(u*c),q=-Math.sqrt(h.H(1-l*l)),B=Math.atan2(l,q),z=c*l,n=u*m-d*c*q,z=Math.sqrt(z*z+n*n),q=d*m+u*c*q,n=Math.atan2(z,q),l=((-3*t+4)*D+4)*t*D/16,1E-14>h.H(k-p)?y=!1:(v=1E-15>h.H(t)?q-d*m/h.nb(1E-15,t)*2:q-d*m/t*2,A=v*v));null!=b&&(k=Math.sqrt(1+(1/(e*e)-1)*t),k=(k-1)/(k+1),t=k*(1-.375*k*k),b.l=(1+k*k/4)/(1-k)*e*6378137*(n-t*z*(v+t/4*(q*(-1+2*A)-t/6*
v*(-3+4*z*z)*(-3+4*A)))))}}};h.$g=3.141592653589793;h.Vr=1.5707963267948966;h.fv=6.283185307179586;h.bF=3.552713678800501E-15;return h}();a.nH=h})(A||(A={}));(function(a){var h=function(){function a(){}a.prototype.uv=function(e){this.hi=e};a.prototype.GA=function(e){this.Ab=e};a.prototype.HA=function(e){this.nn=e};a.vB=function(e){return e.s()||1607!=e.D()&&1736!=e.D()?!1:!0};a.tB=function(e){return e.s()||1607!=e.D()&&1736!=e.D()||20>e.F()?!1:!0};a.uB=function(e){return e.s()||1607!=e.D()&&1736!=
e.D()||20>e.F()?!1:!0};return a}();a.Wj=h})(A||(A={}));(function(a){var h=function(){function h(){}h.FH=function(e){var d=new a.Ka;d.Uy(e.R.v,e.R.C);d.wj(e.R.v,e.R.G);d.wj(e.R.B,e.R.G);d.wj(e.R.B,e.R.C);return d};h.aT=function(e,d){var g=a.wi.local();e=new a.Pc(e);return g.$(e,d,null).next()};h.ll=function(e,d,g){return a.Zr.local().$(e,d,g,null)};h.On=function(e,d,g){return a.dv.local().$(e,d,g,null)};h.MS=function(e,d,g){var m=a.dv.local();e=new a.Pc(e);d=new a.Pc(d);g=m.$(e,d,g,null);for(m=[];null!=
(d=g.next());)m.push(d);return m};h.lc=function(e,d,g){return a.bl.local().$(3,e,d,g,null)};h.nM=function(e,d,g){return a.bl.local().$(4,e,d,g,null)};h.QO=function(e,d,g){var m=a.$r.local();e=new a.Pc(e);d=new a.Pc(d);g=m.$(e,d,g,null);for(m=[];null!=(d=g.next());)m.push(d);return m};h.kM=function(e,d,g){var m=a.Zr.local();e=new a.Pc(e);d=new a.Pc(d);g=m.$(e,d,g,null);for(m=[];null!=(d=g.next());)m.push(d);return m};h.Ga=function(e,d,g){return a.$r.local().$(e,d,g,null)};h.jT=function(e,d,g){return a.bl.local().$(2,
e,d,g,null)};h.contains=function(e,d,g){return a.bl.local().$(1,e,d,g,null)};h.VL=function(e,d,g){return a.bl.local().$(16,e,d,g,null)};h.touches=function(e,d,g){return a.bl.local().$(8,e,d,g,null)};h.tQ=function(e,d,g){return a.bl.local().$(32,e,d,g,null)};h.RO=function(e,d,g){return a.bl.local().$(1073741824,e,d,g,null)};h.py=function(e,d,g,m){return a.fI.local().$(e,d,g,m,null)};h.Fb=function(e,d,g,m){var h=null;if(null!=g){if(h=g.Se(),null!=m&&h.Qc()!=m.Qc()&&h.Nc!=m.Nc)throw a.g.cj();}else if(null!=
m)throw a.g.N();e=a.ZH.local().$(e,d,null);null!==h&&null!==m&&(e=a.Tb.ih(e,h,m));return e};h.clip=function(e,d,g){return a.SH.local().$(e,a.i.Oa(d.R.v,d.R.C,d.R.B,d.R.G),g,null)};h.xm=function(e,d,g){if(null==e||null==d)return null;e=a.UH.local().$(!0,e,d,g,null);for(d=[];null!=(g=e.next());)g.s()||d.push(g);return d.slice(0)};h.rK=function(e,d,g,m,b,c,p,f){if(!0===b)return h.VP(e,d,g,m,c,p,f);b=g;if(null!=d){if(p=d.Se(),null!=m&&p.Qc()!=m.Qc()){if(p.Nc!=m.Nc)throw a.g.cj();b=[];a.Tb.OB(g,g.length,
m,p,b)}}else if(null!=m)throw a.g.N();g=a.Oz.local();if(c){e=new a.Pc(e);d=g.$(e,d,b,c,null);for(e=[];null!=(c=d.next());)e.push(c);c=e.slice(0)}else for(c=[],m=0;m<e.length;m++)c[m]=g.$(e[m],d,b[m],null);return c};h.VP=function(e,d,g,m,h,b,c){if(null===d)throw a.g.N();if(null===m||void 0===m)m=4326!==d.Qc()?d.Se():a.Tb.Qd(9001);if(0!==m.Nc)throw a.g.N();a.Tb.OB(g,g.length,m,a.Tb.Qd(9001),g);m=a.Tz.local();if(h){e=new a.Pc(e);d=m.$(e,d,b,g,c,!1,h,null);for(g=[];null!=(b=d.next());)g.push(b);h=g.slice(0)}else{h=
[];for(var u=0;u<e.length;u++)h[u]=m.$(e[u],d,b,g[u],c,!1,null)}return h};h.buffer=function(e,d,g,m,h,b,c){var u=g;if(!1===h){if(null!=d){if(h=d.Se(),null!=m&&h.Qc()!=m.Qc()){if(h.Nc!=m.Nc)throw a.g.cj();u=a.Tb.ih(g,m,h)}}else if(null!=m)throw a.g.N();e=a.Oz.local().$(e,d,u,null)}else{if(null===d)throw a.g.N();if(null===m||void 0===m)m=4326!==d.Qc()?d.Se():a.Tb.Qd(9001);if(0!==m.Nc)throw a.g.N();u=a.Tb.ih(g,m,a.Tb.Qd(9001));e=a.Tz.local().$(e,d,b,u,c,!1,null)}return e};h.sQ=function(e,d,g,m,h,b,c){if(null!=
d){var u=d.Se();if(null!=c&&u.Qc()!=c.Qc()){if(u.Nc!=c.Nc)throw a.g.cj();g=a.Tb.ih(g,c,u)}}else if(null!=c)throw a.g.N();e=new a.Pc(e);d=a.Wz.local().$(e,d,g,m,h,b,null);for(g=[];null!=(m=d.next());)g.push(m);return g.slice(0)};h.offset=function(e,d,g,m,h,b,c){if(null!=d){var u=d.Se();if(null!=c&&u.Qc()!=c.Qc()){if(u.Nc!=c.Nc)throw a.g.cj();g=a.Tb.ih(g,c,u)}}else if(null!=c)throw a.g.N();return a.Wz.local().$(e,d,g,m,h,b,null)};h.JL=function(e){return a.Qz.local().$(e,null)};h.KL=function(e,d){var g=
a.Qz.local();e=new a.Pc(e);g=g.$(e,d,null);for(e=[];null!=(d=g.next());)e.push(d);return e};h.zw=function(e,d,g){return a.bv.local().zw(e,d,g)};h.Aw=function(e,d){return a.bv.local().Aw(e,d)};h.Bw=function(e,d,g,m){return a.bv.local().Bw(e,d,g,m)};h.Qy=function(e,d){return a.as.local().$(e,d,!1,null)};h.cP=function(e,d){return a.as.local().Ro(e,d,null)};h.fN=function(e,d,g,m,h){var b=a.Sz.local();if(null!=d){if(d=d.Se(),null!=h&&d.Qc()!=h.Qc()){if(d.Nc!=h.Nc)throw a.g.cj();g=a.Tb.ih(g,h,d)}}else if(null!=
h)throw a.g.N();return b.$(e,g,m,null)};h.oq=function(e,d,g,m){var h=a.WH.local();if(null!=d){if(d=d.Se(),null!=m&&d.Qc()!=m.Qc()){if(d.Nc!=m.Nc)throw a.g.cj();g=a.Tb.ih(g,m,d)}}else if(null!=m)throw a.g.N();return h.$(e,g,null)};h.fw=function(e,d,g,m,h){void 0===h&&(h=0);var b=a.aI.local();if(4==h)throw a.g.qe();if(0!==h)throw a.g.qe();if(null!=d){var u=d.Se();if(null!=m&&u.Qc()!=m.Qc()){if(u.Nc!=m.Nc)throw a.g.cj();g=a.Tb.ih(g,m,u)}}else if(null!=m)throw a.g.N();return b.$(e,g,d,h,null)};h.jN=function(e,
d,g,m){if(null===e)return 0;if(4==m)throw a.g.qe();if(0!==m)throw a.g.qe();if(197==e.D())e=h.FH(e);else if(1736!=e.D())return 0;m=a.Ya.Em(d);e=a.Ya.Wl(e,d,m);e=a.oH.kN([e])[0];if(null!==g){if(2!==g.Nc)throw a.g.N("Unit must be a area unit type");e=a.Tb.ih(e,a.Tb.Qd(109404),g)}return e};h.nN=function(e,d,g,m){e=a.cI.local().$(e,d,m,null);if(null!==g){if(0!==g.Nc)throw a.g.N("Unit must be a linear unit type");e=a.Tb.ih(e,a.Tb.Qd(9001),g)}return e};h.BQ=function(e,d,g){if(null===e)return 0;var m=null;
if(null!=d){m=d.Se();if(0==m.Nc&&(m=a.Tb.PC(m),null==m&&null!==g))throw a.g.N();if(null!=g&&m.Qc()!=g.Qc()&&m.Nc!=g.Nc)throw a.g.cj();}else if(null!=g)throw a.g.N();return 1736==e.D()||197==e.D()?(e=e.Mh(),null!==g?a.Tb.ih(e,m,g):e):0};h.CQ=function(e,d,g){if(null===e||e.s()||1>e.fb())return 0;var m=null;if(null!=d){if(m=d.Se(),null!=g&&m.Qc()!=g.Qc()&&m.Nc!=g.Nc)throw a.g.cj();}else if(null!=g)throw a.g.N();1736==e.D()||197==e.D()?d=e.Rf():a.T.Lc(e.D())?(d=new a.Xa(e.description),d.Bc(e,!0)):d=e;
e=0;d=d.Ca();for(var h=new a.b,b=new a.b;d.kb();)for(;d.La();){var c=d.ia();c.ht(h);c.uw(b);e+=a.b.Fb(h,b)}null!==m&&null!==g&&(e=a.Tb.ih(e,m,g));return e};h.YT=function(e,d){return a.Nf.mN(e,d)};h.IL=function(e){return void 0!==e.points?h.kH(e,void 0===e.hasZ?!1:e.hasZ,void 0===e.hasM?!1:e.hasM):void 0!==e.rings?h.Nz(e.rings,void 0===e.hasZ?!1:e.hasZ,void 0===e.hasM?!1:e.hasM,"P"):void 0!==e.paths?h.Nz(e.paths,void 0===e.hasZ?!1:e.hasZ,void 0===e.hasM?!1:e.hasM,"L"):void 0!==e.x?h.uH(e):void 0!==
e.xmin?h.hH(e):null};h.uH=function(e){if(null==e.x||"NaN"==e.x)return new a.Va;var d=new a.Va(e.x,e.y);void 0!==e.z&&null!==e.z&&d.rS(e.z);void 0!==e.m&&null!==e.m&&d.bS(e.m);return d};h.hH=function(e){if(null==e.xmin||"NaN"==e.xmin)return new a.Vj;var d=new a.Vj(e.xmin,e.ymin,e.xmax,e.ymax);void 0!==e.zmin&&null!==e.zmin&&d.setInterval(1,0,e.zmin,e.zmax);void 0!==e.mmin&&null!==e.mmin&&d.setInterval(2,0,e.mmin,e.mmax);return d};h.kH=function(e,d,g){var m=0,h=new a.pe,b=3*e.points.length;0!=b%2&&
b++;2>b&&(b=2);var c=a.I.truncate(3*e.points.length/2);4>c?c=4:16>c&&(c=16);for(var b=a.Ac.kl(b,0),p=a.Ac.kl(c),c=a.Ac.kl(c),f=0;f<e.points.length;f++)b.write(2*f,e.points[f][0]),b.write(2*f+1,e.points[f][1]),p.write(f,d||g?e.points[f][2]:NaN),c.write(f,g&&d?e.points[f][3]:NaN),m++;0!=m&&(h.resize(m),h.bm(0,b));d&&(h.Ne(1),h.bm(1,p));g&&(h.Ne(2),h.bm(2,0==d?p:c));h.ce(16777215);return h};h.Nz=function(e,d,g,m){var h,b=0,c=2;"P"==m?(h=new a.Ka,b=1,c=3):h=new a.Xa;for(var p=a.Ac.Dg(0),f=a.Ac.to(0),
l=0,q=0,n=[],z=[],k=0;k<e.length;k++){var t=e[k].length;n[k]=!1;if("P"===m&&e[k][0][0]===e[k][e[k].length-1][0]&&e[k][0][1]===e[k][e[k].length-1][1]){var v=0==g?!0:e[k][0][3]===e[k][e[k].length-1][3]||void 0===e[k][0][3]&&void 0===e[k][e[k].length-1][3];(0==d||e[k][0][2]===e[k][e[k].length-1][2]||void 0===e[k][0][2]&&void 0===e[k][e[k].length-1][2])&&v&&(n[k]=!0,--t)}t>=c?(z[k]=!1,q+=1,p.add(l),f.add(b),l+=t):z[k]=!0}m=3*l;0!=m%2&&m++;2>m&&(m=2);k=a.I.truncate(3*l/2);4>k?k=4:16>k&&(k=16);m=a.Ac.kl(m,
0);b=a.Ac.kl(k);c=a.Ac.kl(k);for(k=t=0;k<e.length;k++)if(!1===z[k])for(v=0;v<e[k].length;v++){var A=!1;v===e[k].length-1&&!0===n[k]&&(A=!0);A||(m.write(2*t,e[k][v][0]),m.write(2*t+1,e[k][v][1]),b.write(t,d||g?e[k][v][2]:NaN),c.write(t,g&&d?e[k][v][3]:NaN),t++)}0!=l&&(e=h,p.resize(q),f.resize(q),0<l&&(p.add(l),f.add(0)),e.bm(0,m),e.NF(f),e.OF(p));d&&(h.Ne(1),h.bm(1,b));g&&(h.Ne(2),h.bm(2,0==d?b:c));h.ce(16777215);return h};return h}();a.Pb=h})(A||(A={}));(function(a){var h=function(){function a(){}
a.Zk=function(e){var d=0,g=0,a=e.length,h=e[g],b;for(g;g<a-1;g++)b=e[g+1],d+=(b[0]-h[0])*(b[1]+h[1]),h=b;return 0<=d};a.rotate=function(e,d,g){d=d*Math.PI/180;var m=Math.cos(d),h=Math.sin(d);if(void 0!==e.paths){d={paths:[]};for(var b=0;b<e.paths.length;b++){for(var c=e.paths[b],p=[],f=0;f<c.length;f++){var l=c[f].slice(0);p.push(l);var q=m*(c[f][0]-g.x)-h*(c[f][1]-g.y)+g.x,n=h*(c[f][0]-g.x)+m*(c[f][1]-g.y)+g.y;l[0]=q;l[1]=n}d.paths.push(p)}return d}if(void 0!==e.rings){d={rings:[]};for(b=0;b<e.rings.length;b++){for(var c=
e.rings[b],p=[],z=a.Zk(c),f=0;f<c.length;f++)l=c[f].slice(0),p.push(l),q=m*(c[f][0]-g.x)-h*(c[f][1]-g.y)+g.x,n=h*(c[f][0]-g.x)+m*(c[f][1]-g.y)+g.y,l[0]=q,l[1]=n;a.Zk(p)!==z&&p.reverse();d.rings.push(p)}return d}if(void 0!==e.x)return d={x:m*(e.x-g.x)-h*(e.y-g.y)+g.x,y:h*(e.x-g.x)+m*(e.y-g.y)+g.y},void 0!==e.z&&(d.z=e.z),void 0!==e.m&&(d.m=e.m),d;if(void 0!==e.points){d={points:[]};e=e.points;for(f=0;f<e.length;f++)b=e[f].slice(0),b[0]=m*(e[f][0]-g.x)-h*(e[f][1]-g.y)+g.x,b[1]=h*(e[f][0]-g.x)+m*(e[f][1]-
g.y)+g.y,d.points.push(b);return d}return null};a.eC=function(e,d){var g,m;if(void 0!==e.paths){g={paths:[]};for(var h=0;h<e.paths.length;h++){for(var b=e.paths[h],c=[],p=0;p<b.length;p++){var f=b[p].slice(0);c.push(f);m=d.x-b[p][0];f[0]=b[p][0]+2*m}g.paths.push(c)}return g}if(void 0!==e.rings){g={rings:[]};for(h=0;h<e.rings.length;h++){for(var b=e.rings[h],l=a.Zk(b),c=[],p=0;p<b.length;p++)f=b[p].slice(0),c.push(f),m=d.x-b[p][0],f[0]=b[p][0]+2*m;a.Zk(c)!==l&&c.reverse();g.rings.push(c)}return g}if(void 0!==
e.x)return m=d.x-e.x,g={x:e.x+2*m,y:e.y},void 0!==e.z&&(g.z=e.z),void 0!==e.m&&(g.m=e.m),g;if(void 0!==e.points){g={points:[]};h=e.points;for(p=0;p<h.length;p++)b=h[p].slice(0),m=d.x-b[0],b[0]+=2*m,g.points.push(b);return g}return void 0!==e.xmin?(g={v:e.xmin,C:e.ymin,B:e.xmax,G:e.ymax},void 0!==e.zmin&&(g.zmin=e.zmin,g.zmax=e.zmax),void 0!==e.mmin&&(g.mmin=e.mmin,g.mmax=e.mmax),m=d.x-e.xmin,g.xmax=e.xmin+2*m,m=d.x-e.xmax,g.xmin=e.xmax+2*m,g):null};a.fC=function(e,d){var g,m;if(void 0!==e.paths){g=
{paths:[]};for(var h=0;h<e.paths.length;h++){for(var b=e.paths[h],c=[],p=0;p<b.length;p++){var f=b[p].slice(0);c.push(f);m=d.y-b[p][1];f[1]=b[p][1]+2*m}g.paths.push(c)}return g}if(void 0!==e.rings){g={rings:[]};for(h=0;h<e.rings.length;h++){for(var b=e.rings[h],l=a.Zk(b),c=[],p=0;p<b.length;p++)f=b[p].slice(0),c.push(f),m=d.y-b[p][1],f[1]=b[p][1]+2*m;a.Zk(c)!==l&&c.reverse();g.rings.push(c)}return g}if(void 0!==e.x)return m=d.y-e.y,g={y:e.y+2*m,x:e.x},void 0!==e.z&&(g.z=e.z),void 0!==e.m&&(g.m=e.m),
g;if(void 0!==e.points){g={points:[]};h=e.points;for(p=0;p<h.length;p++)b=h[p].slice(0),m=d.y-b[1],b[1]+=2*m,g.points.push(b);return g}return void 0!==e.xmin?(g={v:e.xmin,C:e.ymin,B:e.xmax,G:e.ymax},void 0!==e.zmin&&(g.zmin=e.zmin,g.zmax=e.zmax),void 0!==e.mmin&&(g.mmin=e.mmin,g.mmax=e.mmax),m=d.y-e.ymin,g.ymax=e.ymin+2*m,m=d.y-e.ymax,g.ymin=e.ymax+2*m,g):null};return a}();a.Wn=h})(A||(A={}));(function(a){var h=function(){function h(){}h.jg=function(e,d){null==d&&(d=a.Od.Tf());switch(e){case 33:return new a.Va(d);
case 322:return new a.yb(d);case 197:return new a.Vj(d);case 550:return new a.pe(d);case 1607:return new a.Xa(d);case 1736:return new a.Ka(d);default:throw a.g.ra("invalid argument.");}};return h}();a.sH=h})(A||(A={}));(function(a){var h=function(){function h(e,d){this.De=a.ga.Yc(e,-1);this.oa=new a.Ur;this.tk=d}h.prototype.wR=function(e){this.oa.Dr(Math.min(this.De.size,e));this.oa.$l(e)};h.prototype.addElement=function(e,d){if(void 0===d)return this.JJ(e);d=a.I.truncate(d%this.De.size);var g=this.De.get(d);
-1==g&&(g=this.oa.jh(),this.De.set(d,g));return this.oa.addElement(g,e)};h.prototype.JJ=function(e){var d=this.tk.vw(e),d=a.I.truncate(d%this.De.size),g=this.De.get(d);-1==g&&(g=this.oa.jh(),this.De.set(d,g));return this.oa.addElement(g,e)};h.prototype.Jc=function(e,d){if(void 0===d)this.dM(e);else{d=a.I.truncate(d%this.De.size);var g=this.De.get(d);if(-1==g)throw a.g.N();for(var m=this.oa.gc(g),h=-1;-1!=m;){var b=this.oa.bb(m);this.oa.da(m)==e?(this.oa.Jc(g,h,m),-1==this.oa.gc(g)&&(this.oa.Fg(g),
this.De.set(d,-1))):h=m;m=b}}};h.prototype.dM=function(e){var d=this.tk.vw(e),d=a.I.truncate(d%this.De.size),g=this.De.get(d);if(-1==g)throw a.g.N();for(var m=this.oa.gc(g),h=-1;-1!=m;){var b=this.oa.bb(m);this.oa.da(m)==e?(this.oa.Jc(g,h,m),-1==this.oa.gc(g)&&(this.oa.Fg(g),this.De.set(d,-1))):h=m;m=b}};h.prototype.DN=function(e){e=a.I.truncate(e%this.De.size);e=this.De.get(e);return-1==e?-1:this.oa.gc(e)};h.prototype.SN=function(e){return this.oa.bb(e)};h.prototype.kd=function(e){var d=this.tk.vw(this.da(e)),
d=a.I.truncate(d%this.De.size),g=this.De.get(d);if(-1==g)throw a.g.N();for(var m=this.oa.gc(g),h=-1;-1!=m;){if(m==e){this.oa.Jc(g,h,m);-1==this.oa.gc(g)&&(this.oa.Fg(g),this.De.set(d,-1));return}h=m;m=this.oa.bb(m)}throw a.g.N();};h.prototype.da=function(e){return this.oa.da(e)};h.prototype.clear=function(){this.De=a.ga.Yc(this.De.size,-1);this.oa.clear()};h.prototype.size=function(){return this.oa.HC()};return h}();a.AH=h})(A||(A={}));(function(a){var h=function(){function h(){this.ci=new a.Fc(3);
this.oa=new a.Fc(6);this.AP=!1;this.Wd=-1}h.prototype.bk=function(e){this.ci.Jc(e)};h.prototype.ou=function(){return this.ci.be()};h.prototype.Rs=function(e){this.oa.Jc(e)};h.prototype.Yx=function(){return this.oa.be()};h.prototype.Jy=function(e,d){this.ci.L(e,1,d)};h.prototype.Gu=function(e,d){this.ci.L(e,2,d)};h.prototype.aS=function(e,d){this.ci.L(e,3,d)};h.prototype.Hy=function(e,d){this.oa.L(e,4,d)};h.prototype.dS=function(e,d){this.oa.L(e,3,d)};h.prototype.RF=function(e,d){this.oa.L(e,2,d)};
h.prototype.jh=function(e){var d=this.Yx();this.oa.L(d,3,this.Wd);this.oa.L(d,4,0);this.oa.L(d,5,e);-1!=this.Wd&&this.RF(this.Wd,d);return this.Wd=d};h.prototype.Fg=function(e){this.CB(e);var d=this.oa.O(e,2),g=this.oa.O(e,3);-1!=d?this.dS(d,g):this.Wd=g;-1!=g&&this.RF(g,d);this.Rs(e);return g};h.prototype.Dr=function(e){this.oa.de(e)};h.prototype.DC=function(e){return this.oa.O(e,5)};h.prototype.$R=function(e,d){this.oa.L(e,5,d)};h.prototype.addElement=function(e,d){return this.AO(e,d)};h.prototype.AO=
function(e,d){var g=this.ou();this.Gu(g,-1);-1==this.oa.O(e,0)&&this.oa.L(e,0,g);var a=this.oa.O(e,1);this.Jy(g,a);-1!=a&&this.Gu(a,g);this.oa.L(e,1,g);this.setData(g,d);this.Hy(e,this.vq(e)+1);this.AP&&this.aS(g,e);return g};h.prototype.Jc=function(e,d){var g=this.ge(d),a=this.bb(d);-1!=g?this.Gu(g,a):this.oa.L(e,0,a);-1!=a?this.Jy(a,g):this.oa.L(e,1,g);this.bk(d);this.Hy(e,this.vq(e)-1);return a};h.prototype.$l=function(e){this.ci.de(e)};h.prototype.getData=function(e){return this.ci.O(e,0)};h.prototype.setData=
function(e,d){this.ci.L(e,0,d)};h.prototype.bb=function(e){return this.ci.O(e,2)};h.prototype.ge=function(e){return this.ci.O(e,1)};h.prototype.gc=function(e){return this.oa.O(e,0)};h.prototype.tc=function(e){return this.oa.O(e,1)};h.prototype.clear=function(){for(var e=this.Wd;-1!=e;)e=this.Fg(e)};h.prototype.CB=function(e){for(var d=this.tc(e);-1!=d;){var g=d,d=this.ge(g);this.bk(g)}this.oa.L(e,0,-1);this.oa.L(e,1,-1);this.Hy(e,0)};h.prototype.s=function(){return 0==this.ci.size};h.prototype.HC=
function(){return this.ci.size};h.prototype.vq=function(e){return this.oa.O(e,4)};h.prototype.Cw=function(e){return this.oa.O(e,3)};return h}();a.$n=h})(A||(A={}));(function(a){var h=function(){function h(e){void 0===e?(this.bg=new a.Fc(2),this.oa=new a.Fc(4),this.Wd=-1,this.Bt=!0):(this.bg=new a.Fc(2),this.oa=new a.Fc(e?4:2),this.Wd=-1,this.Bt=e)}h.prototype.bk=function(e){this.bg.Jc(e)};h.prototype.ou=function(){return this.bg.be()};h.prototype.Rs=function(e){this.oa.Jc(e)};h.prototype.Yx=function(){return this.oa.be()};
h.prototype.jh=function(){var e=this.Yx();this.Bt&&(this.oa.L(e,3,this.Wd),-1!=this.Wd&&this.oa.L(this.Wd,2,e),this.Wd=e);return e};h.prototype.Fg=function(e){for(var d=this.gc(e);-1!=d;){var g=d,d=this.bb(d);this.bk(g)}this.Bt&&(d=this.oa.O(e,2),g=this.oa.O(e,3),-1!=d?this.oa.L(d,3,g):this.Wd=g,-1!=g&&this.oa.L(g,2,d));this.Rs(e)};h.prototype.Dr=function(e){this.oa.de(e)};h.prototype.addElement=function(e,d){var g=this.oa.O(e,1),a=this.ou();-1!=g?this.bg.L(g,1,a):this.oa.L(e,0,a);this.oa.L(e,1,a);
this.bg.L(a,0,d);return a};h.prototype.$l=function(e){this.bg.de(e)};h.prototype.Jc=function(e,d,g){-1!=d?(this.bg.L(d,1,this.bg.O(g,1)),this.oa.O(e,1)==g&&this.oa.L(e,1,d)):(this.oa.L(e,0,this.bg.O(g,1)),this.oa.O(e,1)==g&&this.oa.L(e,1,-1));this.bk(g)};h.prototype.Qv=function(e,d){var g=this.oa.O(e,1),a=this.oa.O(d,0);-1!=a&&(-1!=g?this.bg.L(g,1,a):this.oa.L(e,0,a),this.oa.L(e,1,this.oa.O(d,1)));this.Bt&&(g=this.oa.O(d,2),a=this.oa.O(d,3),-1!=g?this.oa.L(g,3,a):this.Wd=a,-1!=a&&this.oa.L(a,2,g));
this.Rs(d)};h.prototype.da=function(e){return this.bg.O(e,0)};h.prototype.Vi=function(e,d){this.bg.L(e,0,d)};h.prototype.bb=function(e){return this.bg.O(e,1)};h.prototype.gc=function(e){return this.oa.O(e,0)};h.prototype.Dm=function(e){return this.da(this.gc(e))};h.prototype.clear=function(){this.bg.Nh(!0);this.oa.Nh(!0);this.Wd=-1};h.prototype.s=function(e){return void 0===e?0==this.bg.size:-1==this.oa.O(e,0)};h.prototype.HC=function(){return this.bg.size};h.prototype.Cw=function(e){return this.oa.O(e,
3)};return h}();a.Ur=h})(A||(A={}));(function(a){var h=function(){function h(){}h.kz=function(e,d,g,m,b,c,p){var u=new a.b;u.J(e);e=new a.b;e.J(d);b.vv(u);b.vv(e);d=b.ms(u);var C=b.ms(e);0==C&&(C=b.CC());if(u.x!=e.x&&(u.y!=e.y||u.y!=b.C&&u.y!=b.G)||C>d!=c){d=b.vA(u);var C=b.vA(e),f,l=c?1:3;do d=d+l&3,f=b.vu(d),0!=p&&(m=h.kz(u,f,g,m,b,c,p)),g[m++].ma(f.x,f.y),u=f;while((d&3)!=C);0!=p&&(m=h.kz(u,e,g,m,b,c,p))}else if(b=new a.b,b.ma(e.x-u.x,e.y-u.y),0!=p&&(p=a.I.truncate(b.yJ()/p),0<p))for(b.scale(1/
(p+1)),c=0;c<p;c++)u.add(b),g[m++].ma(u.x,u.y);return m};h.zd=function(e,d,g){d=d.lv();e=null!=e&&void 0!==e.Ko?e.Ko():0;g&&(d*=4,e*=1.1);return Math.max(e,d)};h.As=function(e){return 2*Math.sqrt(2)*e};h.UJ=function(e){return Math.sqrt(2)*e};h.Cg=function(e,d,g){var m=new a.i;d.o(m);return h.zd(e,m,g)};h.rB=function(e,d,g){d=d.Ah(1,0).lv();e=null!=e?e.Ko():0;g&&(d*=4,e*=1.1);return Math.max(e,d)};h.$T=function(e,d){var g=new a.i;e.dd(g);g.Db(d);return g};h.$s=function(e,d){var g=new a.i;e.dd(g);e=
new a.i;d.dd(e);g.Db(e);return g};h.fU=function(e,d){var g=e.HN(d),m=e.Ea(d),h=e.Dc(d),b=e.Fa(g);g==m?(h=e.Fa(h-1),g=e.Fa(m+1)):g==h-1?(h=e.Fa(g-1),g=e.Fa(m)):(h=e.Fa(g-1),g=e.Fa(g+1));b=a.b.yn(h,b,g);return 0==b?0<e.oo(d):-1==b};h.CK=function(e){var d=new a.i;e.dd(d);if(d.s())return null;var g=new a.co(d,8),m=-1,h=new a.i,b=!1;do for(var c=0,p=e.ea();c<p;c++)if(e.Ti(c,h),m=g.kt(c,h,m),-1==m){if(b)throw a.g.ra("internal error");e.tm(d,!1);b=!0;g.reset(d,8);break}else b=!1;while(b);return g};h.nB=
function(e){var d=new a.i;e.dd(d);for(var g=new a.co(d,8),m=-1,h=e.Ca(),b=new a.i,c=!1;h.kb();)for(;h.La();){var p=h.ia(),f=h.Jb();p.o(b);m=g.kt(f,b,m);if(-1==m){if(c)throw a.g.wa();e.tm(d,!1);c=!0;g.reset(d,8);h.Lk();break}}return g};h.ij=function(e,d){var g=new a.i;e.dd(g);for(var m=new a.co(g,8),h=-1,b=new a.i,c=e.Ca(),p=!1;c.kb();)for(;c.La();){var f=c.ia(),l=c.Jb();f.o(b);if(b.jc(d)&&(h=m.kt(l,b,h),-1==h)){if(p)throw a.g.ra("internal error.");e.tm(g,!1);p=!0;m.reset(g,8);c.Lk();break}}return m};
h.DT=function(e){var d=new a.i;e.dd(d);for(var g=new a.co(d,8),m=new a.b,h=new a.i,b=!1,c=0;c<e.F();c++)if(e.w(c,m),h.K(m),-1==g.lg(c,h)){if(b)throw a.g.wa();e.tm(d,!1);b=!0;g.reset(d,8);c=-1}return g};h.oB=function(e,d){for(var g=new a.co(d,8),m=new a.b,h=!1,b=new a.i,c=0;c<e.F();c++)if(e.w(c,m),d.contains(m)&&(b.K(m),-1==g.lg(c,b))){if(h)throw a.g.wa();h=!0;c=new a.i;e.tm(c,!1);g.reset(c,8);c=-1}return g};h.AN=function(e,d,g){var m=new a.i,h=new a.i;e.dd(m);d.dd(h);m.P(g,g);h.P(g,g);var b=new a.i;
b.K(m);b.Ga(h);e=e.Ca();d=d.Ca();var c=new a.sz;c.YF(g);var p=!1;for(c.jG();e.kb();)for(;e.La();)e.ia().o(m),m.jc(b)&&(p=!0,g=new a.i,g.K(m),c.OA(e.Jb(),g));c.$B();if(!p)return null;m=!1;for(c.iG();d.kb();)for(;d.La();)d.ia().o(h),h.jc(b)&&(m=!0,g=new a.i,g.K(h),c.LA(d.Jb(),g));c.ZB();return m?c:null};h.BN=function(e,d,g,m,h){var b=e.D(),u=d.D(),c=new a.i,p=new a.i;e.dd(c);d.dd(p);c.P(g,g);p.P(g,g);var f=new a.i;f.K(c);f.Ga(p);var l=new a.sz;l.YF(g);var q=!1;l.jG();var n=0;for(g=e.ea();n<g;n++)if(!m||
1736!=b||e.qt(n))e.Ti(n,c),c.jc(f)&&(q=!0,l.OA(n,c));l.$B();if(!q)return null;e=!1;l.iG();m=0;for(g=d.ea();m<g;m++)if(!h||1736!=u||d.qt(m))d.Ti(m,p),p.jc(f)&&(e=!0,l.LA(m,p));l.ZB();return e?l:null};h.hU=function(e,d){return 0<e.rj(d)};h.zT=function(e,d){var g=new a.i;e.hR(d,g);var g=new a.co(g,8),m=-1,h=new a.i;e=e.Ca();e.vy(d);if(e.kb())for(;e.La();){d=e.ia();var b=e.Jb();d.dd(h);m=g.kt(b,h,m);if(-1==m)throw a.g.ra("internal error");}return g};return h}();a.Ia=h})(A||(A={}));(function(a){var h=
function(){function d(d){this.Na=d}d.prototype.compare=function(d,e,a){d=d.da(a);a=this.Na.uj(e);var m=this.Na.uj(d);return a<m?-1:a==m?g.Po(e)&&g.st(d)?-1:g.Po(d)&&g.st(e)?1:0:1};return d}(),b=function(){function d(d){this.Na=d}d.prototype.Zp=function(d,e,g){this.Na.yS(g,d,e)};d.prototype.Mo=function(d){return this.Na.uj(d)};return d}(),e;(function(d){d[d.initialize=0]="initialize";d[d.pIn=1]="pIn";d[d.pL=2]="pL";d[d.pR=3]="pR";d[d.pT=4]="pT";d[d.right=5]="right";d[d.left=6]="left";d[d.all=7]="all"})(e||
(e={}));var d=function(){function d(){this.Na=null;this.gi=new a.Nd;this.ug=new a.ga(0);this.$f=[0,0]}d.prototype.Ch=function(d,e){this.gi.qa=d.qa-e;this.gi.va=d.va+e;this.ug.resize(0);this.Ud=0;this.$f[0]=0};d.prototype.uy=function(d,e,g){if(d>e)throw a.g.N();this.gi.qa=d-g;this.gi.va=e+g;this.ug.resize(0);this.Ud=0;this.$f[0]=0};d.prototype.Fn=function(d,e){this.gi.qa=d-e;this.gi.va=d+e;this.ug.resize(0);this.Ud=0;this.$f[0]=0};d.prototype.next=function(){if(!this.Na.Vo)throw a.g.xa();if(0>this.Ud)return-1;
for(var d=!0;d;)switch(this.$f[this.Ud]){case 1:d=this.uQ();break;case 2:d=this.vQ();break;case 3:d=this.wQ();break;case 4:d=this.xQ();break;case 5:d=this.BR();break;case 6:d=this.sP();break;case 7:d=this.XJ();break;case 0:d=this.Qw();break;default:throw a.g.wa();}return-1!=this.pg?this.Bo()>>1:-1};d.JT=function(e,g,a){var m=new d;m.Na=e;m.ug.xb(20);m.Ch(g,a);return m};d.KT=function(e,g,a){var m=new d;m.Na=e;m.ug.xb(20);m.Fn(g,a);return m};d.Oa=function(e){var g=new d;g.Na=e;g.ug.xb(20);g.Ud=-1;return g};
d.prototype.Qw=function(){this.pg=this.YD=this.di=this.yc=-1;if(null!=this.Na.Yd&&0<this.Na.Yd.size)return this.$f[0]=1,this.di=this.Na.Ze,!0;this.Ud=-1;return!1};d.prototype.uQ=function(){this.yc=this.di;if(-1==this.yc)return this.pg=this.Ud=-1,!1;var d=this.Na.Co(this.yc);if(this.gi.va<d)return d=this.Na.tj(this.yc),this.di=this.Na.Di(this.yc),-1!=d&&(this.vh=this.Na.gk(d),this.$f[++this.Ud]=6),!0;if(d<this.gi.qa)return d=this.Na.tj(this.yc),this.di=this.Na.sj(this.yc),-1!=d&&(this.vh=this.Na.uq(d),
this.$f[++this.Ud]=5),!0;this.$f[this.Ud]=2;this.YD=this.yc;d=this.Na.tj(this.yc);this.di=this.Na.Di(this.yc);-1!=d&&(this.vh=this.Na.gk(d),this.$f[++this.Ud]=7);return!0};d.prototype.vQ=function(){this.yc=this.di;if(-1==this.yc)return this.$f[this.Ud]=3,this.di=this.Na.sj(this.YD),!0;if(this.Na.Co(this.yc)<this.gi.qa){var d=this.Na.tj(this.yc);this.di=this.Na.sj(this.yc);-1!=d&&(this.vh=this.Na.uq(d),this.$f[++this.Ud]=5);return!0}d=this.Na.tj(this.yc);this.di=this.Na.Di(this.yc);-1!=d&&(this.vh=
this.Na.gk(d),this.$f[++this.Ud]=7);d=this.Na.sj(this.yc);-1!=d&&this.ug.add(d);return!0};d.prototype.wQ=function(){this.yc=this.di;if(-1==this.yc)return this.$f[this.Ud]=4,!0;if(this.gi.va<this.Na.Co(this.yc)){var d=this.Na.tj(this.yc);this.di=this.Na.Di(this.yc);-1!=d&&(this.vh=this.Na.gk(d),this.$f[++this.Ud]=6);return!0}d=this.Na.tj(this.yc);this.di=this.Na.sj(this.yc);-1!=d&&(this.vh=this.Na.gk(d),this.$f[++this.Ud]=7);d=this.Na.Di(this.yc);-1!=d&&this.ug.add(d);return!0};d.prototype.xQ=function(){if(0==
this.ug.size)return this.pg=this.Ud=-1,!1;this.yc=this.ug.get(this.ug.size-1);this.ug.resize(this.ug.size-1);var d=this.Na.tj(this.yc);-1!=d&&(this.vh=this.Na.gk(d),this.$f[++this.Ud]=7);-1!=this.Na.Di(this.yc)&&this.ug.add(this.Na.Di(this.yc));-1!=this.Na.sj(this.yc)&&this.ug.add(this.Na.sj(this.yc));return!0};d.prototype.sP=function(){this.pg=this.vh;if(-1!=this.pg&&g.Po(this.Bo())&&this.Na.uj(this.Bo())<=this.gi.va)return this.vh=this.GC(),!1;this.Ud--;return!0};d.prototype.BR=function(){this.pg=
this.vh;if(-1!=this.pg&&g.st(this.Bo())&&this.Na.uj(this.Bo())>=this.gi.qa)return this.vh=this.bO(),!1;this.Ud--;return!0};d.prototype.XJ=function(){this.pg=this.vh;if(-1!=this.pg&&g.Po(this.Bo()))return this.vh=this.GC(),!1;this.Ud--;return!0};d.prototype.GC=function(){return this.Na.Df?this.Na.If.bb(this.pg):this.Na.ki.bb(this.pg)};d.prototype.bO=function(){return this.Na.Df?this.Na.If.ge(this.pg):this.Na.ki.ge(this.pg)};d.prototype.Bo=function(){return this.Na.Df?this.Na.If.da(this.pg):this.Na.ki.getData(this.pg)};
return d}();a.IT=d;var g=function(){function e(d){this.Al=this.rh=this.If=this.ki=this.Hl=this.Ki=this.Yd=this.Li=null;this.Df=d;this.Vo=this.Dt=!1}e.prototype.Vp=function(){this.Rj(!0)};e.prototype.gq=function(d,e){if(!this.Dt)throw a.g.xa();this.Li.push(new a.Nd(d,e))};e.prototype.wo=function(){if(!this.Dt)throw a.g.ra("invalid call");this.Dt=!1;this.Vo=!0;this.Df||(this.BO(),this.Jt=this.Li.length)};e.prototype.lg=function(d){if(!this.Df||!this.Vo)throw a.g.N("invalid call");if(-1==this.Ze){var e=
this.Li.length;if(this.nx){var g=new a.ga(0);g.xb(2*e);this.$E(g);this.rh.xb(2*e);this.rh.resize(0);this.ZE(g);this.Hl.resize(e,-1);this.Hl.dh(-1,0,e);this.nx=!1}else this.Hl.dh(-1,0,e);this.Ze=this.Ms()}e=this.cD(d<<1,this.Ze);g=this.If.addElement((d<<1)+1,this.Hw(e));this.TF(e,g);this.Hl.set(d,e);this.Jt++};e.prototype.remove=function(d){if(!this.Df||!this.Vo)throw a.g.ra("invalid call");var e=this.Hl.get(d);if(-1==e)throw a.g.N("the interval does not exist in the interval tree");this.Hl.set(d,
-1);this.Jt--;var g=this.Hw(e),m;m=this.If.hO(g);this.If.kd(this.LN(e),g);this.If.kd(this.eO(e),g);d=this.If.size(g);0==d&&(this.If.fM(g),this.WF(m,-1));this.Ki.Jc(e);for(var g=this.JC(m),h=this.Di(m),b=this.sj(m),e=0;!(0<d||m==this.Ze||-1!=h&&-1!=b);)m==this.Di(g)?-1!=h?(this.Sj(g,h),this.Xi(h,g),this.Sj(m,-1)):-1!=b?(this.Sj(g,b),this.Xi(b,g),this.Uj(m,-1)):this.Sj(g,-1):-1!=h?(this.Uj(g,h),this.Xi(h,g),this.Sj(m,-1)):-1!=b?(this.Uj(g,b),this.Xi(b,g),this.Uj(m,-1)):this.Uj(g,-1),this.Xi(m,-1),e++,
m=g,g=this.tj(m),d=-1!=g?this.If.size(g):0,h=this.Di(m),b=this.sj(m),g=this.JC(m)};e.prototype.reset=function(){if(!this.Df||!this.Vo)throw a.g.N("invalid call");this.Rj(!1)};e.prototype.size=function(){return this.Jt};e.prototype.Re=function(){return d.Oa(this)};e.prototype.$E=function(d){for(var e=this.Li.length,g=0;g<2*e;g++)d.add(g);this.zS(d,2*e)};e.prototype.ZE=function(d){for(var e=NaN,g=0;g<d.size;g++){var a=d.get(g),m=this.uj(a);m!=e&&(this.rh.add(a),e=m)}};e.prototype.BO=function(){var d=
this.Li.length,e=new a.ga(0);e.xb(2*d);this.$E(e);this.rh.xb(2*d);this.rh.resize(0);this.ZE(e);this.Ki.de(d);this.ki.$l(2*d);var g=a.Ac.Dg(d);g.dh(-1,0,d);this.Ze=this.Ms();for(d=0;d<e.size;d++){var m=e.get(d),h=g.get(m>>1);-1!=h?this.TF(h,this.ki.addElement(this.Hw(h),m)):(h=this.cD(m,this.Ze),g.set(m>>1,h))}};e.prototype.cD=function(d,e){var g=e,m=e,h,b=-1,u=0,c=this.rh.size-1,p=0,C=d>>1,f=NaN,l=NaN;h=!0;for(var q=this.RN(C),C=this.ON(C);h;){u<c?(p=u+a.I.truncate((c-u)/2),-1==this.rw(g)&&this.CF(g,
this.rh.get(p),this.rh.get(p+1))):-1==this.rw(g)&&this.CF(g,this.rh.get(u),this.rh.get(u));var n=this.Co(g);if(C<n)-1!=e&&(e==g?(m=g,f=n,e=this.Di(g),-1!=e?l=this.Co(e):l=NaN):l>n&&(n<f?this.Sj(m,g):this.Uj(m,g),this.Uj(g,e),this.Df&&(this.Xi(g,m),this.Xi(e,g)),m=g,f=n,e=-1,l=NaN)),c=this.MN(g),-1==c&&(c=this.Ms(),this.YR(g,c)),g=c,c=p;else if(q>n)-1!=e&&(e==g?(m=g,f=n,e=this.sj(g),-1!=e?l=this.Co(e):l=NaN):l<n&&(n<f?this.Sj(m,g):this.Uj(m,g),this.Sj(g,e),this.Df&&(this.Xi(g,m),this.Xi(e,g)),m=g,
f=n,e=-1,l=NaN)),u=this.fO(g),-1==u&&(u=this.Ms(),this.iS(g,u)),g=u,u=p+1;else{h=this.tj(g);-1==h&&(h=this.TL(g),this.WF(g,h));var z=this.KJ(h,d),b=this.SL();this.lS(b,h);this.XR(b,z);g!=e&&(n<f?this.Sj(m,g):this.Uj(m,g),this.Df&&this.Xi(g,m),-1!=e&&(l<n?this.Sj(g,e):this.Uj(g,e),this.Df&&this.Xi(e,g)));h=!1}}return b};e.prototype.Ms=function(){return this.Yd.be()};e.prototype.TL=function(d){return this.Df?this.If.nq(d):this.ki.jh(d)};e.prototype.SL=function(){return this.Ki.be()};e.prototype.Rj=
function(d){d?(this.Dt=this.nx=!0,this.Vo=!1,null==this.rh?this.rh=a.Ac.Dg(0):this.rh.resize(0),null==this.Li?this.Li=[]:this.Li.length=0):this.nx=!1;this.Df?null==this.Hl?(this.Hl=a.Ac.Dg(0),this.If=new a.bj,this.If.Hn(new h(this))):this.If.clear():null==this.ki?this.ki=new a.$n:this.ki.clear();null==this.Yd?(this.Ki=new a.Fc(3),this.Yd=new a.Fc(this.Df?8:7)):(this.Ki.Nh(!1),this.Yd.Nh(!1));this.Ze=-1;this.Jt=0};e.prototype.CF=function(d,e,g){this.SR(d,e);this.TR(d,g)};e.prototype.Co=function(d){var e=
this.rw(d);if(-1==e)return NaN;e=this.uj(e);d=this.uj(this.wN(d));return e==d?e:.5*(e+d)};e.prototype.SR=function(d,e){this.Yd.L(d,0,e)};e.prototype.TR=function(d,e){this.Yd.L(d,1,e)};e.prototype.YR=function(d,e){this.Yd.L(d,3,e)};e.prototype.iS=function(d,e){this.Yd.L(d,4,e)};e.prototype.WF=function(d,e){this.Yd.L(d,2,e)};e.prototype.Sj=function(d,e){this.Yd.L(d,5,e)};e.prototype.Uj=function(d,e){this.Yd.L(d,6,e)};e.prototype.Xi=function(d,e){this.Yd.L(d,7,e)};e.prototype.lS=function(d,e){this.Ki.L(d,
0,e)};e.prototype.KJ=function(d,e){return this.Df?this.If.addElement(e,d):this.ki.addElement(d,e)};e.prototype.XR=function(d,e){this.Ki.L(d,1,e)};e.prototype.TF=function(d,e){this.Ki.L(d,2,e)};e.prototype.gk=function(d){return this.Df?this.If.gc(d):this.ki.gc(d)};e.prototype.uq=function(d){return this.Df?this.If.tc(d):this.ki.tc(d)};e.Po=function(d){return 0==(d&1)};e.st=function(d){return 1==(d&1)};e.prototype.rw=function(d){return this.Yd.O(d,0)};e.prototype.wN=function(d){return this.Yd.O(d,1)};
e.prototype.tj=function(d){return this.Yd.O(d,2)};e.prototype.MN=function(d){return this.Yd.O(d,3)};e.prototype.fO=function(d){return this.Yd.O(d,4)};e.prototype.Di=function(d){return this.Yd.O(d,5)};e.prototype.sj=function(d){return this.Yd.O(d,6)};e.prototype.JC=function(d){return this.Yd.O(d,7)};e.prototype.Hw=function(d){return this.Ki.O(d,0)};e.prototype.LN=function(d){return this.Ki.O(d,1)};e.prototype.eO=function(d){return this.Ki.O(d,2)};e.prototype.RN=function(d){return this.Li[d].qa};e.prototype.ON=
function(d){return this.Li[d].va};e.prototype.zS=function(d,e){null==this.Al&&(this.Al=new a.Rr);var g=new b(this);this.Al.sort(d,0,e,g)};e.prototype.yS=function(d,g,a){var m=this;d.xd(g,a,function(d,g){var a=m.uj(d),h=m.uj(g);return a<h||a==h&&e.Po(d)&&e.st(g)?-1:1})};e.prototype.uj=function(d){var g=this.Li[d>>1];return e.Po(d)?g.qa:g.va};return e}();a.bq=g})(A||(A={}));(function(a){var h=function(h){function e(d,e,m,b){h.call(this);void 0===d?this.description=a.Od.Tf():void 0===m?this.description=
d:(this.description=a.Od.Tf(),this.Ny(d,e),this.Ok(m,b))}z(e,h);e.prototype.D=function(){return 322};e.prototype.$b=function(){var d=this.na-this.la,e=this.ja-this.ha;return Math.sqrt(d*d+e*e)};e.prototype.mg=function(d){var e=this.na-this.la,a=this.ja-this.ha;return Math.sqrt(e*e+a*a)<=d};e.prototype.mD=function(){return!1};e.prototype.Pf=function(){var d=new a.b;d.pc(this.oc(),this.Mb());return d};e.prototype.Fp=function(d){d.Ja();d.Qf(this.description);var e=new a.i;this.o(e);d.Cu(e);for(var e=
1,m=this.description.Aa;e<m;e++)for(var h=this.description.Hd(e),b=a.pa.Wa(h);e<b;e++){var c=this.Ah(h,0);d.setInterval(h,0,c)}};e.prototype.o=function(d){d.K(this.na,this.ja,this.la,this.ha);d.normalize()};e.prototype.Cn=function(d){d.Ja();d.Db(this.na,this.ja,this.yd(0,1,0));d.Db(this.la,this.ha,this.yd(1,1,0))};e.prototype.Oe=function(d){if(d instanceof a.Bg){this.qc();var e=new a.b;e.x=this.na;e.y=this.ja;d.Zi(e,e);this.na=e.x;this.ja=e.y;e.x=this.la;e.y=this.ha;d.Zi(e,e);this.la=e.x;this.ha=
e.y}else this.qc(),e=new a.ee,e.x=this.na,e.y=this.ja,e.z=this.yd(0,1,0),e=d.Qn(e),this.na=e.x,this.ja=e.y,this.om(0,1,0,e.z),e.x=this.la,e.y=this.ha,e.z=this.yd(1,1,0),e=d.Qn(e),this.la=e.x,this.ha=e.y,this.om(1,1,0,e.z)};e.prototype.Pa=function(){return new e(this.description)};e.prototype.kv=function(d,e){return(this.la-d-(this.na-d))*(this.ha-e+(this.ja-e))*.5};e.prototype.Ru=function(d){return d*this.$b()};e.prototype.AD=function(d){return d/this.$b()};e.prototype.sC=function(d){return a.vi.ut(this.na,
this.la,d)};e.prototype.vN=function(d){return a.vi.ut(this.ja,this.ha,d)};e.prototype.xm=function(d,e){var g=new a.Ag;this.Bi(d,e,g);return g.get()};e.prototype.Bi=function(d,e,m){if(null==m)throw a.g.N();m.mq();m=m.get();m.Qf(this.description);var g=new a.b;this.Kb(d,g);m.Ny(g.x,g.y);this.Kb(e,g);m.Ok(g.x,g.y);for(var g=1,h=this.description.Aa;g<h;g++)for(var b=this.description.Fd(g),c=a.pa.Wa(b),p=0;p<c;p++){var f=this.ld(d,b,p);m.My(b,p,f);f=this.ld(e,b,p);m.Cy(b,p,f)}};e.prototype.ld=function(d,
e,m){if(0==e)return 0==m?this.Kb(d).x:this.Kb(d).y;switch(a.pa.JN(e)){case 0:return.5>d?this.gt(e,m):this.Ws(e,m);case 1:var g=this.gt(e,m);e=this.Ws(e,m);return a.vi.ut(g,e,d);case 2:throw a.g.ra("not implemented");}throw a.g.wa();};e.prototype.Gd=function(d,e){var g=this.la-this.na,a=this.ha-this.ja,h=g*g+a*a;if(0==h)return.5;g=((d.x-this.na)*g+(d.y-this.ja)*a)/h;e||(0>g?g=0:1<g&&(g=1));return g};e.prototype.nt=function(d,e,a,h){if(d){d=this.ha-this.ja;if(0==d)return e==this.ha?-1:0;e=(e-this.ja)/
d;if(0>e||1<e)return 0;null!=a&&(a[0]=this.sC(e))}else{d=this.la-this.na;if(0==d)return e==this.la?-1:0;e=(e-this.na)/d;if(0>e||1<e)return 0;null!=a&&(a[0]=this.vN(e))}null!=h&&(h[0]=e);return 1};e.prototype.xe=function(d,e){var g=this.ha-this.ja;if(0==g)return d==this.ha?e:NaN;g=(d-this.ja)/g;d=this.sC(g);1==g&&(d=this.la);return d};e.prototype.qs=function(d,e,a){return 0<=this.ho(d.x,d.y,e,a)};e.prototype.Kh=function(d,e,a){return 0<=this.ho(d,e,a,!0)};e.prototype.Eq=function(d,e){return this.qs(d,
e,!1)};e.prototype.KE=function(){if(this.ha<this.ja||this.ha==this.ja&&this.la<this.na){var d=this.na;this.na=this.la;this.la=d;d=this.ja;this.ja=this.ha;this.ha=d;for(var d=0,e=this.description.up-2;d<e;d++){var a=this.fa[d];this.fa[d]=this.fa[d+e];this.fa[d+e]=a}}};e.prototype.rs=function(d,e){d=a.b.Oa(d,e);d.sub(this.Mb());e=new a.b;e.pc(this.oc(),this.Mb());var g=e.Ai(d);d=8.881784197001252E-16*(Math.abs(e.x*d.y)+Math.abs(e.y*d.x));return g>d?-1:g<-d?1:0};e.prototype.ho=function(d,e,m,h){var g=
this.na,b=this.ja,c=d-g,u=e-b,c=Math.sqrt(c*c+u*u);if(c<=Math.max(m,6.661338147750939E-16*c))return h&&0==c?NaN:0;c=d-this.la;u=e-this.ha;c=Math.sqrt(c*c+u*u);if(c<=Math.max(m,6.661338147750939E-16*c))return h&&0==c?NaN:1;c=this.la-this.na;u=this.ha-this.ja;h=Math.sqrt(c*c+u*u);if(0<h){var p=1/h,c=c*p,u=u*p,f=d-g,l=e-b,q=f*c+l*u,n=1.7763568394002505E-15*(Math.abs(f*c)+Math.abs(l*u)),z=c,c=-u,u=z,n=Math.max(m,n);if(q<-n||q>h+n)return NaN;if(Math.abs(f*c+l*u)<=Math.max(m,1.7763568394002505E-15*(Math.abs(f*
c)+Math.abs(l*u)))&&(c=a.I.Kr(q*p,0,1),.5>=c?(u=this.na+(this.la-this.na)*c,h=this.ja+(this.ha-this.ja)*c):(u=this.la-(this.la-this.na)*(1-c),h=this.ha-(this.ha-this.ja)*(1-c)),a.b.Yv(u,h,d,e)<=m)){if(.5>c){if(a.b.Yv(u,h,g,b)<=m)return 0}else if(a.b.Yv(u,h,this.la,this.ha)<=m)return 1;return c}}return NaN};e.prototype.lc=function(d){return null==d?!1:d==this?!0:d.constructor!==this.constructor?!1:this.sJ(d)};e.prototype.AA=function(d,e,m){var g=m?this.na:this.la;m=m?this.ja:this.ha;var h=new a.b;
h.x=d.la-g;h.y=d.ha-m;return e.ml(h)>6.661338147750939E-16*e.uA(h)?(h.x=d.na-g,h.y=d.ja-m,e.ml(h)<=6.661338147750939E-16*e.uA(h)):!0};e.prototype.zA=function(d){var e=new a.b;e.x=this.la-this.na;e.y=this.ha-this.ja;if(!this.AA(d,e,!1))return!1;e.Bp();return this.AA(d,e,!0)?!0:!1};e.ye=function(d,e){var g=d.rs(e.na,e.ja),a=d.rs(e.la,e.ha);if(0>g&&0>a||0<g&&0<a)return!1;g=e.rs(d.na,d.ja);a=e.rs(d.la,d.ha);if(0>g&&0>a||0<g&&0<a)return!1;g=d.$b();a=e.$b();return g>a?d.zA(e):e.zA(d)};e.Id=function(d,e,
m){var g=a.b.Oa(NaN,NaN),h=d.la-d.na,b=d.ha-d.ja,c=e.la-e.na,p=e.ha-e.ja,f=c*b-h*p;if(0==f)return g;var l=8.881784197001252E-16*(Math.abs(c*b)+Math.abs(h*p)),q=e.na-d.na,n=e.ja-d.ja,z=c*n-q*p,k=z/f,t=Math.abs(f),c=(8.881784197001252E-16*(Math.abs(c*n)+Math.abs(q*p))*t+l*Math.abs(z))/(f*f)+2.220446049250313E-16*Math.abs(k);if(k<-c||k>1+c)return g;p=h*n-q*b;c=p/f;h=(8.881784197001252E-16*(Math.abs(h*n)+Math.abs(q*b))*t+l*Math.abs(p))/(f*f)+2.220446049250313E-16*Math.abs(c);if(c<-h||c>1+h)return g;k=
a.I.Kr(k,0,1);h=a.I.Kr(c,0,1);b=d.Kb(k);f=e.Kb(h);l=new a.b;l.pc(b,f);if(l.length()>m&&(l.add(b,f),l.scale(.5),k=d.Gd(l,!1),h=e.Gd(l,!1),d=d.Kb(k),e=e.Kb(h),d.sub(e),d.length()>m))return g;g.ma(k,h);return g};e.xJ=function(d,g,a,h){var m=0;if(d.na==g.na&&d.ja==g.ja||d.na==g.la&&d.ja==g.ha)if(m++,!h)return 1;if(d.la==g.na&&d.ha==g.ja||d.la==g.la&&d.ha==g.ha){m++;if(2==m)return 2;if(!h)return 1}return g.Kh(d.na,d.ja,a)||g.Kh(d.la,d.ha,a)||d.Kh(g.na,g.ja,a)||d.Kh(g.la,g.ha,a)?1:h&&0!=m?0:0==e.ye(d,g)?
0:1};e.ov=function(d,g,m,h,b,c){var u=0,p=d.ho(g.na,g.ja,c,!1),C=d.ho(g.la,g.ha,c,!1),f=g.ho(d.na,d.ja,c,!1),l=g.ho(d.la,d.ha,c,!1);isNaN(p)||(null!=h&&(h[u]=p),null!=b&&(b[u]=0),null!=m&&(m[u]=a.b.Oa(g.na,g.ja)),u++);isNaN(C)||(null!=h&&(h[u]=C),null!=b&&(b[u]=1),null!=m&&(m[u]=a.b.Oa(g.la,g.ha)),u++);2==u||isNaN(f)||0==p&&0==f||0==C&&1==f||(null!=h&&(h[u]=0),null!=b&&(b[u]=f),null!=m&&(m[u]=a.b.Oa(d.na,d.ja)),u++);2==u||isNaN(l)||1==p&&0==l||1==C&&1==l||(null!=h&&(h[u]=1),null!=b&&(b[u]=l),null!=
m&&(m[u]=a.b.Oa(g.la,g.ha)),u++);if(0<u)return 2==u&&null!=h&&h[0]>h[1]&&(d=h[0],h[0]=h[1],h[1]=d,null!=b&&(h=b[0],b[0]=b[1],b[1]=h),null!=m&&(b=a.b.Oa(m[0].x,m[0].y),m[0]=m[1],m[1]=b)),u;u=e.Id(d,g,c);if(isNaN(u.x))return 0;null!=m&&(m[0]=d.Kb(u.x));null!=h&&(h[0]=u.x);null!=b&&(b[0]=u.y);return 1};e.prototype.TC=function(){return 0};e.prototype.eo=function(){};e.prototype.toString=function(){return"Line: ["+this.na.toString()+", "+this.ja.toString()+", "+this.la.toString()+", "+this.ha.toString()+
"]"};return e}(a.fA);a.yb=h})(A||(A={}));(function(a){var h=function(){function a(){this.Gl=[];this.ua=-1}a.prototype.ya=function(){return this.ua};a.prototype.next=function(){if(null!=this.Gl&&0!=this.Gl.length){this.ua++;var e=this.Gl[0];1>=this.Gl.length?this.Gl=[]:this.Gl=this.Gl.slice(1);return e}return this.Gl=null};return a}();a.MT=h})(A||(A={}));(function(a){(function(a){a[a.enumFillRuleOddEven=0]="enumFillRuleOddEven";a[a.enumFillRuleWinding=1]="enumFillRuleWinding"})(a.qI||(a.qI={}));var h=
function(h){function e(d,e){h.call(this);this.Yf=!1;this.np=null;this.ap=this.bp=0;this.Uh=null;this.ng=!1;this.td=this.li=this.Fe=this.qb=this.jb=null;this.gp=this.Qa=this.cp=0;if(void 0===e)this.Yf=d,this.ng=!1,this.ta=this.ap=this.bp=this.cp=0,this.description=a.Od.Tf();else{if(null==e)throw a.g.N();this.Yf=d;this.ng=!1;this.ta=this.ap=this.bp=this.cp=0;this.description=e}this.Uh=null;this.Qa=0}z(e,h);e.prototype.Hm=function(){return 0<this.cp};e.prototype.nv=function(){this.qc();null==this.np?
this.np=new a.Va(this.description):this.np.Qf(this.description)};e.prototype.Uy=function(d,e){var g=new a.b;g.x=d;g.y=e;this.Nr(g)};e.prototype.Nr=function(d){this.nv();this.np.ic(d);this.ng=!0};e.prototype.df=function(d){if(d.s())throw a.g.N();this.Ik(d.description);this.nv();d.copyTo(this.np);this.ng=!0};e.prototype.iv=function(){var d=1;this.ng&&(this.nv(),null==this.jb?(this.jb=a.Ac.Dg(2),this.jb.write(0,0),this.qb=a.Ac.to(2,0)):(this.jb.resize(this.jb.size+1,0),this.qb.resize(this.qb.size+1,
0)),this.Yf&&this.qb.write(this.qb.size-2,1),d++);var e=this.ta;this.jb.write(this.jb.size-1,this.ta+d);this.jo(e+d);this.qb.write(this.jb.size-1,0);this.ng&&(this.Iu(e,this.np),this.ng=!1)};e.prototype.wj=function(d,e){this.iv();this.ic(this.ta-1,d,e)};e.prototype.Lm=function(d){this.iv();this.ic(this.ta-1,d)};e.prototype.lineTo=function(d){this.iv();this.Iu(this.ta-1,d)};e.prototype.ro=function(){var d;this.Su();void 0===d&&(this.ng=!1,d=this.ea()-1);var e=this.qb.read(d);this.qb.write(d,e|1);null!=
this.Fe&&(d=this.Dc(d)-1,this.Fe.write(d,1),this.li.write(d,-1))};e.$i=function(d){return e.Id[d]};e.prototype.vc=function(d){return 0!=(this.qb.read(d)&1)};e.prototype.Oo=function(d){if(this.vc(d))return!0;var e=this.Ea(d);d=this.Dc(d)-1;if(e>d)return!1;e=this.Fa(e);d=this.Fa(d);return e.ub(d)};e.prototype.yq=function(d){return 0!=(this.qb.read(d)&2)};e.prototype.Bc=function(d,e){this.Ik(d.description);if(322==d.D()){var g=new a.Va;if(e||this.s())d.En(g),this.df(g);d.Bn(g);this.lineTo(g)}else throw a.g.wa();
};e.prototype.ws=function(d){var e=0==this.ta;this.Uy(d.v,d.C);this.wj(d.v,d.G);this.wj(d.B,d.G);this.wj(d.B,d.C);this.ro();this.ng=!1;e&&this.yf(256,!1)};e.prototype.Wc=function(d,e){if(!d.s()){for(var g=0==this.ta,h=new a.Va(this.description),b=0;4>b;b++)d.uf(e?4-b-1:b,h),0==b?this.df(h):this.lineTo(h);this.ro();this.ng=!1;g&&!e&&this.yf(256,!1)}};e.prototype.add=function(d,e){for(var g=0;g<d.ea();g++)this.Zj(d,g,!e)};e.prototype.Zj=function(d,e,a){this.Cf(-1,d,e,a)};e.prototype.lo=function(){this.Sw()};
e.prototype.ys=function(d,e,m,h,b){b||0!=this.ea()||(b=!0);0>e&&(e=d.ea()-1);if(e>=d.ea()||0>m||0>h||h>d.ct(e))throw a.g.ra("index out of bounds");if(0!=h){var g=d.vc(e)&&m+h==d.ct(e);if(!g||1!=h){this.ng=!1;this.Ik(d.description);m=d.Ea(e)+m+1;b&&(h++,m--);g&&h--;g=this.ta;this.jo(this.ta+h);this.kc();if(b){if(0==h)return;this.jb.add(this.ta);b=d.qb.read(e);b&=-5;this.Yf&&(b|=1);this.qb.write(this.qb.size-1,b);this.qb.add(0)}else this.jb.write(this.qb.size-1,this.ta);b=0;for(var c=this.description.Aa;b<
c;b++){var u=this.description.Hd(b),p=a.pa.Wa(u),C=d.description.zf(u);0>C||null==d.Ba[C]?this.Ba[b].ul(p*g,a.pa.ue(u),h*p,p*g):this.Ba[b].nk(p*g,d.Ba[C],p*m,h*p,!0,p,p*g)}if(this.Hm())throw a.g.wa();if(d.yq(e))throw a.g.wa();this.ce(1993)}}};e.prototype.Cr=function(d){this.kc();var e=this.ea();0>d&&(d=e-1);if(d>=e)throw a.g.N();for(var m=this.Ea(d),h=this.Ha(d),b=0,c=this.description.Aa;b<c;b++)if(null!=this.Ba[b]){var p=a.pa.Wa(this.description.Fd(b));this.Ba[b].oj(p*m,p*h,p*this.ta)}for(m=d+1;m<=
e;m++)b=this.jb.read(m),this.jb.write(m-1,b-h);if(null==this.qb)for(m=d+1;m<=e;m++)d=this.qb.read(m),this.qb.write(m-1,d);this.jb.resize(e);this.qb.resize(e);this.ta-=h;this.rg-=h;this.ce(1993)};e.prototype.Cf=function(d,e,m,h){if(e==this)throw a.g.N();if(m>=e.ea())throw a.g.N();var g=this.ea();if(d>g)throw a.g.N();0>d&&(d=g);0>m&&(m=e.ea()-1);this.ng=!1;this.Ik(e.description);e.kc();var b=e.Ea(m),c=e.Ha(m),u=this.ta,p=e.vc(m)&&!h?1:0;this.jo(this.ta+c);this.kc();for(var f=d<g?this.Ea(d):u,l=0,q=
this.description.Aa;l<q;l++){var n=this.description.Fd(l),z=e.description.zf(n),k=a.pa.Wa(n);0<=z&&null!=e.Ba[z]?(0!=p&&this.Ba[l].nk(f*k,e.Ba[z],k*b,k,!0,k,k*u),this.Ba[l].nk((f+p)*k,e.Ba[z],k*(b+p),k*(c-p),h,k,k*(u+p))):this.Ba[l].ul(f*k,a.pa.ue(n),k*c,k*u)}this.jb.add(u+c);for(h=g;h>=d+1;h--)b=this.jb.read(h-1),this.jb.write(h,b+c);e.yq(m);this.qb.add(0);for(h=g-1;h>=d+1;h--)g=this.qb.read(h),g&=-5,this.qb.write(h+1,g);g=e.VN().read(m);g&=-5;this.Yf&&(g|=1);this.qb.write(d,g)};e.prototype.Sw=function(){var d=
-1,e=this.ea();if(d>e)throw a.g.N();0>d&&(d=e);this.ng=!1;this.kc();this.jb.add(this.ta);for(var m=e;m>=d+1;m--){var h=this.jb.read(m-1);this.jb.write(m,h+0)}this.qb.add(0);for(m=e-1;m>=d+1;m--)e=this.qb.read(m),e&=-5,this.qb.write(m+1,e);this.Yf&&this.qb.write(d,1)};e.prototype.dD=function(d,e,m){var g=-1;0>d&&(d=this.ea());if(d>this.ea()||g>this.Ha(d)||m>e.length)throw a.g.ra("index out of bounds");if(0!=m){d==this.ea()&&(this.jb.add(this.ta),this.Yf?this.qb.add(1):this.qb.add(0));0>g&&(g=this.Ha(d));
this.kc();var h=this.ta;this.jo(this.ta+m);this.kc();for(var b=0,c=this.description.Aa;b<c;b++){var p=this.description.Fd(b),f=a.pa.Wa(p);this.Ba[b].km(f*(this.Ea(d)+g+m),(h-this.Ea(d)-g)*f,this.Ba[b],f*(this.Ea(d)+g),!0,f);0==b?this.Ba[b].$p(f*(this.Ea(d)+g),m,e,0,!0):this.Ba[b].dh(a.pa.ue(p),(this.Ea(d)+g)*f,m*f)}this.Hm()&&(this.Fe.km(this.Ea(d)+g+m,h-this.Ea(d)-g,this.Fe,this.Ea(d)+g,!0,1),this.li.km(this.Ea(d)+g+m,h-this.Ea(d)-g,this.li,this.Ea(d)+g,!0,1),this.Fe.dh(1,this.Ea(d)+g,m),this.li.dh(-1,
this.Ea(d)+g,m));d+=1;for(e=this.ea();d<=e;d++)this.jb.write(d,this.jb.read(d)+m)}};e.prototype.kf=function(d,e,m){var g=this.ea();0>d&&(d=this.ea());if(d>=g||e>this.Ha(d))throw a.g.ra("index out of bounds");d==this.ea()&&(this.jb.add(this.ta),this.Yf?this.qb.add(1):this.qb.add(0));0>e&&(e=this.Ha(d));var h=this.ta;this.jo(this.ta+1);this.kc();var b=this.Ea(d);this.Ba[0].lg(2*(b+e),m,2*h);m=1;for(var c=this.description.Aa;m<c;m++){var p=this.description.Fd(m),f=a.pa.Wa(p);this.Ba[m].ul(f*(b+e),a.pa.ue(p),
f,f*h)}for(d+=1;d<=g;d++)this.jb.write(d,this.jb.read(d)+1)};e.prototype.eF=function(d,e){var g=this.ea();0>d&&(d=g-1);if(d>=g||e>=this.Ha(d))throw a.g.ra("index out of bounds");this.kc();var h=this.Ea(d);0>e&&(e=this.Ha(d)-1);h+=e;e=0;for(var b=this.description.Aa;e<b;e++)if(null!=this.Ba[e]){var c=a.pa.Wa(this.description.Fd(e));this.Ba[e].oj(c*h,c,c*this.ta)}for(;g>=d+1;g--)h=this.jb.read(g),this.jb.write(g,h-1);this.ta--;this.rg--;this.ce(1993)};e.prototype.Rf=function(){return a.Hh.il(this,null)};
e.prototype.Ja=function(){this.cp=0;this.ng=!1;this.td=this.Fe=this.li=this.qb=this.jb=null;this.EA()};e.prototype.Oe=function(d){d instanceof a.Bg?this.ZA(d,-1):this.$J(d)};e.prototype.ZA=function(d,e){if(!this.s()&&!d.XO()){this.kc();var g=this.Ba[0],h=new a.b,b=new a.b,c,p,f;for(0>e?(c=this.Hm(),p=0,f=this.ta):(c=this.yq(e),p=this.Ea(e),f=this.Dc(e));p<f;p++){h.x=g.read(2*p);h.y=g.read(2*p+1);if(c&&(e=this.li.read(p),0<=e))switch(this.Fe.read(p)&7){case 2:b.x=this.td.read(e);b.y=this.td.read(e+
1);d.Zi(b,b);this.td.write(e,b.x);this.td.write(e+1,b.y);b.x=this.td.read(e+3);b.y=this.td.read(e+4);d.Zi(b,b);this.td.write(e+3,b.x);this.td.write(e+4,b.y);break;case 4:throw a.g.wa();}d.Zi(h,h);g.write(2*p,h.x);g.write(2*p+1,h.y)}this.ce(1993)}};e.prototype.$J=function(d){if(!this.s()){this.Ne(1);this.kc();for(var e=this.Ba[0],m=this.Ba[1],h=new a.ee,b=new a.ee,c=this.Hm(),p=0;p<this.ta;p++){h.x=e.read(2*p);h.y=e.read(2*p+1);h.z=m.read(p);if(c){var f=this.li.read(p);if(0<=f)switch(this.Fe.read(p)&
7){case 2:b.x=this.td.read(f);b.y=this.td.read(f+1);b.z=this.td.read(f+2);b=d.Qn(b);this.td.write(f,b.x);this.td.write(f+1,b.y);this.td.write(f+1,b.z);b.x=this.td.read(f+3);b.y=this.td.read(f+4);b.z=this.td.read(f+5);b=d.Qn(b);this.td.write(f+3,b.x);this.td.write(f+4,b.y);this.td.write(f+5,b.z);break;case 4:throw a.g.wa();}}h=d.Qn(h);e.write(2*p,h.x);e.write(2*p+1,h.y);m.write(p,h.z)}this.ce(1993)}};e.prototype.xv=function(){null==this.jb&&(this.jb=a.Ac.Dg(1,0),this.qb=a.Ac.to(1,0));null!=this.Fe&&
(this.Fe.resize(this.rg,1),this.li.resize(this.rg,-1))};e.prototype.eo=function(d){d.ng=!1;d.cp=this.cp;d.gp=this.gp;null!=this.jb?d.jb=a.ga.lj(this.jb):d.jb=null;null!=this.qb?d.qb=a.Wk.lj(this.qb):d.qb=null;null!=this.li?d.li=a.ga.lj(this.li):d.li=null;null!=this.Fe?d.Fe=a.Wk.lj(this.Fe):d.Fe=null;null!=this.td?d.td=a.qd.lj(this.td):d.td=null;d.bp=this.bp;d.ap=this.ap;this.gj(1024)?d.Uh=null:d.Uh=this.Uh};e.prototype.$b=function(){if(!this.gj(512))return this.bp;for(var d=this.Ca(),e=new a.av(0);d.kb();)for(;d.La();)e.add(d.ia().$b());
this.bp=e.rl();this.yf(512,!1);return e.rl()};e.prototype.lc=function(d){if(d==this)return!0;if(!(d instanceof e&&h.prototype.lc.call(this,d)))return!1;var g=this.ea();return g!=d.ea()||null!=this.jb&&!this.jb.lc(d.jb,0,g+1)||this.gp!=d.gp||null!=this.qb&&!this.qb.lc(d.qb,0,g)?!1:h.prototype.lc.call(this,d)};e.prototype.Ca=function(){return new a.GI(this)};e.prototype.wv=function(d){h.prototype.wv.call(this,d);if(this.Hm())for(d=this.Ca();d.kb();)for(;d.La();)break};e.prototype.tm=function(d,e){h.prototype.tm.call(this,
d,e);if(this.Hm())for(d=this.Ca();d.kb();)for(;d.La();)break};e.prototype.qv=function(){null==this.jb||0==this.jb.size?this.ta=0:this.ta=this.jb.read(this.jb.size-1)};e.prototype.Mh=function(){if(!this.Yf)return 0;this.ts();return this.ap};e.prototype.qt=function(d){if(!this.Yf)return!1;if(!this.gj(8))return 0!=(this.qb.read(d)&4);this.ts();return 0<this.Uh.read(d)};e.prototype.oo=function(d){if(!this.Yf)return 0;this.ts();return this.Uh.read(d)};e.prototype.ts=function(){if(this.gj(1024)){var d=
this.ea();null==this.Uh?this.Uh=new a.qd(d):this.Uh.size!=d&&this.Uh.resize(d);for(var d=new a.av(0),e=new a.av(0),m=new a.b,h=0,b=this.Ca();b.kb();){e.reset();for(this.w(this.Ea(b.Qa),m);b.La();)e.add(b.ia().kv(m.x,m.y));d.add(e.rl());var c=h++;this.Uh.write(c,e.rl())}this.ap=d.rl();this.yf(1024,!1)}};e.prototype.hl=function(){if(this.gj(8)){this.ts();var d=this.ea();if(null==this.qb||this.qb.size<d)this.qb=a.Ac.to(d+1);for(var e=1,m=0;m<d;m++){var h=this.Uh.read(m);0==m&&(e=0<h?1:-1);0<h*e?this.qb.xy(m,
4):this.qb.BB(m,4)}this.yf(8,!1)}};e.prototype.Ew=function(d){var e=this.Qa,m=this.ea();if(0<=e&&e<m){if(d<this.Dc(e)){if(d>=this.Ea(e))return e;e--}else e++;if(0<=e&&e<m&&d>=this.Ea(e)&&d<this.Dc(e))return this.Qa=e}if(5>m){for(e=0;e<m;e++)if(d<this.Dc(e))return this.Qa=e;throw a.g.ra("corrupted geometry");}e=0;for(--m;m>e;){var h=e+(m-e>>1),b=this.Ea(h);if(d<b)m=h-1;else if(e=this.Dc(h),d>=e)e=h+1;else return this.Qa=h}return this.Qa=e};e.prototype.HN=function(d){var e=this.mc(0);this.WN();var m=
this.Dc(d),h=this.Ea(d);d=-1;var b=new a.b,c=new a.b;b.y=-Infinity;b.x=-Infinity;for(h+=0;h<m;h++)e.ec(2*h,c),-1==b.compare(c)&&(d=h,b.J(c));return d};e.prototype.Iw=function(){var d=this.F();if(!this.Yf)for(var d=d-this.ea(),e=0,a=this.ea();e<a;e++)this.vc(e)&&d++;return d};e.prototype.ct=function(d){var e=this.Ha(d);this.vc(d)||e--;return e};e.prototype.Pa=function(){return new e(this.Yf,this.description)};e.prototype.fb=function(){return this.Yf?2:1};e.prototype.D=function(){return this.Yf?1736:
1607};e.prototype.WN=function(){this.Su()};e.prototype.OF=function(d){this.jb=d;this.ce(16777215)};e.prototype.VN=function(){this.Su();return this.qb};e.prototype.NF=function(d){this.qb=d;this.ce(16777215)};e.prototype.ea=function(){return null!=this.jb?this.jb.size-1:0};e.prototype.Dc=function(d){return this.jb.read(d+1)};e.prototype.Ha=function(d){return this.jb.read(d+1)-this.jb.read(d)};e.prototype.Ea=function(d){return this.jb.read(d)};e.prototype.jv=function(d,e){null==this.pb&&(this.pb=new a.Wj);
e=a.dA.jR(e);var g=this.pb.hi;if(null!=g)if(g.Sx<d||e>g.cO())this.pb.uv(null);else return!0;g=a.dA.create(this,d,e);this.pb.uv(g);return!0};e.prototype.hc=function(){var d=h.prototype.hc.call(this);if(!this.sc()){var e=this.ea();null!=this.jb&&this.jb.jj(d,0,e+1);null!=this.qb&&this.qb.jj(d,0,e)}return d};e.prototype.NC=function(d){return null!=this.Fe?this.Fe.read(d):1};e.prototype.cc=function(d,e,m){var g=this.Ew(d);if(d==this.Dc(g)-1&&!this.vc(g))throw a.g.ra("index out of bounds");this.kc();var h=
this.Fe,b=1;null!=h&&(b=h.read(d)&7);switch(b){case 1:e.mq();break;case 2:throw a.g.wa();case 4:throw a.g.wa();default:throw a.g.wa();}e=e.get();m?e.Qf(a.Od.Tf()):e.Qf(this.description);g=d==this.Dc(g)-1&&this.vc(g)?this.Ea(g):d+1;h=new a.b;this.w(d,h);e.ed(h);this.w(g,h);e.vd(h);if(!m)for(m=1,h=this.description.Aa;m<h;m++)for(var b=this.description.Fd(m),c=a.pa.Wa(b),p=0;p<c;p++){var f=this.ld(b,d,p);e.My(b,p,f);f=this.ld(b,g,p);e.Cy(b,p,f)}};e.prototype.Ti=function(d,e){if(d>=this.ea())throw a.g.N();
if(this.s())e.Ja();else{if(this.yq(d))throw a.g.ra("not implemented");var g=this.mc(0),h=new a.b,b=new a.i;b.Ja();var c=this.Ea(d);for(d=this.Dc(d);c<d;c++)g.ec(2*c,h),b.Db(h);e.K(b)}};e.prototype.hR=function(d,e){if(d>=this.ea())throw a.g.N();if(this.s())e.Ja();else{if(this.yq(d))throw a.g.ra("not implemented");var g=this.mc(0),h=new a.b,b=new a.i;b.Ja();var c=this.Ea(d);for(d=this.Dc(d);c<d;c++)g.ec(2*c,h),b.Db(h);e.K(b)}};e.prototype.dj=function(d){null==this.pb&&(this.pb=new a.Wj);if(0==d||16>
this.F())return!1;d=a.Ia.nB(this);this.pb.GA(d);return!0};e.prototype.jJ=function(){null==this.pb&&(this.pb=new a.Wj);if(null!=this.pb.nn)return!0;this.pb.HA(null);var d=a.Ia.CK(this);this.pb.HA(d);return!0};e.prototype.Pp=function(d){this.gp=d};e.prototype.Cm=function(){return this.gp};e.Id=[0,0,6,0,8,0];return e}(a.Wr);a.al=h})(A||(A={}));(function(a){var h=function(h){function e(d){h.call(this);if(void 0!==d){if(null==d)throw a.g.N();this.description=d}else this.description=a.Od.Tf();this.ta=0}
z(e,h);e.prototype.Pa=function(){return new e(this.description)};e.prototype.add=function(d){this.resize(this.ta+1);this.bh(this.ta-1,d)};e.prototype.zs=function(d,e){this.resize(this.ta+1);var g=new a.b;g.ma(d,e);this.ic(this.ta-1,g)};e.prototype.Pd=function(d,e,m){m=0>m?d.F():m;if(0>e||e>d.F()||m<e)throw a.g.N();if(e!=m){this.Ik(d.description);m-=e;var g=this.ta;this.resize(this.ta+m);this.kc();for(var h=0,b=d.description.Aa;h<b;h++){var c=d.description.Fd(h),p=a.pa.Wa(c),f=this.mc(c),c=d.mc(c);
f.nk(g*p,c,e*p,m*p,!0,1,g*p)}}};e.prototype.eF=function(d){if(0>d||d>=this.F())throw a.g.ra("index out of bounds");this.kc();for(var e=0,m=this.description.Aa;e<m;e++)if(null!=this.Ba[e]){var h=a.pa.Wa(this.description.Fd(e));this.Ba[e].oj(h*d,h,h*this.ta)}this.ta--;this.rg--;this.ce(1993)};e.prototype.resize=function(d){this.jo(d)};e.prototype.eo=function(){};e.prototype.Ja=function(){h.prototype.EA.call(this)};e.prototype.Oe=function(d){if(d instanceof a.Bg){if(!this.s()){this.kc();for(var e=this.Ba[0],
m=new a.b,h=0;h<this.ta;h++)m.x=e.read(2*h),m.y=e.read(2*h+1),d.Zi(m,m),e.write(2*h,m.x),e.write(2*h+1,m.y);this.ce(1993)}}else if(!this.s()){this.kc();this.Ne(1);this.kc();for(var e=this.Ba[0],m=this.Ba[1],b=new a.ee,h=0;h<this.ta;h++){b.x=e.read(2*h);b.y=e.read(2*h+1);b.z=m.read(h);var c=d.Qn(b);e.write(2*h,c.x);e.write(2*h+1,c.y);m.write(h,c.z)}this.ce(1993)}};e.prototype.fb=function(){return 0};e.prototype.D=function(){return 550};e.prototype.Mh=function(){return 0};e.prototype.$b=function(){return 0};
e.prototype.lc=function(d){return d==this?!0:d instanceof e?h.prototype.lc.call(this,d):!1};e.prototype.fR=function(d,e){var g=this.ta,g=Math.min(g,e+1E3);if(0>e||e>=this.ta||g<e||1E3!=d.length)throw a.g.N();var h=this.mc(0),b=g-e,c=[];h.Hp(2*e,2*b,c,0,!0);for(h=0;h<b;h++)d[h]=a.b.Oa(c[2*h],c[2*h+1]);return g};e.prototype.qv=function(){};e.prototype.xv=function(){};e.prototype.jv=function(){return!1};e.prototype.dj=function(){return!1};e.prototype.Rf=function(){return null};return e}(a.Wr);a.pe=h})(A||
(A={}));(function(a){(function(a){a[a.NotDetermined=0]="NotDetermined";a[a.Structure=1]="Structure";a[a.DegenerateSegments=2]="DegenerateSegments";a[a.Clustering=3]="Clustering";a[a.Cracking=4]="Cracking";a[a.CrossOver=5]="CrossOver";a[a.RingOrientation=6]="RingOrientation";a[a.RingOrder=7]="RingOrder";a[a.OGCPolylineSelfTangency=8]="OGCPolylineSelfTangency";a[a.OGCPolygonSelfTangency=9]="OGCPolygonSelfTangency";a[a.OGCDisconnectedInterior=10]="OGCDisconnectedInterior"})(a.NH||(a.NH={}));var h=function(){function a(e,
d,g){void 0===e?(this.yh=0,this.Gk=this.Fk=-1):(this.yh=e,this.Fk=d,this.Gk=g)}a.prototype.aq=function(e){this.yh=e.yh;this.Fk=e.Fk;this.Gk=e.Gk};return a}();a.wd=h})(A||(A={}));(function(a){var h=function(){function h(){}h.WT=function(e){if(!1===e)throw a.g.PG();};h.bG=function(e){return isNaN(e)?NaN:0===e?e:0<e?1:-1};h.Lh=function(e,d){void 0===d&&(d=0);for(var g=[],a=0;a<e;a++)g[a]=d;return g};h.Ps=function(e,d){var g,a;void 0===g&&(g=0);for(void 0===a&&(a=e.length-1);g<=a;g++)e[g]=d};h.Kr=function(e,
d,g){return e<d?d:e>g?g:e};h.mU=function(){return 4};h.kg=function(e,d){var g=5381;void 0!==d?g=(d<<5)+d+(e&255):g=(g<<5)+g+(e&255);g=(g<<5)+g+(e>>8&255);g=(g<<5)+g+(e>>16&255);return(g<<5)+g+(e>>24&255)&2147483647};h.Rh=function(){throw Error("Not Implemented");};h.iU=function(){return-Infinity};h.kU=function(){return Infinity};h.bU=function(){return 2147483647};h.QT=function(){return 2.220446049250313E-16};h.ST=function(){return 1.7976931348623157E308};h.$x=function(e){return h.JH(e)+12345&2147483647};
h.FD=function(e){var d=32,g=e%h.gv|0,a=e/h.gv|0;if(0===(d&=63))return e;32>d?(e=g>>>d|a<<32-d,d=a>>d):(e=a>>d-32,d=0<=a?0:-1);return d*h.gv+(e>>>0)};h.JH=function(e){e|=0;return(1103495168*e|0)+(20077*e|0)|0};h.truncate=function(e){return 0>e?-1*Math.floor(Math.abs(e)):Math.floor(e)};h.aH=Math.pow(2,53)-1;h.UT=-h.aH;h.pF=65536;h.zU=16777216;h.gv=h.pF*h.pF;return h}();a.I=h})(A||(A={}));(function(a){(function(a){a[a.Project=0]="Project";a[a.Union=1]="Union";a[a.Difference=2]="Difference";a[a.Proximity2D=
3]="Proximity2D";a[a.Relate=4]="Relate";a[a.Equals=5]="Equals";a[a.Disjoint=6]="Disjoint";a[a.Intersects=7]="Intersects";a[a.Within=8]="Within";a[a.Contains=9]="Contains";a[a.Crosses=10]="Crosses";a[a.Touches=11]="Touches";a[a.Overlaps=12]="Overlaps";a[a.Buffer=13]="Buffer";a[a.Distance=14]="Distance";a[a.Intersection=15]="Intersection";a[a.Clip=16]="Clip";a[a.Cut=17]="Cut";a[a.DensifyByLength=18]="DensifyByLength";a[a.DensifyByAngle=19]="DensifyByAngle";a[a.LabelPoint=20]="LabelPoint";a[a.GeodesicBuffer=
21]="GeodesicBuffer";a[a.GeodeticDensifyByLength=22]="GeodeticDensifyByLength";a[a.ShapePreservingDensify=23]="ShapePreservingDensify";a[a.GeodeticLength=24]="GeodeticLength";a[a.GeodeticArea=25]="GeodeticArea";a[a.Simplify=26]="Simplify";a[a.SimplifyOGC=27]="SimplifyOGC";a[a.Offset=28]="Offset";a[a.Generalize=29]="Generalize";a[a.SymmetricDifference=30]="SymmetricDifference";a[a.ConvexHull=31]="ConvexHull";a[a.Boundary=32]="Boundary";a[a.SimpleRelation=33]="SimpleRelation"})(a.iI||(a.iI={}));var h=
function(){function h(){}h.prototype.D=function(){return null};h.NT=function(e){a.T.Th(e.D())&&(e=e.pb,null!=e&&(e.uv(null),e.GA(null)))};return h}();a.Me=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 13};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h,b){return d instanceof a.T?(b=new a.Pc(d),this.$(b,e,[m],!1,h).next()):!0===h?(m=new a.Pz(d,e,m,!1,b),a.wi.local().$(m,e,b)):new a.Pz(d,
e,m,!1,b)};e.V=null;return e}(a.Me);a.Oz=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m,h){this.ua=-1;this.ne=e;this.fx=d;this.Oq=g;this.BP=new a.i;this.BP.Ja();this.Vm=-1;this.Yb=h}h.prototype.next=function(){for(var e;null!=(e=this.ne.next());)return this.ua=this.ne.ya(),this.Vm+1<this.Oq.length&&this.Vm++,this.buffer(e,this.Oq[this.Vm]);return null};h.prototype.ya=function(){return this.ua};h.prototype.buffer=function(e,d){return a.UG.buffer(e,d,this.fx,NaN,96,this.Yb)};return h}();
a.Pz=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 16};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h){return d instanceof a.T?(d=new a.Pc(d),this.$(d,e,m,h).next()):new a.TH(d,e,m,h)};e.V=null;return e}(a.Me);a.SH=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g){this.ua=-1;if(null==e)throw a.g.N();this.R=d;this.wk=e;this.ka=a.Ia.zd(g,d,!1)}h.prototype.next=function(){var e;
return null!=(e=this.wk.next())?(this.ua=this.wk.ya(),a.Ed.clip(e,this.R,this.ka,0)):null};h.prototype.ya=function(){return this.ua};return h}();a.TH=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 31};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m){return d instanceof a.T?a.Rz.qB(d):new a.Rz(e,d,m)};e.V=null;return e}(a.Me);a.Qz=h})(A||(A={}));(function(a){var h=function(){function h(e,
d,g){this.cE=new a.Tr;this.ua=-1;if(null==d)throw a.g.N();this.zP=e;this.Ec=!1;this.wk=d;this.Yb=g}h.prototype.next=function(){if(this.zP){if(!this.Ec){var e=this.GK(this.wk);this.Ec=!0;return e}return null}if(!this.Ec){e=this.wk.next();if(null!=e)return this.ua=this.wk.ya(),h.qB(e);this.Ec=!0}return null};h.prototype.ya=function(){return this.ua};h.prototype.GK=function(e){for(var d;null!=(d=e.next());)this.cE.Eb(d);return this.cE.sN()};h.qB=function(e){if(h.Gh(e))return e;var d=e.D();if(a.al.Lc(d))return d=
new a.Xa(e.description),d.Bc(e,!0),d;if(550==d&&2==e.F()){var g=new a.Va,d=new a.Xa(e.description);e.Sd(0,g);d.df(g);e.Sd(1,g);d.lineTo(g);return d}return a.Tr.wL(e)};h.Gh=function(e){if(e.s())return!0;var d=e.D();return 33==d||197==d?!0:a.al.Lc(d)?!1:550==d?1==e.F()?!0:!1:1607==d?1==e.ea()&&2>=e.F()?!0:!1:1!=e.ea()?!1:2>=e.F()?!0:a.Tr.sD(e,0)};return h}();a.Rz=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 17};e.local=function(){null===
e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h,b){return new a.VH(d,e,m,h,b)};e.V=null;return e}(a.Me);a.UH=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m,h){this.Ef=null;if(null==d||null==g)throw a.g.ra("invalid argument");this.xP=e;this.rx=d;this.RD=g;e=a.Ia.$s(d,g);this.ka=a.Ia.zd(m,e,!0);this.QD=-1;this.oe=h}h.prototype.ya=function(){return 0};h.prototype.next=function(){this.gN();return++this.QD<this.Ef.length?this.Ef[this.QD]:null};h.prototype.gN=function(){if(null==
this.Ef)switch(this.Ef=[],this.rx.D()){case 1607:this.iN();break;case 1736:this.hN()}};h.prototype.iN=function(){var e=new a.Xa,d=new a.Xa,g=new a.Xa;this.Ef.push(e);this.Ef.push(d);var m=[];a.$G.YG(this.xP,this.rx,this.RD,this.ka,m,this.oe);for(var h=0;h<m.length;h++){var b=m[h];0==b.cu?e.add(b.U,!1):1==b.cu||2==b.cu?d.add(b.U,!1):3==b.cu?this.Ef.push(b.U):g.add(b.U,!1)}g.s()||e.s()&&d.s()&&!(3<=this.Ef.length)||this.Ef.push(g);e.s()&&d.s()&&3>this.Ef.length&&(this.Ef.length=0)};h.prototype.hN=function(){var e=
new a.ga(0),d=new a.fd,g=d.RB(),m=d.Eb(this.rx),h=d.Eb(this.RD),b=new a.Of;try{b.Np(d,this.ka,this.oe);b.xm(g,m,h,e);var c=d.hf(m),p=new a.Ka,f=new a.Ka;this.Ef.length=0;this.Ef.push(p);this.Ef.push(f);for(m=0;m<e.size;m++){var l,q=new a.fd,n=q.Eb(c),z=q.Eb(d.hf(e.get(m)));b.Mp(q,this.oe);var k=b.mt(n,z);l=q.hf(k);if(!l.s()){var t=d.yC(e.get(m),g);2==t?p.add(l,!1):1==t?f.add(l,!1):this.Ef.push(l);var v=new a.fd,n=v.Eb(c),z=v.Eb(d.hf(e.get(m)));b.Mp(v,this.oe);c=v.hf(b.ll(n,z))}}!c.s()&&0<e.size&&
this.Ef.push(c);p.s()&&f.s()&&(this.Ef.length=0)}finally{b.xg()}};return h}();a.VH=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 18};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m){if(d instanceof a.T)return d=new a.Pc(d),this.$(d,e,m).next();if(0>=e)throw a.g.N();return new a.XH(d,e,m)};e.V=null;return e}(a.Me);a.WH=h})(A||(A={}));(function(a){var h=function(){function h(e,d){this.ua=
-1;this.ne=e;this.$q=d}h.prototype.ya=function(){return this.ua};h.prototype.next=function(){var e;return null!=(e=this.ne.next())?(this.ua=this.ne.ya(),this.hM(e)):null};h.prototype.hM=function(e){if(e.s()||1>e.fb())return e;var d=e.D();if(1736==d||1607==d)return this.Xv(e);if(a.T.Lc(d))return this.jM(e);if(197==d)return this.iM(e);throw a.g.wa();};h.prototype.jM=function(e){if(e.$b()<=this.$q)return e;var d=new a.Xa(e.description);d.Bc(e,!0);return this.Xv(d)};h.prototype.iM=function(e){var d=new a.Ka(e.description);
d.Wc(e,!1);var g=new a.i;e.o(g);e=g.ba();return g.aa()<=this.$q&&e<=this.$q?d:this.Xv(d)};h.prototype.Xv=function(e){for(var d=e.Pa(),g=e.Ca();g.kb();)for(var m=!0;g.La();){var h=g.ia();if(322!=h.D())throw a.g.ra("not implemented");var b=g.lD(),c=h.$b();if(c>this.$q){var p=Math.ceil(c/this.$q),c=new a.Va(e.description);m&&(h.En(c),d.df(c));for(var f=m=1/p,l=0,p=p-1;l<p;l++)h.uu(f,c),d.lineTo(c),f+=m;b?d.ro():(h.Bn(c),d.lineTo(c))}else b?d.ro():d.Bc(h,m);m=!1}return d};return h}();a.XH=h})(A||(A={}));
(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.D=function(){return 2};e.prototype.$=function(d,e,m,h){return d instanceof a.T?(d=new a.Pc(d),e=new a.Pc(e),this.$(d,e,m,h).next()):new a.YH(d,e,m,h)};e.ll=function(d,g,m,h){if(d.s()||g.s())return d;var b=d.fb(),c=g.fb();if(b>c)return d;var u=d.D(),p=g.D(),f=new a.i,l=new a.i,q=new a.i;d.o(f);g.o(l);q.K(f);q.Db(l);var q=a.Ia.zd(m,q,!1),n=q*Math.sqrt(2)*1.00001,
z=new a.i;z.K(f);z.P(n,n);if(!z.jc(l))return d;if(1==b&&2==c)return e.UI(d,g,p,m,h);if(33==u)switch(a.al.Lc(p)?(m=new a.Xa(g.description),m.Bc(g,!0)):m=g,p){case 1736:return e.kP(d,m,q);case 1607:return e.nP(d,m,q);case 550:return e.dN(d,m,q);case 197:return e.FM(d,m,q);case 33:return e.rO(d,m,q);default:throw a.g.N();}else if(550==u)switch(p){case 1736:return e.ZI(d,g,q);case 197:return e.TI(d,g,q);case 33:return e.WI(d,g,q)}return a.Of.ll(d,g,m,h)};e.kP=function(d,e,m){return 0==a.gd.uD(e,d,m)?
d:d.Pa()};e.nP=function(d,e,m){var g=d.w();e=e.Ca();for(var h=m*Math.sqrt(2)*1.00001,b=h*h,c=new a.i;e.kb();)for(;e.La();){var p=e.ia();p.o(c);c.P(h,h);if(c.contains(g)){if(p.Eq(g,m))return d.Pa();var f=p.Mb();if(a.b.Zb(g,f)<=b)return d.Pa();f=p.oc();if(a.b.Zb(g,f)<=b)return d.Pa()}}return d};e.dN=function(d,e,m){var g=e.mc(0);e=e.F();var h=d.w(),b=new a.b;m=m*Math.sqrt(2)*1.00001;m*=m;for(var c=0;c<e;c++)if(g.ec(2*c,b),a.b.Zb(b,h)<=m)return d.Pa();return d};e.FM=function(d,e,m){var g=new a.i;e.o(g);
g.P(m,m);e=d.w();return g.contains(e)?d.Pa():d};e.rO=function(d,e,m){m=m*Math.sqrt(2)*1.00001;m*=m;var g=d.w();e=e.w();return a.b.Zb(g,e)<=m?d.Pa():d};e.ZI=function(d,e,m){var g=new a.i;e.o(g);g.P(m,m);for(var h=d.F(),b=!1,c=[],p=0;p<h;p++)c[p]=!1;for(var f=new a.b,p=0;p<h;p++)d.w(p,f),g.contains(f)&&0!=a.gd.he(e,f,m)&&(b=!0,c[p]=!0);if(!b)return d;e=d.Pa();for(p=0;p<h;p++)c[p]||e.Pd(d,p,p+1);return e};e.TI=function(d,e,m){var g=new a.i;e.o(g);g.P(m,m);e=d.F();var h=!1;m=[];for(var b=0;b<e;b++)m[b]=
!1;for(var c=new a.b,b=0;b<e;b++)d.w(b,c),g.contains(c)&&(h=!0,m[b]=!0);if(!h)return d;g=d.Pa();for(b=0;b<e;b++)m[b]||g.Pd(d,b,b+1);return g};e.WI=function(d,e,m){var g=d.mc(0),h=d.F(),b=e.w(),c=new a.b,p=!1;e=[];for(var f=0;f<h;f++)e[f]=!1;f=m*Math.sqrt(2)*1.00001;m=f*f;for(f=0;f<h;f++)g.ec(2*f,c),a.b.Zb(c,b)<=m&&(p=!0,e[f]=!0);if(!p)return d;g=d.Pa();for(f=0;f<h;f++)e[f]||g.Pd(d,f,f+1);return g};e.UI=function(d,e,m,h,b){var g=new a.Vj;d.Fp(g);var c=new a.i;e.o(c);g.Db(c);g.P(.1*g.aa(),.1*g.ba());
c=new a.Ka;c.Wc(g,!1);1736==m?c.add(e,!0):c.Wc(e,!0);return a.$r.local().$(d,c,h,b)};e.V=null;return e}(a.Me);a.Zr=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,a){this.Fq=null==d;this.ua=-1;this.ne=e;this.fx=g;this.EP=d.next();this.Yb=a}h.prototype.next=function(){if(this.Fq)return null;var e;return null!=(e=this.ne.next())?(this.ua=this.ne.ya(),a.Zr.ll(e,this.EP,this.fx,this.Yb)):null};h.prototype.ya=function(){return this.ua};return h}();a.YH=h})(A||(A={}));(function(a){var h=function(){function e(d){this.oe=
d;this.Ii=new a.i;this.Ii.Ja();this.Ng=new a.i;this.Ng.Ja()}e.prototype.Pr=function(){var d;d=this.Ii.v;this.Ii.v=this.Ng.v;this.Ng.v=d;d=this.Ii.B;this.Ii.B=this.Ng.B;this.Ng.B=d;d=this.Ii.C;this.Ii.C=this.Ng.C;this.Ng.C=d;d=this.Ii.G;this.Ii.G=this.Ng.G;this.Ng.G=d};e.prototype.wM=function(d,e){var g=!this.Ii.jc(this.Ng);if(a.T.Kc(d.D())&&a.T.Kc(e.D())){if(d.F()>e.F())return this.gB(d,e,g);this.Pr();g=this.gB(e,d,g);this.Pr();return g}if(550==d.D()&&a.T.Kc(e.D()))return g=this.hB(e,d,g),this.Pr(),
g;if(550==e.D()&&a.T.Kc(d.D()))return this.hB(d,e,g);if(550==d.D()&&550==e.D()){if(d.F()>e.F())return this.iB(d,e);this.Pr();g=this.iB(e,d);this.Pr();return g}return 0};e.prototype.gB=function(d,e,m){var g=d.Ca(),h=e.Ca(),b=new a.i,c=new a.i,p=1.7976931348623157E308;if(!m&&this.iT(d,e,g,h))return 0;for(;g.kb();)for(;g.La();)if(d=g.ia(),d.o(b),!(b.Ou(this.Ng)>p)){for(;h.kb();)for(;h.La();)if(e=h.ia(),e.o(c),b.Ou(c)<p&&(e=d.Fb(e,m),e*=e,e<p)){if(0==e)return 0;p=e}h.Lk()}return Math.sqrt(p)};e.prototype.hB=
function(d,e,m){var g=d.Ca(),h=new a.i,b=1.7976931348623157E308,c=new a.b,p,f=e.F();for(m=!m&&1736==d.D();g.kb();)for(;g.La();){var l=g.ia();l.o(h);if(!(1<f&&h.Ou(this.Ng)>b)){for(var q=0;q<f;q++){e.w(q,c);if(m&&0!=a.gd.he(d,c,0))return 0;p=l.Gd(c,!1);c.sub(l.Kb(p));p=c.Up();if(p<b){if(0==p)return 0;b=p}}m=!1}}return Math.sqrt(b)};e.prototype.iB=function(d,e){for(var g=1.7976931348623157E308,h=new a.b,b=new a.b,c,p=d.F(),f=e.F(),l=0;l<p;l++)if(d.w(l,h),!(1<f&&this.Ng.gG(h)>g))for(var q=0;q<f;q++)if(e.w(q,
b),c=a.b.Zb(h,b),c<g){if(0==c)return 0;g=c}return Math.sqrt(g)};e.prototype.iT=function(d,e,m,h){if(1736==d.D()){for(;h.kb();)if(h.La()){var g=h.ia();if(0!=a.gd.he(d,g.oc(),0))return!0}h.Lk()}if(1736==e.D()){for(;m.kb();)if(m.La()&&(d=m.ia(),0!=a.gd.he(e,d.oc(),0)))return!0;m.Lk()}return!1};e.prototype.il=function(d,e){if(d.s()||e.s())return NaN;d.o(this.Ii);e.o(this.Ng);return this.wM(d,e)};return e}(),b=function(e){function d(){e.apply(this,arguments)}z(d,e);d.prototype.$=function(d,e,b){if(null==
d||null==e)throw a.g.N();if(d.s()||e.s())return NaN;var g,m;g=d.D();m=e.D();if(33==g){if(33==m)return a.b.Fb(d.w(),e.w());if(197==m)return b=new a.i,e.o(b),b.Fb(d.w());g=new a.pe;g.add(d);d=g}else if(197==g){if(197==m)return m=new a.i,d.o(m),b=new a.i,e.o(b),b.Fb(m);g=new a.Ka;g.Wc(d,!1);d=g}33==m?(m=new a.pe,m.add(e),e=m):197==m&&(m=new a.Ka,m.Wc(e,!1),e=m);return(new h(b)).il(d,e)};d.local=function(){null===d.V&&(d.V=new d);return d.V};d.prototype.D=function(){return 14};d.V=null;return d}(a.Me);
a.ZH=b})(A||(A={}));(function(a){var h=function(){function h(e,d,g,a){this.aE=e;this.fE=d;this.oe=a;this.HD=g}h.prototype.next=function(){var e=this.aE.next();return null==e?null:this.yz(e)};h.prototype.ya=function(){return this.aE.ya()};h.prototype.yz=function(e){var d=e.D();if(a.T.Km(d))return e;if(197==d)return d=new a.Ka(e.description),d.Wc(e,!1),this.yz(d);if(e.s())return e;if(null==e)throw a.g.wa();for(var d=e.Pa(),g=new a.yb,m=0,h=e.ea();m<h;m++)this.mH(e,m,d,g);return d};h.prototype.mH=function(e,
d,g,m){if(!(2>e.Ha(d))){var h=e.Ea(d),b=e.Dc(d)-1,c=e.mc(0),p=e.vc(d),f=new a.ga(0);f.xb(e.Ha(d)+1);var l=new a.ga(0);l.xb(e.Ha(d)+1);f.add(p?h:b);f.add(h);for(h=new a.b;1<f.size;){var q=f.tc();f.af();var n=f.tc();e.w(q,h);m.ed(h);e.w(n,h);m.vd(h);n=this.jH(m,h,c,q,n,b);0<=n?(f.add(n),f.add(q)):l.add(q)}p||l.add(f.get(0));if(l.size==f.size)g.Zj(e,d,!0);else if(2<=l.size&&(!this.HD||2!=l.size||!(p||a.b.Fb(e.Fa(l.get(0)),e.Fa(l.get(1)))<=this.fE))){d=new a.Va;m=0;for(b=l.size;m<b;m++)e.Sd(l.get(m),
d),0==m?g.df(d):g.lineTo(d);p&&(this.HD||2!=l.size||g.lineTo(d),g.ro())}}};h.prototype.jH=function(e,d,g,a,h,b){var m=h-1;h<=a&&(m=b);b=h=-1;for(a+=1;a<=m;a++){g.ec(2*a,d);var c=d.x,u=d.y;e.Kb(e.Gd(d,!1),d);d.x-=c;d.y-=u;c=d.length();c>this.fE&&c>b&&(h=a,b=c)}return h};return h}();a.$H=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 29};e.prototype.$=function(d,e,m,h){return d instanceof a.T?(d=new a.Pc(d),this.$(d,e,m,h).next()):
new a.$H(d,e,m,h)};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.V=null;return e}(a.Me);a.Sz=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 21};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h,b,c,p,f){return d instanceof a.T?(f=new a.Pc(d),this.$(f,e,m,[h],b,c,!1,p).next()):!0===p?(m=new a.Uz(d,e,m,h,b,!1,!1,f),a.wi.local().$(m,e,f)):new a.Uz(d,e,m,h,b,!1,!1,f)};e.V=null;return e}(a.Me);
a.Tz=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m,h,b,c,p){if(b)throw a.g.qe();if(null==d)throw a.g.N();this.ua=-1;this.Xq=e;this.cg=d;this.ke=g;this.Oq=m;this.Rm=h;this.Vm=-1;this.Yb=p;this.CP=new a.i;this.CP.Ja()}h.prototype.next=function(){for(var e;null!=(e=this.Xq.next());)return this.ua=this.Xq.ya(),this.Vm+1<this.Oq.length&&this.Vm++,this.oN(e,this.Oq[this.Vm]);return null};h.prototype.ya=function(){return this.ua};h.prototype.oN=function(e,d){return a.pH.buffer(e,this.cg,
this.ke,d,this.Rm,this.Yb)};return h}();a.Uz=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 24};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m){if(null==e)throw a.g.N();if(d.s()||1>d.fb())return 0;if(4==m)throw a.g.qe();var g=a.Ya.Em(e),h=a.Ya.ft(g),b=a.Ya.Ts(g),h=h*(2-h),c=g.Se().Dj,p=d.D(),f;1736==p||197==p?f=d.Rf():a.T.Lc(p)?(f=new a.Xa(d.description),f.Bc(d,!0)):f=d;if(0==g.lc(e)){if(a.Ya.Qo(e)){f=
a.gh.qo(f,e);1607==p&&f==d&&(f=a.T.Yj(d));d=new a.Nd;a.Ya.Fm(e).wu(d);for(var p=0,l=f.F();p<l;p++){var q=f.Fa(p);q.x=a.gh.pu(q.x,d);f.ic(p,q)}}d=f.Pa();f=a.gh.ZQ(e,g,f,d)?d:a.Ya.Wl(f,e,g)}return this.yM(f,m,b,h,c)};e.prototype.yM=function(d,e,m,h,b){var g=new a.ca(0),c=0;for(d=d.Ca();d.kb();)for(;d.La();){var u=d.ia(),p=u.Mb(),u=u.oc();p.scale(b);u.scale(b);a.zb.Rd(m,h,p.x,p.y,u.x,u.y,g,null,null,e);c+=g.l}return c};e.V=null;return e}(a.Me);a.cI=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,
arguments)}z(e,h);e.prototype.D=function(){return 18};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h,b){return d instanceof a.T?(d=new a.Pc(d),this.$(d,e,m,h,b).next()):new a.bI(d,m,h,e,-1,-1,b)};e.V=null;return e}(a.Me);a.aI=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m,h,b){if(0<b)throw a.g.qe();if(4!=g&&0<h)throw a.g.qe();if(null==d)throw a.g.N();this.ua=-1;this.Xq=e;this.cg=d;this.ke=g;this.IP=m;this.HP=h}h.prototype.next=function(){for(var e;null!=
(e=this.Xq.next());)return this.ua=this.Xq.ya(),this.hw(e);return null};h.prototype.ya=function(){return this.ua};h.prototype.hw=function(e){return a.ui.oq(e,this.cg,this.ke,this.IP,this.HP,this.Yb)};return h}();a.bI=h})(A||(A={}));(function(a){(function(a){a[a.Unknown=0]="Unknown";a[a.Contains=1]="Contains";a[a.Within=2]="Within";a[a.Equals=3]="Equals";a[a.Disjoint=4]="Disjoint";a[a.Touches=8]="Touches";a[a.Crosses=16]="Crosses";a[a.Overlaps=32]="Overlaps";a[a.NoThisRelation=64]="NoThisRelation";
a[a.Intersects=1073741824]="Intersects";a[a.IntersectsOrDisjoint=1073741828]="IntersectsOrDisjoint"})(a.xH||(a.xH={}));var h=function(){function h(){}h.lU=function(e,d,g,m){if(d.s()||e.s())return 4;var b=e.D(),c=d.D(),p;a.T.Lc(b)&&(e=p=new a.Xa(e.description),p.Bc(e,!0));a.T.Lc(c)&&(d=p=new a.Xa(d.description),p.Bc(d,!0));switch(b){case 33:switch(c){case 33:return h.sO(e,d,g);case 197:return h.Id(h.BG(d,e,g));case 550:return h.Id(h.HG(d,e,g));case 1607:return h.Id(h.Az(d,e,g,m));case 1736:return h.Id(h.pz(d,
e,g))}throw a.g.wa();case 197:switch(c){case 33:return h.BG(e,d,g);case 197:return h.fK(e,d,g);case 550:return h.Id(h.DG(d,e,g,m));case 1607:return h.Id(h.vz(d,e));case 1736:return h.Id(h.lz(d,e))}throw a.g.wa();case 550:switch(c){case 33:return h.HG(e,d,g);case 197:return h.DG(e,d,g,m);case 550:return h.FG(e,d,g,m);case 1607:return h.Id(h.xz(d,e));case 1736:return h.Id(h.nz(d,e))}throw a.g.wa();case 1607:switch(c){case 33:return h.Az(e,d,g,m);case 197:return h.vz(e,d);case 550:return h.xz(e,d);case 1607:return h.iQ(e,
d);case 1736:return h.Id(h.rz(d,e))}throw a.g.wa();case 1736:switch(c){case 33:return h.pz(e,d,g);case 197:return h.lz(e,d);case 550:return h.nz(e,d);case 1607:return h.rz(e,d);case 1736:return h.oP(e,d)}throw a.g.wa();default:throw a.g.wa();}};h.sO=function(e,d,g){e=e.w();d=d.w();return h.jz(e,d,g)};h.jz=function(e,d,g){e.sub(d);return e.Up()<=g*g?3:4};h.BG=function(e,d,g){var m=new a.i;e.o(m);e=d.w();return h.ZL(m,e,g)};h.ZL=function(e,d,g){e.P(-g,-g);if(e.contains(d))return 1;e.P(g,g);return e.contains(d)?
8:4};h.uM=function(e,d,g){return d.contains(g)?1:e.contains(g)?8:4};h.fK=function(e,d,g){var m=new a.i;e.o(m);e=new a.i;d.o(e);return h.MK(m,e,g)};h.MK=function(e,d,g){var a=0;e.contains(d)&&(a|=1);d.contains(e)&&(a|=2);if(0!=a)return a;e.P(-g,-g);d.P(-g,-g);if(e.jc(d))return a=e,a.P(g,g),a=a.contains(d)?1:0,d.P(g,g),a|=d.contains(e)?2:0,0!=a?a:32;a=e;a.P(g,g);d.P(g,g);return a.jc(d)?8:4};h.HG=function(e,d,g){d=d.w();return h.JG(e,d,g)};h.JG=function(e,d,g){for(var a=0,b=e.F();a<b;a++){var c;c=e.Fa(a);
c=h.jz(c,d,g);if(4!=c)return 0!=(c&2)&&1!=b?1:c}return 4};h.DG=function(e,d,g,m){var b=new a.i;d.o(b);return h.eN(e,b,g,m)};h.eN=function(e,d,g,a){d.P(-g,-g);d.P(g,g);for(var m=g=0,b=e.F();m<b;m++){var c;c=e.Fa(m);c=h.Id(h.uM(d,d,c));if(4!=c&&(g|=c,4==a))return 1073741824}return 0==g?4:2==g?g:32};h.FG=function(e,d,g,a){for(var m=0,b=0,c=d.F();b<c;b++){var p;p=d.Fa(b);p=h.JG(e,p,g);if(4!=p&&(m++,4==a))return 1073741824}return 0<m?m==d.F()?3==a?(p=h.FG(d,e,g,1),1==p?3:0):1:32:0};h.Az=function(e,d,g,
a){d=d.w();return h.XP(e,d,g,a)};h.GM=function(e,d){var g=null;e=e.pb;null!=e&&(g=e.hi);if(null!=g){g=g.Kk(d.x,d.y);if(0==g)return 4;if(1==g)return 1}else return-1;return 0};h.XP=function(e,d,g,m){if(0==(m&1073741839))return 64;var b=h.GM(e,d);if(0<b)return b;g*=g;for(b=e.Ca();b.kb();){var c=b.Qa;if(!e.vc(c)){var p=e.Ha(c),c=e.Ea(c);if(0==p)continue;if(a.b.Zb(e.Fa(c),d)<=g||1<p&&a.b.Zb(e.Fa(c+p-1),d)<=g)return 8}if(8!=m)for(;b.La();)if(p=b.ia(),p=p.Kb(p.Gd(d,!1)),a.b.Zb(p,d)<=g)return 0!=(m&1073741828)?
1073741824:1}return 0!=(m&1073741828)?4:64};h.vz=function(e,d){var g=new a.i;d.o(g);return h.rP(e,g)};h.rP=function(e,d){e=h.ao(e,d);return 0<e?e:0};h.ao=function(e,d){e=e.pb;if(null!=e)e=e.hi;else return-1;if(null!=e){e=e.Dn(d);if(0==e)return 4;if(1==e)return 1}else return-1;return 0};h.xz=function(e,d){var g=new a.i;d.o(g);g=h.ao(e,g);return 0<g?g:0};h.fs=function(e,d){var g=new a.i;d.o(g);g=h.ao(e,g);return 0<g?g:-1==g&&(g=new a.i,e.o(g),g=h.ao(d,g),0<g)?h.Id(g):0};h.iQ=function(e,d){e=h.fs(e,
d);return 0<e?e:0};h.pz=function(e,d,g){d=d.w();return h.lP(e,d,g)};h.lP=function(e,d,g){e=a.gd.he(e,d,g);if(0==e)return 4;if(1==e)return 1;if(2==e)return 8;throw a.g.wa();};h.lz=function(e,d){var g=new a.i;d.o(g);return h.uO(e,g)};h.uO=function(e,d){e=h.ao(e,d);return 0<e?e:0};h.nz=function(e,d){e=h.fs(e,d);return 0<e?e:0};h.rz=function(e,d){e=h.fs(e,d);return 0<e?e:0};h.oP=function(e,d){e=h.fs(e,d);return 0<e?e:0};h.iR=function(e,d){var g=e.D(),m=d.D(),h;if(a.T.Th(g)&&(h=e.pb,null!=h&&(h=h.hi,null!=
h))){if(33==m){var b=d.w();h=h.Kk(b.x,b.y)}else b=new a.i,d.o(b),h=h.Dn(b);if(1==h)return 1;if(0==h)return 4}if(a.T.Th(m)&&(h=d.pb,null!=h&&(h=h.hi,null!=h))){33==g?(g=e.w(),h=h.Kk(g.x,g.y)):(g=new a.i,e.o(g),h=h.Dn(g));if(1==h)return 2;if(0==h)return 4}return 0};h.Id=function(e){0!=(e&1)&&(e=e&-2|2);0!=(e&2)&&(e=e&-3|1);return e};return h}();a.dI=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.D=
function(){return 15};e.prototype.$=function(d,e,m,h,b){return d instanceof a.T?(d=new a.Pc(d),e=new a.Pc(e),this.$(d,e,m,h,b).next()):void 0===b?new a.Vz(d,e,m,h,-1):new a.Vz(d,e,m,h,b)};e.V=null;return e}(a.Me);a.$r=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,m,h){this.Fq=null==d;this.ua=-1;this.ne=e;this.cg=g;this.Ce=d.next();this.Ji=this.Ce.D();this.Yb=m;this.Xh=h;if(-1!=this.Xh&&(0>=this.Xh||7<this.Xh))throw a.g.N("bad dimension mask");}h.prototype.next=function(){if(this.Fq)return null;
var e;if(null!=this.du){e=this.du.next();if(null!=e)return e;this.du=null}for(;null!=(e=this.ne.next());){this.ua=this.ne.ya();if(-1==this.Xh)return e=this.Ga(e);this.du=this.PO(e);return e=this.du.next()}return null};h.prototype.ya=function(){return this.ua};h.prototype.Ga=function(e){var d=this.uG(e);if(null!=d)return d;var d=a.Ia.$s(this.Ce,e),g=a.Ia.zd(this.cg,d,!0),d=new a.i;this.Ce.o(d);var m=new a.i;e.o(m);d.P(2*g,2*g);d.Ga(m);d.P(100*g,100*g);g=a.Ed.clip(this.Ce,d,0,0);e=a.Ed.clip(e,d,0,0);
return a.Of.mt(e,g,this.cg,this.Yb)};h.prototype.SE=function(e,d,g){var m=0;if(0!=(d&1))null==g[0]&&(g[0]=new a.pe(e)),m++;else for(var h=0;h<g.length-1;h++)g[h]=g[h+1];if(0!=(d&2))null==g[m]&&(g[m]=new a.Xa(e)),m++;else for(h=m;h<g.length-1;h++)g[h]=g[h+1];if(0!=(d&4))null==g[m]&&(g[m]=new a.Ka(e)),m++;else for(h=m;h<g.length-1;h++)g[h]=g[h+1];if(3!=m){e=[];for(h=0;h<m;h++)e[h]=g[h];return new a.Pc(e)}return new a.Pc(g)};h.prototype.PO=function(e){var d=this.uG(e);if(null!=d){var g=[null,null,null];
g[d.fb()]=d;return this.SE(e.description,this.Xh,g)}d=a.Ia.$s(this.Ce,e);g=a.Ia.zd(this.cg,d,!0);d=new a.i;this.Ce.o(d);d.P(2*g,2*g);var m=new a.i;e.o(m);d.Ga(m);d.P(100*g,100*g);g=a.Ed.clip(this.Ce,d,0,0);d=a.Ed.clip(e,d,0,0);g=a.Of.Uw(d,g,this.cg,this.Yb);return this.SE(e.description,this.Xh,g)};h.prototype.uG=function(e){var d=a.Ia.$s(e,this.Ce),g=a.Ia.zd(this.cg,d,!1),d=e.D(),m=e.s(),b=this.Ce.s(),b=m||b;if(!b){b=new a.i;e.o(b);var c=new a.i;this.Ce.o(c);c.P(2*g,2*g);b=!b.jc(c)}if(!b)if(c=a.dI.iR(this.Ce,
e),4==c)b=!0;else{if(0!=(c&2))return this.Ce;if(0!=(c&1))return e}if(b)return g=a.T.ve(d),b=a.T.ve(this.Ji),g<b?h.V(e,m):g>b?this.kF():0==g?550==d&&33==this.Ji?this.kF():h.V(e,m):h.V(e,m);if((-1==this.Xh||4==this.Xh)&&197==d&&197==this.Ji)return g=this.Ce,d=new a.i,e.o(d),m=new a.i,g.o(m),d.Ga(m),g=new a.Vj,e.copyTo(g),g.Cu(d),g;if(197==d&&0==a.T.ve(this.Ji)||197==this.Ji&&0==a.T.ve(d))return m=197==d?e:this.Ce,e=197==d?this.Ce:e,d=new a.i,m.o(d),a.Ed.clip(e,d,g,0);if(0==a.T.ve(d)&&0<a.T.ve(this.Ji)||
0<a.T.ve(d)&&0==a.T.ve(this.Ji)){g=a.Ia.Cg(this.cg,e,!1);if(550==d||33==d)return a.Of.jD(e,this.Ce,g);if(550==this.Ji||33==this.Ji)return a.Of.jD(this.Ce,e,g);throw a.g.wa();}return-1!=this.Xh&&2!=this.Xh||1607!=d||1736!=this.Ji?-1!=this.Xh&&2!=this.Xh||1736!=d||1607!=this.Ji?null:this.rG(this.Ce,e):this.rG(e,this.Ce)};h.prototype.rG=function(e,d){var g=e,m=d,h=a.Ia.Cg(this.cg,d,!1),b=new a.i;m.o(b);var c=new a.i;g.o(c);c.P(2*h,2*h);b.Ga(c);b.P(10*h,10*h);var g=e=a.Ed.clip(e,b,0,0),c=new a.ga(0),
p=-1,f=m.pb;if(null!=f){var l=f.hi;if(null!=l){p=0;c.xb(g.F()+g.ea());for(var q=new a.i,n=g.Ca();n.kb();)for(;n.La();){n.ia().o(q);var z=l.Dn(q);1==z?c.add(1):0==z?c.add(0):(c.add(-1),p++)}}}5<d.F()&&(m=d=a.Ed.clip(d,b,0,0),f=m.pb);0>p&&(p=g.Iw());b=g.F()+m.F();if(p*m.F()>Math.log(b)*b*4)return null;b=null;p=m.Ca();null!=f&&null!=f.Ab&&(b=f.Ab);null==b&&20<m.F()&&(b=a.Ia.nB(m));m=e.Pa();f=null;l=g.Ca();q=[0,0,0,0,0,0,0,0,0];n=new a.qd(0);z=new a.Ag;e=-1;for(var k=0,t=0,v=0<c.size,A=-1;l.kb();){var A=
l.Qa,w=0;e=-1;for(k=0;l.La();){var y=v?a.I.truncate(c.get(t)):-1;t++;var D=l.ia();if(0>y){if(null!=b)for(null==f?f=b.KN(D,h):f.Fn(D,h),y=f.next();-1!=y;y=f.next()){p.Sb(b.da(y));for(var y=p.ia(),B=D.Ga(y,null,q,null,h),y=0;y<B;y++)n.add(q[y])}else for(p.Lk();p.kb();)for(;p.La();)for(y=p.ia(),B=D.Ga(y,null,q,null,h),y=0;y<B;y++)n.add(q[y]);if(0<n.size){n.xd(0,n.size,function(d,e){return d-e});var F=0;n.add(1);for(var B=-1,y=0,J=n.size;y<J;y++){var G=n.get(y);if(G!=F){var I=!1;0!=F||1!=G?(D.Bi(F,G,
z),F=z.get()):(F=D,I=!0);if(2<=w){m.ys(g,A,e,k,3==w);if(1!=this.UA(d,F.Mb(),h)&&1!=this.VA(d,F,h))return null;m.Bc(F,!1);w=1;k=0}else switch(B=this.VA(d,F,h),B){case 1:I?2>w?(e=l.Jb()-g.Ea(A),k=1,w=0==w?3:2):k++:(m.Bc(F,0==w),w=1);break;case 0:w=0;e=-1;k=0;break;default:return null}F=G}}}else{y=this.UA(d,D.Mb(),h);if(0>y)return null;1==y?(2>w&&(e=l.Jb()-g.Ea(A),w=0==w?3:2),k++):(e=-1,k=0)}n.clear(!1)}else 0!=y&&1==y&&(0==w?(w=3,e=l.Jb()-g.Ea(A)):1==w?(w=2,e=l.Jb()-g.Ea(A)):k++)}2<=w&&(m.ys(g,A,e,
k,3==w),e=-1)}return m};h.prototype.UA=function(e,d,g){return a.ff.xl(e,d,g)};h.prototype.VA=function(e,d,g){var m=d.Mb();d=d.oc();var h=a.ff.xl(e,m,g),b=a.ff.xl(e,d,g);if(1==h&&0==b||0==h&&1==b)return-1;if(0==h||0==b)return 0;if(1==h||1==b)return 1;h=new a.b;h.add(m,d);h.scale(.5);e=a.ff.xl(e,h,g);return 0==e?0:1==e?1:-1};h.V=function(e,d){return d?e:e.Pa()};h.prototype.kF=function(){null==this.$D&&(this.$D=this.Ce.Pa());return this.$D};return h}();a.Vz=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,
arguments)}z(e,h);e.prototype.D=function(){return 28};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h,b,c,p){return d instanceof a.T?(d=new a.Pc(d),this.$(d,e,m,h,b,c,p).next()):new a.eI(d,e,m,h,b,c,p)};e.V=null;return e}(a.Me);a.Wz=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,a,h,b,c){this.ua=-1;this.ne=e;this.Pi=d;this.Da=g;this.bi=a;this.Dx=h;this.XD=b;this.oe=c}h.prototype.next=function(){var e=this.ne.next();return null!=e?(this.ua=this.ne.ya(),
this.RH(e)):null};h.prototype.ya=function(){return this.ua};h.prototype.RH=function(e){var d;d=0>=this.XD?a.Ia.Cg(this.Pi,e,!1):this.XD;return a.XG.$(e,this.Da,this.bi,this.Dx,d,this.oe)};return h}();a.eI=h})(A||(A={}));(function(a){var h=function(){function e(){}e.prototype.reset=function(){this.Pg=this.Fj=-1;this.Hq=this.Uo=!1};e.prototype.QM=function(d,e,a){for(d.Sb(e,a);d.La();){var g=d.ia(),g=g.$b();if(0!=g)return d.Jb()}for(d.Sb(e,a);d.Ow();)if(g=d.oi(),g=g.$b(),0!=g)return d.Jb();return-1};
e.prototype.RM=function(d,e){for(d.Sb(e,-1);d.Ow();)if(0!=d.oi().$b())return d.Jb();return-1};e.prototype.PM=function(d,e){d.Sb(e,-1);for(d.ia();d.La();)if(0!=d.ia().$b())return d.Jb();return-1};e.prototype.OM=function(d,e,m,h){this.Fj=this.QM(e,m,h);if(-1!=this.Fj){e.Sb(this.Fj,-1);var g=e.ia(),b=g.Kb(g.Gd(d,!1));m=a.b.Zb(b,d);h=new a.b;h.J(b);h.sub(g.Mb());b=new a.b;b.J(d);b.sub(g.Mb());this.Uo=0>h.Ai(b);this.Pg=this.PM(e,this.Fj);if(-1!=this.Pg){e.Sb(this.Pg,-1);var g=e.ia(),c=g.Gd(d,!1),c=g.Kb(c),
p=a.b.Zb(c,d);p>m?this.Pg=-1:(h.J(c),h.sub(g.Mb()),b.J(d),b.sub(g.Mb()),this.Hq=0>h.Ai(b))}-1==this.Pg&&(this.Pg=this.RM(e,this.Fj),-1!=this.Pg&&(e.Sb(this.Pg,-1),g=e.ia(),c=g.Gd(d,!1),c=g.Kb(c),p=a.b.Zb(c,d),p>m?this.Pg=-1:(h.J(c),h.sub(g.Mb()),b.J(d),b.sub(g.Mb()),this.Hq=0>h.Ai(b),d=this.Fj,this.Fj=this.Pg,this.Pg=d,d=this.Uo,this.Uo=this.Hq,this.Hq=d)))}};e.prototype.FK=function(d,e,a,h,b){a=a.Ca();this.OM(d,a,h,b);if(-1!=this.Fj&&-1==this.Pg)return this.Uo;if(-1!=this.Fj&&-1!=this.Pg){if(this.Uo==
this.Hq)return this.Uo;a.Sb(this.Fj,-1);d=a.ia().Pf(1);a.Sb(this.Pg,-1);e=a.ia().Pf(0);return 0<=d.Ai(e)?!0:!1}return e};return e}(),b=function(e){function d(){e.apply(this,arguments)}z(d,e);d.local=function(){null===d.V&&(d.V=new d);return d.V};d.prototype.D=function(){return 3};d.prototype.zw=function(d,e,h,b){void 0===b&&(b=!1);if(d.s())return new a.dl;e=e.w();var g=d,m=d.D();197==m&&(g=new a.Ka,g.Wc(d,!1),m=1736);switch(m){case 33:return this.OE(g,e);case 550:return this.BE(g,e);case 1607:case 1736:return this.dQ(g,
e,h,b);default:throw a.g.ra("not implemented");}};d.prototype.Aw=function(d,e){if(d.s())return new a.dl;e=e.w();var g=d,m=d.D();197==m&&(g=new a.Ka,g.Wc(d,!1),m=1736);switch(m){case 33:return this.OE(g,e);case 550:case 1607:case 1736:return this.BE(g,e);default:throw a.g.ra("not implemented");}};d.prototype.Bw=function(d,e,h,b){if(0>b)throw a.g.N();if(d.s())return[];e=e.w();var g=d,m=d.D();197==m&&(g=new a.Ka,g.Wc(d,!1),m=1736);switch(m){case 33:return this.IQ(g,e,h,b);case 550:case 1607:case 1736:return this.gQ(g,
e,h,b);default:throw a.g.ra("not implemented");}};d.prototype.dQ=function(d,e,b,c){if(1736==d.D()&&b&&(b=new a.i,d.o(b),b=a.Ia.zd(null,b,!1),0!=(c?a.gd.he(d,e,0):a.gd.he(d,e,b)))){var g=new a.dl(e,0,0);c&&g.UF(!0);return g}for(var m=d.Ca(),g=new a.b,p=b=-1,u=1.7976931348623157E308,f=0;m.kb();)for(;m.La();){var l=m.ia(),l=l.Kb(l.Gd(e,!1)),C=a.b.Zb(l,e);C<u?(f=1,g=l,b=m.Jb(),p=m.Qa,u=C):C==u&&f++}g=new a.dl(g,b,Math.sqrt(u));c&&(m.Sb(b,p),l=m.ia(),c=0>a.b.yn(e,l.Mb(),l.oc()),1<f&&(f=new h,f.reset(),
c=f.FK(e,c,d,b,p)),g.UF(c));return g};d.prototype.OE=function(d,e){d=d.w();e=a.b.Fb(d,e);return new a.dl(d,0,e)};d.prototype.BE=function(d,e){var g=d.mc(0);d=d.F();for(var m=0,h=0,b=0,c=1.7976931348623157E308,p=0;p<d;p++){var f=new a.b;g.ec(2*p,f);var l=a.b.Zb(f,e);l<c&&(h=f.x,b=f.y,m=p,c=l)}g=new a.dl;g.tv(h,b,m,Math.sqrt(c));return g};d.prototype.IQ=function(d,e,h,b){if(0==b)return h=[];h*=h;d=d.w();e=a.b.Zb(d,e);e<=h?(h=[],b=new a.dl,b.tv(d.x,d.y,0,Math.sqrt(e)),h[0]=b):h=[];return h};d.prototype.gQ=
function(d,e,h,b){if(0==b)return b=[];var g=d.mc(0),m=d.F();d=[];var c=0;h*=h;for(var p=0;p<m;p++){var u=g.read(2*p),f=g.read(2*p+1),l=e.x-u,C=e.y-f,l=l*l+C*C;l<=h&&(C=new a.dl,C.tv(u,f,p,Math.sqrt(l)),c++,d.push(C))}e=d.length;d.sort(function(d,e){return d.Da<e.Da?-1:d.Da==e.Da?0:1});if(b>=e)return d.slice(0);d.length=b;return d.slice(0)};d.V=null;return d}(a.Me);a.bv=b})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 4};e.prototype.$=
function(d,e,m,h,b){return a.el.py(d,e,m,h,b)};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.V=null;return e}(a.Me);a.fI=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 33};e.prototype.$=function(d,e,m,h,b){return 1073741824===d?!a.hd.qy(e,m,h,4,b):a.hd.qy(e,m,h,d,b)};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.V=null;return e}(a.Me);a.bl=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,
m){this.oe=m;this.yP=g;this.ua=-1;if(null==e)throw a.g.N();this.wk=e;this.Pi=d}h.prototype.next=function(){var e;return null!=(e=this.wk.next())?(this.ua=this.wk.ya(),this.Qy(e)):null};h.prototype.ya=function(){return this.ua};h.prototype.Qy=function(e){if(null==e)throw a.g.N();return a.cv.cG(e,this.Pi,this.yP,this.oe)};return h}();a.gI=h})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 26};e.prototype.$=function(d,e,m,h){return d instanceof
a.T?(d=new a.Pc(d),this.$(d,e,m,h).next()):new a.gI(d,e,m,h)};e.prototype.Ro=function(d,e,m,h,b){return 0<(void 0!==h?a.cv.Ro(d,e,m,h,b):a.cv.Ro(d,e,!1,null,m))};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.V=null;return e}(a.Me);a.as=h})(A||(A={}));(function(a){var h=function(){function d(){this.hp=0}d.prototype.hS=function(d){this.hp&=-2;this.hp|=d?1:0};d.prototype.sl=function(){return 0!=(this.hp&1)};d.prototype.LC=function(){return this.sl()?0:1};return d}();a.AT=h;var b=function(){return function(){}}(),
e=function(){return function(d,e,g,a){this.x=d;this.y=e;this.Sh=g;this.yl=a}}(),d=function(){function d(d){this.me=d}d.prototype.compare=function(d,e,g){d=d.da(g);e=this.me.$e.read(2*e);d=this.me.$e.read(2*d);e-=d;return 0>e?-1:0<e?1:0};return d}(),g=function(){function d(d){this.me=d}d.prototype.compare=function(d,e,g){e=this.me.$a[e];d=this.me.$a[d.da(g)];var a=e.sl(),m=d.sl();g=e.Zd.xe(this.me.wn,0);var h=d.Zd.xe(this.me.wn,0);g==h&&(g=Math.min(a?e.Zd.ja:e.Zd.ha,m?d.Zd.ja:d.Zd.ha),a=.5*(g-this.me.wn)+
this.me.wn,a==this.me.wn&&(a=g),g=e.Zd.xe(a,0),h=d.Zd.xe(a,0));return g<h?-1:g>h?1:0};return d}(),m=function(){function d(d,e){this.VE=new a.b;this.parent=d;this.mO=e}d.prototype.Zp=function(d,e,g){var a=this.parent,m=this.mO;g.xd(d,e,function(d,e){return a.kj(d,e,m)})};d.prototype.Mo=function(d){d=this.parent.xh.get(d);this.parent.$e.ec(2*(d>>1),this.VE);return this.VE.y+(0!=(d&1)?this.parent.Ri:-this.parent.Ri)};return d}(),c=function(){function c(d,e,g,m,h){this.SD=d.description;this.U=d;this.sg=
e;this.Ri=a.Ia.Cg(this.sg,d,!1);this.pn=a.Ia.Cg(this.sg,d,!0);this.yx=g;this.wP=this.SD.Aa;this.$a=[];this.dn=[];this.Lg=new a.$n;this.Za=new a.bj;this.Kd=new a.wd;this.GD=this.pk=h}c.prototype.Yw=function(){this.GD=!0;return(!a.T.Kc(this.U.D())||this.yB()&&this.xB(!1))&&this.OK()?a.T.Kc(this.U.D())?this.RK()?1607==this.U.D()?this.TK()?2:0:this.UK()?this.VK():0:0:2:0};c.prototype.Yy=function(d,e){var g=this.$e.read(2*d);d=this.$e.read(2*d+1);var m=this.$e.read(2*e);e=this.$e.read(2*e+1);var h=!a.Sr.Vw(g,
d,m,e,this.Ri*this.Ri);return h?h:0==this.U.fb()?!1:g==m&&d==e};c.prototype.yB=function(){for(var d=this.U,e=d.Yf?3:2,g=0,m=d.ea();g<m;g++)if(d.Ha(g)<e)return this.Kd=new a.wd(1,g,0),!1;return!0};c.prototype.xB=function(d){for(var e=this.U,g=e.Ca(),m=e.hasAttribute(1),e=m?a.Ia.rB(this.sg,e,!1):0;g.kb();)for(;g.La();){var h=g.ia();if(!(h.$b()>this.Ri)){if(d&&m){var b=h.gt(1,0),h=h.gt(1,0);if(Math.abs(h-b)>e)continue}this.Kd=new a.wd(2,g.Jb(),-1);return!1}}return!0};c.prototype.OK=function(){var e=
this.U,g=null;a.T.Kc(this.U.D())&&(g=this.U);var h=(this.GD||this.pk)&&null!=g,b=e.F();this.$e=e.mc(0);this.xh=new a.ga(0);this.xh.xb(2*b);this.wh=new a.ga(0);this.wh.xb(2*b);h&&(null==this.Bk&&(this.Bk=new a.ga(0)),this.Bk.xb(b));for(var c=e=0;c<b;c++)if(this.xh.add(2*c),this.xh.add(2*c+1),this.wh.add(2*c),this.wh.add(2*c+1),h){for(;c>=g.Dc(e);)e++;this.Bk.add(e)}(new a.Rr).sort(this.wh,0,2*b,new m(this,h));this.Za.clear();this.Za.Hn(new d(this));this.Za.de(b);g=0;for(b*=2;g<b;g++)if(h=this.wh.get(g),
e=this.xh.get(h),h=e>>1,0==(e&1)){e=this.Za.addElement(h,-1);c=this.Za.ge(e);if(-1!=c&&!this.Yy(this.Za.da(c),h))return this.Kd=new a.wd(3,h,this.Za.da(c)),!1;var p=this.Za.bb(e);if(-1!=p&&!this.Yy(this.Za.da(p),h))return this.Kd=new a.wd(3,h,this.Za.da(p)),!1}else if(e=this.Za.search(h,-1),c=this.Za.ge(e),p=this.Za.bb(e),this.Za.kd(e,-1),-1!=c&&-1!=p&&!this.Yy(this.Za.da(c),this.Za.da(p)))return this.Kd=new a.wd(3,this.Za.da(c),this.Za.da(p)),!1;return!0};c.prototype.RK=function(){return 10>this.U.F()?
this.PK():this.QK()};c.prototype.QK=function(){var d=new a.fd;d.Eb(this.U);var e=new a.wd;return a.Zu.DE(!1,d,this.Ri,e,this.oe)?(e.Fk=d.gb(e.Fk),e.Gk=d.gb(e.Gk),this.Kd.aq(e),!1):!0};c.prototype.PK=function(){for(var d=this.U,e=d.Ca(),d=d.Ca();e.kb();)for(;e.La();){var g=e.ia();if(!e.Jm()||!e.YO()){d.xR(e);do for(;d.La();){var m=d.ia(),m=g.fq(m,this.Ri,!0);if(0!=m)return this.Kd=new a.wd(2==m?5:4,e.Jb(),d.Jb()),!1}while(d.kb())}}return!0};c.prototype.UK=function(){var d=this.U;this.$a.length=0;this.dn.length=
0;this.Hf=d.Ca();this.Hf.NR();var e=new a.ga(0);e.xb(10);for(var g=NaN,m=0,h=0,d=2*d.F();h<d;h++){var b=this.wh.get(h),b=this.xh.get(b);if(0==(b&1)){var b=b>>1,c=this.$e.read(2*b),p=this.$e.read(2*b+1);if(0!=e.size&&(c!=g||p!=m)){if(!this.TE(e))return!1;null!=e&&e.clear(!1)}e.add(b);g=c;m=p}}return this.TE(e)?!0:!1};c.prototype.TK=function(){for(var d=this.U,e=Array(d.ea()),g=0,m=d.ea();g<m;g++)e[g]=d.Oo(g);var m=new b,h,c,p,u=new a.b,g=this.wh.get(0),g=this.xh.get(g),f=g>>1;this.$e.ec(2*f,u);g=this.Bk.get(f);
h=e[g];c=d.Ea(g);p=d.Dc(g)-1;m.ak=f==c||f==p;m.Ev=this.pk?!h&&m.ak:m.ak;m.Sh=g;m.x=u.x;m.y=u.y;m.yl=f;for(var l=new b,C=1,q=this.wh.size;C<q;C++)if(g=this.wh.get(C),g=this.xh.get(g),0==(g&1)){f=g>>1;this.$e.ec(2*f,u);g=this.Bk.get(f);g!=m.Sh&&(h=e[g],c=d.Ea(g),p=d.Dc(g)-1);var n,z=f==c||f==p;n=this.pk?!h&&m.ak:m.ak;l.x=u.x;l.y=u.y;l.Sh=g;l.yl=f;l.Ev=n;l.ak=z;if(l.x==m.x&&l.y==m.y)if(this.pk){if(!l.Ev||!m.Ev)if(l.Sh!=m.Sh||!l.ak&&!m.ak)return this.Kd=new a.wd(8,l.yl,m.yl),!1}else if(!l.ak||!m.ak)return this.Kd=
new a.wd(5,l.yl,m.yl),!1;g=m;m=l;l=g}return!0};c.prototype.AB=function(){for(var d=this.U,g=[],m=-1,h=!1,b=0,c=d.ea();b<c;b++)d.qt(b)&&(h=!1,m++,b<c-1&&(d.qt(b+1)||(h=!0))),g[b]=h?m:-1;var h=new a.b,b=this.wh.get(0),b=this.xh.get(b),p=b>>1;this.$e.ec(2*p,h);for(var b=this.Bk.get(p),m=new e(h.x,h.y,b,p,g[b]),d=[],u=1,c=this.wh.size;u<c;u++)if(b=this.wh.get(u),b=this.xh.get(b),0==(b&1)){p=b>>1;this.$e.ec(2*p,h);b=this.Bk.get(p);b=new e(h.x,h.y,b,p,g[b]);if(b.x==m.x&&b.y==m.y){if(b.Sh==m.Sh)return this.Kd=
new a.wd(9,b.yl,m.yl),!1;0<=g[b.Sh]&&g[b.Sh]==g[m.Sh]&&(0!=d.length&&d[d.length-1]==m||d.push(m),d.push(b))}m=b}if(0==d.length)return!0;b=new a.$n(!0);a.I.Ps(g,-1);h=-1;u=new a.b;u.Eh();m=0;for(c=d.length;m<c;m++){p=d[m];if(p.x!=u.x||p.y!=u.y)h=b.jh(0),u.x=p.x,u.y=p.y;var f=g[p.Sh];-1==f&&(f=b.jh(2),g[p.Sh]=f);b.addElement(f,h);b.addElement(h,f)}c=new a.ga(0);c.xb(10);for(m=b.Wd;-1!=m;m=b.Cw(m))if(d=b.DC(m),0==(d&1)&&0!=(d&2)){d=-1;c.add(m);for(c.add(-1);0<c.size;){h=c.tc();c.af();u=c.tc();c.af();
p=b.DC(u);if(0!=(p&1)){d=0==(p&2)?h:u;break}b.$R(u,p|1);for(p=b.gc(u);-1!=p;p=b.bb(p))f=b.getData(p),f!=h&&(c.add(f),c.add(u))}if(-1!=d){b=-1;m=0;for(c=g.length;m<c;m++)if(g[m]==d){b=m;break}this.Kd=new a.wd(10,b,-1);return!1}}return!0};c.prototype.VK=function(){var d=this.U;if(0>=d.Mh())return this.Kd=new a.wd(6,1==d.ea()?1:-1,-1),0;if(1==d.ea())return this.pk&&!this.AB()?0:2;this.gn=a.ga.Yc(d.ea(),0);this.Hx=a.ga.Yc(d.ea(),-1);for(var e=-1,m=0,h=0,b=d.ea();h<b;h++){var c=d.oo(h);this.gn.write(h,
0>c?0:256);if(0<c)e=h,m=c;else{if(0==c)return this.Kd=new a.wd(6,h,-1),0;if(0>e||m<Math.abs(c))if(this.Kd=new a.wd(7,h,-1),this.pk)return 0;this.Hx.write(h,e)}}this.kr=d.ea();this.Ll=new a.ga(0);this.Ll.xb(10);b=d.F();this.wn=NaN;d=new a.ga(0);d.xb(10);this.yp=a.ga.Yc(b,-1);this.hu=a.ga.Yc(b,-1);null!=this.Hi?this.Hi.clear(!1):this.Hi=new a.ga(0);this.Hi.xb(10);this.Za.clear();this.Za.Hn(new g(this));e=0;for(b*=2;0<this.kr&&e<b;e++)if(m=this.wh.get(e),m=this.xh.get(m),0==(m&1)){m>>=1;h=this.$e.read(2*
m+1);if(h!=this.wn&&0!=d.size){if(!this.yr(d))return 0;null!=d&&d.clear(!1)}d.add(m);this.wn=h}return 0<this.kr&&!this.yr(d)?0:this.pk?0==this.Kd.yh&&this.AB()?2:0:0==this.Kd.yh?2:1};c.prototype.TE=function(d){if(1==d.size)return!0;for(var e=0,g=d.size;e<g;e++){var m=d.get(e);this.Hf.Sb(m);var h=this.Hf.oi();this.$a.push(this.Ls(h,m,this.Hf.Qa,!0));this.Hf.ia();h=this.Hf.ia();this.$a.push(this.Ls(h,m,this.Hf.Qa,!1))}var b=this;this.$a.sort(function(d,e){return b.sM(d,e)});m=this.Lg.Wd;-1==m&&(m=this.Lg.jh(0));
this.Lg.$l(this.$a.length);e=0;for(g=this.$a.length;e<g;e++)this.Lg.addElement(m,e);for(var e=!0,c=g=-1;e;){e=!1;h=this.Lg.gc(m);if(-1==h)break;for(var p=this.Lg.bb(h);-1!=p;){g=this.Lg.getData(h);c=this.Lg.getData(p);g=this.$a[g].tn;c=this.$a[c].tn;if(g==c)if(e=!0,this.Lg.Jc(m,h),h=this.Lg.ge(p),p=this.Lg.Jc(m,p),-1==p||-1==h)break;else continue;h=p;p=this.Lg.bb(h)}}e=this.Lg.vq(m);this.Lg.CB(m);if(0<e)return this.Kd=new a.wd(5,g,c),!1;e=0;for(g=d.size;e<g;e++)this.my(this.$a[e]);this.$a.length=
0;return!0};c.prototype.yr=function(d){for(var e=0,g=d.size;e<g;e++){var m=d.get(e),h=this.yp.read(m);if(-1!=h){var b=this.Za.da(h);this.Hi.add(b);this.Za.kd(h,-1);this.my(this.$a[b]);this.$a[b]=null;this.yp.write(m,-1)}h=this.hu.read(m);-1!=h&&(b=this.Za.da(h),this.Hi.add(b),this.Za.kd(h,-1),this.my(this.$a[b]),this.$a[b]=null,this.hu.write(m,-1))}e=0;for(g=d.size;e<g;e++){m=d.get(e);this.Hf.Sb(m);h=this.Hf.oi();if(h.ja>h.ha){var c=this.Hf.Jb(),p=this.Ls(h,m,this.Hf.Qa,!0);0<this.Hi.size?(b=this.Hi.tc(),
this.Hi.af(),this.$a[b]=p):(b=this.$a.length,this.$a.push(p));h=this.Za.addElement(b,-1);-1==this.yp.read(c)?this.yp.write(c,h):this.hu.write(c,h);0==(this.gn.read(this.Hf.Qa)&3)&&this.Ll.add(h)}this.Hf.ia();h=this.Hf.ia();h.ja<h.ha&&(c=this.Hf.Bm(),p=this.Ls(h,m,this.Hf.Qa,!1),0<this.Hi.size?(b=this.Hi.tc(),this.Hi.af(),this.$a[b]=p):(b=this.$a.length,this.$a.push(p)),h=this.Za.addElement(b,-1),-1==this.yp.read(c)?this.yp.write(c,h):this.hu.write(c,h),0==(this.gn.read(this.Hf.Qa)&3)&&this.Ll.add(h))}e=
0;for(g=this.Ll.size;e<g&&0<this.kr;e++)if(h=this.Ll.get(e),0==(this.gn.read(this.$a[this.Za.da(h)].Gx)&3)){d=-1;for(var m=this.Za.ge(h),u=h,p=null,b=-1,f=0;-1!=m;){b=this.Za.da(m);p=this.$a[b];b=p.Gx;f=this.gn.read(b);if(0!=(f&3))break;u=m;m=this.Za.ge(m)}-1==m?(c=1,m=u):(d=1==(f&3)?b:this.Hx.read(b),c=0!=p.LC()?0:1,m=this.Za.bb(m));do{b=this.Za.da(m);p=this.$a[b];b=p.Gx;u=this.gn.read(b);if(0==(u&3)){if(c!=p.LC())return this.Kd=new a.wd(6,b,-1),!1;f=0==c||p.sl()?2:1;u=u&252|f;this.gn.write(b,f);
if(2==f&&0==this.Kd.yh&&this.Hx.read(b)!=d&&(this.Kd=new a.wd(7,b,-1),this.pk))return!1;this.kr--;if(0==this.kr)return!0}1==(u&3)&&(d=b);u=m;m=this.Za.bb(m);c=0!=c?0:1}while(u!=h)}null!=this.Ll?this.Ll.clear(!1):this.Ll=new a.ga(0);return!0};c.prototype.Ls=function(d,e,g,m){if(322==d.D())d=this.PL(d);else throw a.g.wa();d.tn=e;d.Gx=g;d.hp=0;d.hS(m);return d};c.prototype.PL=function(d){var e;0<this.dn.length?(e=this.dn[this.dn.length-1],--this.dn.length,d.copyTo(e.Zd)):(e=new h,e.Zd=a.fA.Yj(d));return e};
c.prototype.my=function(d){322==d.Zd.D()&&this.dn.push(d)};c.prototype.eQ=function(){for(var d=this.U.F(),e=new a.ga(0),g=0;g<d;g++)e.add(g);var m=this;e.xd(0,d,function(d,e){return m.Is(d,e)});for(g=1;g<d;g++)if(0==this.Is(e.get(g-1),e.get(g)))return this.Kd=new a.wd(3,e.get(g-1),e.get(g)),0;return 2};c.prototype.NQ=function(){return this.yB()?this.xB(!0)?2:0:0};c.prototype.LQ=function(){return this.Yw()};c.prototype.fQ=function(){for(var d=this.U.F(),e=new a.ga(0),g=0;g<d;g++)e.add(g);var m=this;
e.xd(0,d,function(d,e){return m.uL(d,e)});var h=Array(d);a.I.Ps(h,!1);h[e.get(0)]=!0;for(g=1;g<d;g++){var b=e.get(g-1),c=e.get(g);0==this.Is(b,c)?h[c]=!1:h[c]=!0}for(var e=this.U.Pa(),b=this.U,c=0,p=1,g=0;g<d;g++)h[g]?p=g+1:(c<p&&e.Pd(b,c,p),c=g+1);c<p&&e.Pd(b,c,p);e.hg(2,this.pn);return e};c.prototype.OQ=function(){var d=this.U,e=d.Ca(),g=d.Ca(),m=this.U.Pa(),h=this.U,b=d.hasAttribute(1),c=b?a.Ia.rB(this.sg,d,!0):0,p=new a.ga(0),u=new a.ga(0);p.xb(a.I.truncate(d.F()/2+1));for(u.xb(a.I.truncate(d.F()/
2+1));e.kb();)if(g.kb(),!(2>d.Ha(e.Qa))){g.zR();for(var f,l,C=!0;e.La();){var q=e.ia(),n=g.oi();if(e.Jb()>g.Jb())break;C&&(p.add(e.Jb()),u.add(g.Bm()),C=!1);l=p.tc();var z=e.Bm();if(1<z-l){var k=new a.b;k.pc(d.Fa(l),d.Fa(z));f=k.length()}else f=q.$b();l=u.tc();z=g.Jb();1<z-l?(k=new a.b,k.pc(d.Fa(l),d.Fa(z)),l=k.length()):l=n.$b();f>this.pn?p.add(e.Bm()):b&&(f=d.ld(1,p.tc(),0),q=q.Ws(1,0),Math.abs(q-f)>c&&p.add(e.Bm()));l>this.pn?u.add(g.Jb()):b&&(f=d.ld(1,u.tc(),0),q=n.Ws(1,0),Math.abs(q-f)>c&&u.add(g.Jb()))}p.tc()<
u.tc()?p.size>u.size?p.af():u.af():(p.tc()!=u.tc()&&u.af(),u.af());if(2<=u.size+p.size){C=new a.Va;n=0;for(q=p.size;n<q;n++)h.Sd(p.get(n),C),0==n?m.df(C):m.lineTo(C);for(n=u.size-1;0<n;n--)h.Sd(u.get(n),C),m.lineTo(C);h.vc(e.Qa)?m.ro():0<u.size&&(h.Sd(u.get(0),C),m.lineTo(C))}null!=p&&p.clear(!1);null!=u&&u.clear(!1)}m.hg(2,this.pn);return m};c.prototype.MQ=function(){return this.xS()};c.prototype.xS=function(){if(1736==this.U.D()&&1==this.U.Cm())return a.Of.Qj(this.U,this.pn,!0,!1,this.oe);this.Zh=
new a.fd;this.Zh.Eb(this.U);0!=this.Zh.pd&&(1!=this.yx&&a.aj.$(this.Zh,this.pn,this.oe,!0),1736==this.U.D()&&a.mm.$(this.Zh,this.Zh.$c,this.yx,!1,this.oe));this.U=this.Zh.hf(this.Zh.$c);1736==this.U.D()&&(this.U.hl(),this.U.Pp(0));this.U.hg(2,this.pn);return this.U};c.ac=function(d,e,g){if(d.s())return 1;var m=d.D();if(33==m)return 1;if(197==m)return g=new a.i,d.o(g),g.mg(a.Ia.Cg(e,d,!1))?0:1;if(a.T.Lc(m))throw a.g.wa();if(!a.T.Th(m))throw a.g.wa();var m=a.Ia.Cg(e,d,!1),h=d.rj(m);g=g?-1:h;if(-1!=
g)return g;1==g&&(m=0);g=(new c(d,e,g,0,!1)).Yw();d.hg(g,m);return g};c.Ro=function(d,e,g,m,h){null!=m&&(m.yh=0,m.Fk=-1,m.Gk=-1);if(d.s())return 1;var b=d.D();if(33==b)return 1;var p=a.Ia.Cg(e,d,!1);if(197==b)return e=new a.i,d.o(e),e.mg(p)?(null!=m&&(m.yh=2,m.Fk=-1,m.Gk=-1),0):1;if(a.T.Lc(b))return p=new a.Xa(d.description),p.Bc(d,!0),c.Ro(p,e,g,m,h);h=d.rj(p);g=g?-1:h;if(-1!=g)return g;e=new c(d,e,g,0,!1);if(550==b)g=e.eQ();else if(1607==b)g=e.NQ();else if(1736==b)g=e.LQ();else throw a.g.wa();d.hg(g,
p);null!=m&&0==g&&m.aq(e.Kd);return g};c.ob=function(d,e,g,m,h){null!=m&&(m.yh=0,m.Fk=-1,m.Gk=-1);if(d.s())return 1;var b=d.D();if(33==b)return 1;var p=a.Ia.Cg(e,d,!1);if(197==b)return e=new a.i,d.o(e),e.mg(p)?(null!=m&&(m.yh=2,m.Fk=-1,m.Gk=-1),0):1;if(a.T.Lc(b))return b=new a.Xa(d.description),b.Bc(d,!0),c.Ro(b,e,g,m,h);d=new c(d,e,-1,0,!0);if(550==b||1607==b||1736==b)e=d.Yw();else throw a.g.wa();null!=m&&m.aq(d.Kd);return e};c.cG=function(d,e,g,m){if(d.s())return d;var h=d.D();if(33==h)return d;
var b=a.Ia.Cg(e,d,!1);if(197==h)return e=new a.i,d.o(e),e.mg(b)?d.Pa():d;if(a.T.Lc(h))return h=new a.Xa(d.description),h.Bc(d,!0),c.cG(h,e,g,m);m=d.rj(b);g=g?-1:m;if(2==g)return d;d=new c(d,e,g,0,!1);if(550==h)d=d.fQ();else if(1607==h)d=d.OQ();else if(1736==h)d=d.MQ();else throw a.g.wa();return d};c.Ry=function(d,e,g,m){if(d.s())return d;var h=d.D();if(33==h)return d;var b=a.Ia.Cg(e,d,!1);if(197==h)return e=new a.i,d.o(e),e.mg(b)?d.Pa():d;if(a.T.Lc(h))return b=new a.Xa(d.description),b.Bc(d,!0),c.Ry(b,
e,g,m);if(!a.T.Th(h))throw a.g.ra("OGC simplify is not implemented for this geometry type "+h);return a.Of.Ry(d,b,!1,m)};c.prototype.kj=function(d,e,g){if(d==e)return 0;d=this.xh.get(d);var m=this.xh.get(e);e=d>>1;var h=m>>1,b=new a.b,c=new a.b;this.$e.ec(2*e,b);b.y+=0!=(d&1)?this.Ri:-this.Ri;this.$e.ec(2*h,c);c.y+=0!=(m&1)?this.Ri:-this.Ri;d=b.compare(c);return 0==d&&g?(g=this.Bk.get(e)-this.Bk.get(h),0>g?-1:0<g?1:0):d};c.prototype.Is=function(d,e){if(d==e)return 0;var g=this.U,m=g.Fa(d),h=g.Fa(e);
if(m.x<h.x)return-1;if(m.x>h.x)return 1;if(m.y<h.y)return-1;if(m.y>h.y)return 1;for(m=1;m<this.wP;m++)for(var h=this.SD.Hd(m),b=a.pa.Wa(h),c=0;c<b;c++){var p=g.ld(h,d,c),u=g.ld(h,e,c);if(p<u)return-1;if(p>u)return 1}return 0};c.prototype.uL=function(d,e){var g=this.Is(d,e);return 0==g?d<e?-1:1:g};c.prototype.sM=function(d,e){if(d===e)return 0;var g=d.Zd.Pf(d.sl()?1:0);d.sl()&&g.Bp();d=e.Zd.Pf(e.sl()?1:0);e.sl()&&d.Bp();e=g.ps();var a=d.ps();return a==e?(e=g.Ai(d),Math.abs(e)<=8.881784197001252E-16*
(Math.abs(d.x*g.y)+Math.abs(d.y*g.x))&&(e--,e++),0>e?1:0<e?-1:0):e<a?-1:1};return c}();a.cv=c})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 30};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.prototype.$=function(d,e,m,h){return d instanceof a.T?(d=new a.Pc(d),e=new a.Pc(e),this.$(d,e,m,h).next()):new a.hI(d,e,m,h)};e.On=function(d,g,m,h){var b=d.fb(),c=g.fb();if(d.s()&&g.s())return b>c?d:g;if(d.s())return g;if(g.s())return d;
var p=new a.i,u=new a.i,f=new a.i;d.o(p);g.o(u);f.K(p);f.Db(u);p=a.Ia.zd(m,f,!1);u=d.D();f=g.D();return 33==u&&33==f?e.qP(d,g,p):u!=f?0<b||0<c?b>c?d:g:550==u?e.pA(d,g,p):e.pA(g,d,p):a.Of.On(d,g,m,h)};e.qP=function(d,e,m){m=m*Math.sqrt(2)*1.00001;m*=m;var g=d.w(),h=e.w(),b=new a.pe(d.description);a.b.Zb(g,h)>m&&(b.add(d),b.add(e));return b};e.pA=function(d,e,m){var g=d.mc(0),h=d.F(),b=e.w(),c=d.Pa();m=m*Math.sqrt(2)*1.00001;var p=new a.i;d.o(p);p.P(m,m);if(p.contains(b)){m*=m;for(var p=!1,f=[],l=0;l<
h;l++)f[l]=!1;for(l=0;l<h;l++){var q=g.read(2*l),n=g.read(2*l+1),q=q-b.x,n=n-b.y;q*q+n*n<=m&&(p=!0,f[l]=!0)}if(p)for(l=0;l<h;l++)f[l]||c.Pd(d,l,l+1);else c.Pd(d,0,h),c.add(e)}else c.Pd(d,0,h),c.add(e);return c};e.V=null;return e}(a.Me);a.dv=h})(A||(A={}));(function(a){var h=function(){function h(e,d,g,a){this.Fq=null==d;this.ua=-1;this.ne=e;this.cg=g;this.QP=d.next();this.Yb=a}h.prototype.next=function(){if(this.Fq)return null;var e;return null!=(e=this.ne.next())?(this.ua=this.ne.ya(),a.dv.On(e,
this.QP,this.cg,this.Yb)):null};h.prototype.ya=function(){return this.ua};return h}();a.hI=h})(A||(A={}));(function(a){var h=function(){function d(){}d.prototype.jt=function(){this.iw=null;this.Vu=-1;this.xG=!1};return d}(),b=function(){function d(){this.jq=0;this.Ci=[]}d.prototype.TJ=function(d){this.jq+=d.Vu;this.Ci.push(d)};d.prototype.PQ=function(){this.jq-=this.Ci[this.Ci.length-1].Vu;--this.Ci.length};d.prototype.Dv=function(){return this.Ci[this.Ci.length-1]};d.prototype.lc=function(d){return d===
this};return d}(),e=function(){function d(d,e,a){this.ua=-1;this.Ec=!1;this.bE=[!1,!1,!1,!1];this.ep=[0,0,0,0];this.ox=!1;this.Gj=-1;this.So=0;this.Tm=-1;this.rn=[];this.ne=d;this.cg=e;this.Yb=a}d.ac=function(d){var e=[],g;for(g in d)e.push(Number(g));e.sort(function(d,e){return d-e});return e};d.prototype.UC=function(e){var g=this.rn[e],h=d.ac(g)[0],b=g[h],c=b.Dv().iw,b=b.Dv().xG;delete g[h];b&&(c=a.as.local().$(c,this.cg,!1,this.Yb),0==e&&33==c.D()&&(e=new a.pe(c.description),c.s()||e.add(c),c=
e));return c};d.prototype.next=function(){if(this.Ec&&this.Tm==this.Gj)return null;for(;!this.FS(););if(-1==this.Gj)return null;if(this.ox){for(this.Tm++;;){if(this.Tm>this.Gj||0>this.Tm)throw a.g.wa();if(this.bE[this.Tm])break}this.ua++;return this.UC(this.Tm)}this.ua=0;this.Tm=this.Gj;return this.UC(this.Gj)};d.prototype.ya=function(){return this.ua};d.prototype.FS=function(){if(this.Ec)return!0;var d=null;null!=this.ne&&(d=this.ne.next(),null==d&&(this.Ec=!0,this.ne=null));if(null!=d){var e=d.fb();
this.bE[e]=!0;e>=this.Gj&&!this.ox&&(this.SA(e,!1,d),e>this.Gj&&!this.ox&&this.vR(e))}if(0<this.So)for(e=0;e<=this.Gj;e++)for(;1<this.ep[e];)if(d=this.jL(e),0!=d.length)d=a.Of.oM(d,this.cg,this.Yb),this.SA(e,!0,d);else break;return this.Ec};d.prototype.jL=function(e){for(var g=[],a=[],h=this.rn[e],b=d.ac(h),c=0;c<b.length;c++){var p=b[c],f=h[p];if(this.Ec||1E4<f.jq&&1<f.Ci.length){this.ep[e]-=f.Ci.length;for(this.So-=f.Ci.length;0<f.Ci.length;)g.push(f.Dv().iw),f.PQ();a.push(p)}}for(c=0;c<a.length;c++)delete h[a[c]];
return g};d.prototype.vR=function(d){for(var e=0;e<d;e++)this.rn[e]=[],this.So-=this.ep[e],this.ep[e]=0};d.prototype.SA=function(e,a,c){var g=new h;g.jt();g.iw=c;c=d.$g(c);g.Vu=c;c=d.Wf(c);if(e+1>this.rn.length)for(var m=0,p=Math.max(2,e+1);m<p;m++)this.rn.push([]);m=this.rn[e][c];void 0===m&&(m=new b,this.rn[e][c]=m);g.xG=a;m.TJ(g);this.ep[e]++;this.So++;this.Gj=Math.max(this.Gj,e)};d.Wf=function(d){return 0<d?a.I.truncate(Math.log(d)/Math.log(4)+.5):0};d.$g=function(d){var e=d.D();if(a.T.Th(e))return d.F();
if(33==e)return 1;if(197==e)return 4;if(a.T.Lc(e))return 2;throw a.g.wa();};return d}();a.jI=e})(A||(A={}));(function(a){var h=function(h){function e(){h.apply(this,arguments)}z(e,h);e.prototype.D=function(){return 1};e.prototype.$=function(d,e,m,h){return void 0===h?new a.jI(d,e,m):this.xM(d,e,m,h)};e.prototype.xM=function(d,e,m,h){d=new a.Pc([d,e]);return this.$(d,m,h).next()};e.local=function(){null===e.V&&(e.V=new e);return e.V};e.V=null;return e}(a.Me);a.wi=h})(A||(A={}));(function(a){var h;
(function(a){a[a.nextPath=0]="nextPath";a[a.nextSegment=1]="nextSegment";a[a.iterate=2]="iterate"})(h||(h={}));h=function(){function h(e,d,g,m){this.dr=new a.i;this.LP=e;this.MP=d;this.Wo=m;this.hn=-1;this.qk=!1;var h=e.pb;null!=h&&(h=m?h.nn:h.Ab,null!=h&&(this.Ec=!1,this.ka=g,this.Ab=h,this.au=this.Ab.Re(),this.Xo=this.qk=!0,this.Hb=0,m?this.hn=d.ea():this.bd=d.Ca()));this.qk||(h=d.pb,null!=h&&(h=m?h.nn:h.Ab,null!=h&&(this.Ec=!1,this.ka=g,this.Ab=h,this.au=this.Ab.Re(),this.qk=!0,this.Xo=!1,this.Hb=
0,m?this.hn=e.ea():this.bd=e.Ca())));this.qk||(this.th=m?a.Ia.BN(e,d,g,1<=e.rj(0),1<=d.rj(0)):a.Ia.AN(e,d,g))}h.prototype.next=function(){if(this.qk){if(this.Ec)return!1;for(var e=!0;e;)switch(this.Hb){case 0:e=this.nQ();break;case 1:e=this.oQ();break;case 2:e=this.$w();break;default:throw a.g.ra("internal error");}return this.Ec?!1:!0}return null==this.th?!1:this.th.next()};h.prototype.jk=function(){return this.qk?this.Xo?this.Ab.da(this.Rq):this.Wo?this.hn:this.bd.Jb():this.th.jk(this.th.Ff)};h.prototype.ek=
function(){return this.qk?this.Xo?this.Wo?this.hn:this.bd.Jb():this.Ab.da(this.Rq):this.th.ek(this.th.mf)};h.prototype.Fw=function(){if(!this.Wo)throw a.g.ra("internal error");return this.qk?this.Xo?this.Ab.uC(this.Rq):this.dr:this.th.Fw(this.th.Ff)};h.prototype.jw=function(){if(!this.Wo)throw a.g.ra("internal error");return this.qk?this.Xo?this.dr:this.Ab.uC(this.Rq):this.th.jw(this.th.mf)};h.prototype.nQ=function(){if(!this.Wo){if(!this.bd.kb())return this.Ec=!0,!1;this.Hb=1;return!0}if(-1==--this.hn)return this.Ec=
!0,!1;this.Xo?this.MP.Ti(this.hn,this.dr):this.LP.Ti(this.hn,this.dr);this.au.Ch(this.dr,this.ka);this.Hb=2;return!0};h.prototype.oQ=function(){if(!this.bd.La())return this.Hb=0,!0;var e=this.bd.ia();this.au.Fn(e,this.ka);this.Hb=2;return!0};h.prototype.$w=function(){this.Rq=this.au.next();return-1==this.Rq?(this.Hb=this.Wo?0:1,!0):!1};return h}();a.cl=h})(A||(A={}));(function(a){a=a.kI||(a.kI={});a[a.enumClosed=1]="enumClosed";a[a.enumHasNonlinearSegments=2]="enumHasNonlinearSegments";a[a.enumOGCStartPolygon=
4]="enumOGCStartPolygon";a[a.enumCalcMask=4]="enumCalcMask"})(A||(A={}));(function(a){var b=function(){function b(){}b.Fb=function(e,d,g,m,h,c,p,f,l){var u=[0,0,0],q=[0,0,0],C=[0,0,0],n=[0,0,0,0],z=new a.ca(0),k=new a.ca(0),t=new a.ca(0);if(null!=p||null!=f||null!=l)if(a.j.Ih(d))a.zg.Fb(e,g,m,h,c,p,f,l);else{h=a.u.W(h);g=a.u.W(g);var v=a.u.W(h-g);if(a.j.S(m,c)&&(a.j.S(g,h)||a.j.S(a.j.H(m),1.570796326794897)))null!=p&&(p.l=0),null!=f&&(f.l=0),null!=l&&(l.l=0);else{if(a.j.S(m,-c)){if(a.j.S(a.j.H(m),
1.570796326794897)){null!=p&&(p.l=2*a.u.gg(e,d));null!=f&&(f.l=0<m?a.u.W(3.141592653589793-a.u.W(h)):a.u.W(h));null!=l&&(l.l=0<m?a.u.W(h):a.u.W(3.141592653589793-a.u.W(h)));return}a.j.S(a.j.H(v),3.141592653589793)&&(null!=p&&(p.l=2*a.u.gg(e,d)),null!=f&&(f.l=0),null!=l&&(l.l=0))}else{if(a.j.S(a.j.H(m),1.570796326794897)||a.j.S(a.j.H(c),1.570796326794897)){a.Xj.Fb(e,d,g,m,h,c,p,f,l);return}if(a.j.S(g,h)||a.j.S(a.j.H(v),3.141592653589793)){a.Xj.Fb(e,d,g,m,h,c,p,f,l);return}if(a.j.Vc(m)){a.Xj.Fb(e,d,
g,m,h,c,p,f,l);return}}var A=Math.sqrt(1-d);h=a.u.W(h-g);g=0;a.u.wm(d,m,g,z,k,t);u[0]=z.l;u[1]=k.l;u[2]=t.l;a.u.wm(d,c,h,z,k,t);q[0]=z.l;q[1]=k.l;q[2]=t.l;C[0]=0;C[1]=0;C[2]=-1*d*a.u.n(1,d,m)*Math.sin(m);0>h?a.u.Ep(C,q,u,n,0):a.u.Ep(C,u,q,n,0);for(var k=[0,0,0],t=[0,0,0],w=[0,0,0],u=[0,0,0],z=[0,0,0],y=Math.acos(n[2]/1),D=1-d,B=Math.tan(y),F=1+B*B/D,M=2*C[2]*B/D,B=Math.sqrt(M*M-4*F*(C[2]*C[2]/D-1)),F=2*F,D=(-M+B)/F,M=(-M-B)/F,B=Math.tan(y),F=B*D+C[2],y=(D+M)/2,C=(F+(B*M+C[2]))/2,B=a.u.Sn(D-y,F-C),
D=C/A*1.570796326794897,M=0;100>M;M++){F=a.u.Tk(d,D);F=F*F/Math.cos(D)*(Math.sin(D)-C*F/(1*(1-d)));if(a.j.Vc(F))break;D-=F}var C=a.u.n(1,d,D)*Math.cos(D),C=Math.sqrt((C-y)*(C+y)),B=1-B/C,B=B*(2-B),F=a.u.jm(k),y=a.u.jm(t),D=a.u.jm(w),J=a.u.Qr(w,k),M=a.u.Qr(w,t);a.u.Uu(w,k,u);a.u.Uu(w,t,z);k=Math.acos(J/(D*F));t=Math.acos(M/(D*y));t*=a.j.nb(1,a.u.Qr(u,z));if(1.570796326794897<=a.j.H(k)&&1.570796326794897<=a.j.H(t)||3.141592653589793<a.j.H(k-t))k=(3.141592653589793-a.j.H(k))*a.j.nb(1,k),t=(3.141592653589793-
a.j.H(t))*a.j.nb(1,t);u=a.u.Si(B,t);z=a.u.q(C,B,a.u.Si(B,k));u=a.u.q(C,B,u);u=a.j.H(u-z)*e;k=new a.ca(0);t=new a.ca(0);w=n[1]/1;w*=-a.j.nb(1,v);z=Math.acos(w)*a.j.nb(1,v);b.gf(e,d,g,m,u,z,k,t);a.j.S(h,k.l)&&a.j.S(c,t.l)||(B=a.u.Sn(a.u.W(h-k.l),c-t.l),b.gf(e,d,g,m,u,a.u.W(z+3.141592653589793),k,t),F=a.u.Sn(a.u.W(h-k.l),c-t.l),F<B&&(z=a.u.W(z+3.141592653589793)));k=[0,0,0,0];t=[0,0,0,0];C=[0,0,0];B=[0,0,0];e=[0,0,0];g=[0,0,0];m=[0,0,0];w=[0,0,0];C[0]=0;C[1]=0;C[2]=A;B[0]=0;B[1]=0;B[2]=0;a.u.Ep(B,C,
q,k,0);a.j.Vc(c)?(e[0]=q[0],e[1]=q[1],e[2]=1,g[0]=1*Math.cos(h)-1*Math.sin(h),g[1]=1*Math.sin(h)+1*Math.cos(h)):(d=a.u.n(1,d,c)*Math.cos(c),e[0]=0,e[1]=0,q[2]+=Math.tan(1.570796326794897-a.j.H(c))*d*a.j.nb(1,c),g[0]=d*Math.cos(h)-d*Math.sin(h),g[1]=d*Math.sin(h)+d*Math.cos(h));g[2]=q[2];a.u.Ep(q,g,e,t,1);a.u.Uu(t,k,m);a.u.Uu(t,n,w);w=a.u.Qr(m,w)/(a.u.jm(m)*a.u.jm(w));w*=a.j.nb(1,v);h=Math.acos(w)*-a.j.nb(1,v);0<z&&0<h?h=a.u.W(h+3.141592653589793):0>z&&0>h&&(h=a.u.W(h+3.141592653589793));null!=p&&
(p.l=u);null!=f&&(f.l=z);null!=l&&(l.l=h)}}};b.gf=function(e,d,g,m,b,h,c,p){var u=[0,0,0],f=[0,0,0],l=[0,0,0],q=[0,0,0],C=[0,0,0],n=[0,0,0],z=[0,0,0],k=[0,0,0,0],t=new a.ca(0),v=new a.ca(0),A=new a.ca(0),w=new a.ca(0),y=new a.ca(0),D=new a.ca(0);if(null!=c&&null!=p)if(a.j.Ih(d))a.zg.gf(e,g,m,b,h,c,p);else if(a.j.Vc(b))null!=c&&(c.l=g),null!=p&&(p.l=m);else if(h=a.u.W(h),0>b&&(b=a.j.H(b),h=a.u.W(h+3.141592653589793)),g=a.u.W(g),m=a.u.W(m),1.570796326794897<a.j.H(m)&&(g=a.u.W(g+3.141592653589793),m=
a.j.nb(3.141592653589793,m)-m),a.j.S(a.j.H(m),1.570796326794897)||a.j.Vc(m)||a.j.Vc(h)||a.j.S(a.j.H(h),3.141592653589793))a.Xj.gf(e,d,g,m,b,h,c,p);else{var B=Math.sqrt(1-d);e=b/e;a.u.wm(d,m,0,w,y,D);u[0]=w.l;u[1]=y.l;u[2]=y.l;z[0]=0;z[1]=0;z[2]=-1*d*a.u.n(1,d,m)*Math.sin(m);w=a.u.n(1,d,m);y=a.u.W(1.570796326794897-h);D=Math.sin(y);b=Math.cos(m);m=Math.sin(m);C[0]=w*b-m*D;C[1]=Math.cos(y);C[2]=(1-d)*w*m+b*D;0>h?a.u.Ep(z,C,u,k,0):a.u.Ep(z,u,C,k,0);u=Math.acos(k[2]/1);k=Math.atan2(-k[1],-k[0]);m=1-d;
C=Math.tan(u);y=1+C*C/m;w=2*z[2]*C/m;C=Math.sqrt(w*w-4*y*(z[2]*z[2]/m-1));y*=2;m=(-w+C)/y;w=(-w-C)/y;C=Math.tan(u);y=C*m+z[2];u=(m+w)/2;z=(y+(C*w+z[2]))/2;C=a.u.Sn(m-u,y-z);B=z/B*1.570796326794897;for(m=0;100>m;m++){w=a.u.Tk(d,B);w=w*w/Math.cos(B)*(Math.sin(B)-z*w/(1*(1-d)));if(a.j.Vc(w))break;B-=w}B=a.u.n(1,d,B)*Math.cos(B);B=Math.sqrt((B-u)*(B+u));z=1-C/B;z*=2-z;n=Math.acos(a.u.Qr(n,f)/(a.u.jm(n)*a.u.jm(f)));n*=a.j.nb(1,f[0]);h=(a.u.q(B,z,a.u.Si(z,n))+e*a.j.nb(1,h))/a.u.gg(B,z);h=a.u.W(1.570796326794897*
h);h=a.u.xn(z,h);a.u.n(B,z,h);C=a.u.W(k+g);g=Math.cos(C);h=Math.sin(C);l[0]=q[0]*g+q[1]*-h;l[1]=q[0]*h+q[1]*g;l[2]=q[2];a.u.JK(d,l[0],l[1],l[2],A,v,t);null!=c&&(c.l=v.l);null!=p&&(p.l=A.l)}};return b}();a.$z=b})(A||(A={}));(function(a){var b=function(){function d(d){this.Na=null;this.Ar=new a.b;this.Br=new a.b;this.a=d}d.prototype.compare=function(d,e,a){this.a.uc(e,this.Ar);this.a.uc(d.da(a),this.Br);return this.Ar.compare(this.Br)};return d}(),h=function(){function d(d){this.nf=new a.b;this.ln=
new a.b;this.a=d}d.prototype.bh=function(d){this.nf.J(d)};d.prototype.compare=function(d,e){this.a.uc(d.da(e),this.ln);return this.nf.compare(this.ln)};return d}(),e=function(d){function e(e){d.call(this,e.a,e.ka,!1);this.ab=e}z(e,d);e.prototype.compare=function(d,e,a){if(this.Zf)return-1;var g=this.ab.Cd.Dm(this.ab.lh(e));d=d.da(a);var m=this.ab.Cd.Dm(this.ab.lh(d));this.Cl=a;return this.JB(e,g,d,m)};return e}(a.hA),d=function(d){function e(e){d.call(this,e.a,e.ka);this.ab=e}z(e,d);e.prototype.compare=
function(d,e){if(this.Zf)return-1;d=this.ab.Cd.Dm(this.ab.lh(d.da(e)));this.Cl=e;return this.KB(e,d)};return e}(a.JI),g=function(){function g(){this.zc=this.Ue=this.Zm=this.Cd=this.Kg=this.nd=this.$a=this.a=null;this.og=!1;this.Xg=this.Kl=this.Vd=this.Lj=this.Mg=this.Hj=this.sf=this.Ld=null;this.Yg=this.rp=this.Tx=this.ka=0;this.Ht=this.Nm=!1;this.mn=new a.b;this.Ck=new a.b;this.$a=new a.Fc(8);this.nd=new a.Fc(5);this.Kg=new a.Ur;this.Cd=new a.Ur;this.og=!1;this.Xg=new a.b;this.Xg.ma(0,0);this.ka=
0;this.Yg=-1;this.Nm=!1;this.a=null;this.Ue=new a.bj;this.zc=new a.bj;this.Mg=new a.ga(0);this.Lj=new a.gA;this.sf=new a.ga(0);this.Hj=new a.ga(0);this.Zm=new a.Va}g.prototype.GS=function(d,e){var g=new a.Bg;g.Oy();d.Oe(g);this.Op(d);this.Nm=!1;this.ka=e;this.Tx=e*e;e=this.Xy();d.Oe(g);e||(this.JM(),e||this.Xy());-1!=this.Yg&&(this.a.bf(this.Yg),this.Yg=-1);this.a=null;return this.Nm};g.prototype.KS=function(d,e){this.Op(d);this.Nm=!1;this.ka=e;this.Tx=e*e;this.og=!1;this.Xy();this.og||(this.og=1==
d.xo(e,!0,!1));-1!=this.Yg&&(this.a.bf(this.Yg),this.Yg=-1);this.a=null};g.prototype.Uf=function(d,e){return this.$a.O(d,0+e)};g.prototype.zy=function(d,e,a){this.$a.L(d,0+e,a)};g.prototype.lh=function(d){return this.$a.O(d,2)};g.prototype.UR=function(d,e){this.$a.L(d,2,e)};g.prototype.FC=function(d,e){return this.$a.O(d,3+e)};g.prototype.Eo=function(d){return this.$a.O(d,7)};g.prototype.Nk=function(d,e){this.$a.L(d,7,e)};g.prototype.Go=function(d,e){return this.$a.O(d,3+this.Do(d,e))};g.prototype.Qp=
function(d,e,a){this.$a.L(d,3+this.Do(d,e),a)};g.prototype.ZN=function(d,e){return this.$a.O(d,5+this.Do(d,e))};g.prototype.Sp=function(d,e,a){this.$a.L(d,5+this.Do(d,e),a)};g.prototype.rq=function(d){return this.nd.O(d,0)};g.prototype.RR=function(d,e){this.nd.L(d,0,e)};g.prototype.ow=function(d){return this.nd.O(d,4)};g.prototype.Lp=function(d,e){this.nd.L(d,4,e)};g.prototype.fk=function(d){return this.nd.O(d,1)};g.prototype.dm=function(d,e){this.nd.L(d,1,e)};g.prototype.nw=function(d){return this.nd.O(d,
3)};g.prototype.Hr=function(d,e){this.nd.L(d,3,e)};g.prototype.Ul=function(d){var e=this.nd.be(),a=this.Kg.jh();this.RR(e,a);-1!=d?(this.Kg.addElement(a,d),this.a.lb(d,this.Yg,e),this.Lp(e,this.a.gb(d))):this.Lp(e,-1);return e};g.prototype.aM=function(d){this.nd.Jc(d)};g.prototype.QA=function(d,e){this.Kg.addElement(this.rq(d),e);this.a.lb(e,this.Yg,d)};g.prototype.rr=function(d){var e=this.$a.be(),a=this.Cd.jh();this.UR(e,a);-1!=d&&this.Cd.addElement(a,d);return e};g.prototype.RA=function(d,e){this.Cd.addElement(this.lh(d),
e)};g.prototype.Ns=function(d){this.$a.Jc(d);d=this.Mg.Qs(d);0<=d&&this.Mg.QE(d)};g.prototype.yi=function(d,e){if(-1==this.Uf(d,0))this.zy(d,0,e);else if(-1==this.Uf(d,1))this.zy(d,1,e);else throw a.g.wa();this.Av(d,e)};g.prototype.Av=function(d,e){var a=this.fk(e);if(-1!=a){var g=this.Go(a,e);this.Sp(g,e,d);this.Qp(d,e,g);this.Qp(a,e,d);this.Sp(d,e,a)}else this.Sp(d,e,d),this.Qp(d,e,d),this.dm(e,d)};g.prototype.Do=function(d,e){return this.Uf(d,0)==e?0:1};g.prototype.Tl=function(d,e){var a=this.nw(e);
-1!=a&&(this.Ue.kd(a,-1),this.Hr(e,-1));var g,a=this.fk(e);if(-1!=a){var m=g=a,b;do{b=!1;var h=this.Do(g,e),c=this.FC(g,h);if(this.Uf(g,h+1&1)==d){this.Os(g);this.Cd.Fg(this.lh(g));this.Ns(g);if(g==c){a=-1;break}a==g&&(a=this.fk(e),m=c,b=!0)}g=c}while(g!=m||b);if(-1!=a){do h=this.Do(g,e),c=this.FC(g,h),this.zy(g,h,d),g=c;while(g!=m);g=this.fk(d);-1!=g?(m=this.Go(g,d),b=this.Go(a,d),m==g?(this.dm(d,a),this.Av(g,d),this.dm(d,g)):b==a&&this.Av(a,d),this.Qp(a,d,m),this.Sp(m,d,a),this.Qp(g,d,b),this.Sp(b,
d,g)):this.dm(d,a)}}a=this.rq(d);g=this.rq(e);for(m=this.Kg.gc(g);-1!=m;m=this.Kg.bb(m))this.a.lb(this.Kg.da(m),this.Yg,d);this.Kg.Qv(a,g);this.aM(e)};g.prototype.YP=function(d,e){var a=this.Uf(d,0),g=this.Uf(d,1),m=this.Uf(e,0),b=this.Uf(e,1);this.Cd.Qv(this.lh(d),this.lh(e));e==this.fk(a)&&this.dm(a,d);e==this.fk(g)&&this.dm(g,d);this.Os(e);this.Ns(e);a==m&&g==b||g==m&&a==b||(this.zm(a,this.mn),this.zm(m,this.Ck),this.mn.ub(this.Ck)?(a!=m&&this.Tl(a,m),g!=b&&this.Tl(g,b)):(g!=m&&this.Tl(g,m),a!=
b&&this.Tl(a,b)))};g.prototype.Os=function(d){var e=this.Uf(d,1);this.SB(d,this.Uf(d,0));this.SB(d,e)};g.prototype.SB=function(d,e){var a=this.Go(d,e),g=this.ZN(d,e),m=this.fk(e);a!=d?(this.Qp(g,e,a),this.Sp(a,e,g),m==d&&this.dm(e,a)):this.dm(e,-1)};g.prototype.YA=function(d,e,a){var g=this.Cd.gc(d),m=this.Cd.da(g);d=this.se(m);var b=this.se(this.a.X(m));this.a.Tp(m,e,a,!0);for(g=this.Cd.bb(g);-1!=g;g=this.Cd.bb(g)){var m=this.Cd.da(g),h=this.se(m)==d;this.a.Tp(m,e,a,h)}g=e.Io(a,0).Mb();e=e.Io(a,
e.kk(a)-1).oc();this.yG(d,g);this.yG(b,e)};g.prototype.PB=function(d,e,a){var g=this.lh(d),m=this.Uf(d,0),b=this.Uf(d,1),h=this.rr(-1);this.Mg.add(h);this.Nk(h,-3);this.sf.add(h);this.yi(h,m);d=1;for(e=e.kk(a);d<e;d++)a=this.Ul(-1),this.Hj.add(a),this.sf.add(a),this.yi(h,a),h=this.rr(-1),this.Mg.add(h),this.Nk(h,-3),this.sf.add(h),this.yi(h,a);this.yi(h,b);for(g=this.Cd.gc(g);-1!=g;g=this.Cd.bb(g))if(b=this.Cd.da(g),this.se(b)==m){d=0;do 0<d&&(h=this.sf.get(d-1),this.QA(h,b),-1==this.ow(h)&&this.Lp(h,
this.a.gb(b))),h=this.sf.get(d),d+=2,this.RA(h,b),b=this.a.X(b);while(d<this.sf.size)}else{d=this.sf.size-1;do d<this.sf.size-2&&(h=this.sf.get(d+1),this.QA(h,b),0>this.ow(h)&&this.Lp(h,this.a.gb(b))),h=this.sf.get(d),d-=2,this.RA(h,b),b=this.a.X(b);while(0<=d)}this.sf.clear(!1)};g.prototype.se=function(d){return this.a.Ra(d,this.Yg)};g.prototype.UE=function(d,e,g){var m=this.Uf(e,0),b=new a.b;this.zm(m,b);var h=new a.b,c=this.Uf(e,1);this.zm(c,h);var p=g.kk(d),f=g.Io(d,0),u=new a.b;f.ht(u);if(!b.ub(u)){if(!this.og){var l=
b.compare(this.Xg),u=u.compare(this.Xg);0>l*u&&(this.og=!0)}this.lC(m,this.sf);this.Hj.add(m)}!this.og&&1<p&&(l=b.compare(h),f=f.oc(),b.compare(f)!=l||f.compare(h)!=l?this.og=!0:0>f.compare(this.Xg)&&(this.og=!0));f=g.Io(d,p-1);d=f.oc();h.ub(d)||(this.og||(l=h.compare(this.Xg),u=d.compare(this.Xg),0>l*u&&(this.og=!0)),this.lC(c,this.sf),this.Hj.add(c));this.sf.add(e);h=0;for(c=this.sf.size;h<c;h++)d=this.sf.get(h),g=this.Eo(d),a.Fc.Zw(g)&&(this.zc.kd(g,-1),this.Nk(d,-1)),d!=e&&-3!=this.Eo(d)&&(this.Mg.add(d),
this.Nk(d,-3));this.sf.clear(!1)};g.prototype.NK=function(d,e){this.Ld.compare(this.zc,this.zc.da(d),e);this.Ld.Zf&&(this.Ld.lq(),this.dC(d,e))};g.prototype.dC=function(d,e){this.Nm=!0;d=this.zc.da(d);e=this.zc.da(e);var g,m;m=this.Cd.Dm(this.lh(d));var b=this.Cd.Dm(this.lh(e));g=this.a.cc(m);null==g&&(null==this.Vd&&(this.Vd=new a.yb),this.a.Oc(m,this.Vd),g=this.Vd);m=this.a.cc(b);null==m&&(null==this.Kl&&(this.Kl=new a.yb),this.a.Oc(b,this.Kl),m=this.Kl);this.Lj.zn(g);this.Lj.zn(m);this.Lj.Ga(this.ka,
!0)&&(this.og=!0);this.fG(d,e,-1,this.Lj);this.Lj.clear()};g.prototype.VM=function(d,e){this.Nm=!0;e=this.zc.da(e);var g,m=this.Cd.Dm(this.lh(e));g=this.a.cc(m);null==g&&(null==this.Vd&&(this.Vd=new a.yb),this.a.Oc(m,this.Vd),g=this.Vd);m=this.qC(d);this.Lj.zn(g);this.a.Jk(m,this.Zm);this.Lj.Tw(this.ka,this.Zm,!0);this.fG(e,-1,d,this.Lj);this.Lj.clear()};g.prototype.DO=function(){if(0!=this.Mg.size)for(;0!=this.Mg.size;){if(this.Mg.size>Math.max(100,this.a.pd)){this.Mg.clear(!1);this.og=!0;break}var d=
this.Mg.tc();this.Mg.af();this.Nk(d,-1);-1!=this.TO(d)&&this.CO(d);this.Mm=!1}};g.prototype.CO=function(d){var e;this.Mm?(e=this.zc.vs(this.lE,this.iE,d,!0),this.Mm=!1):e=this.zc.PA(d);-1==e?this.YP(this.zc.da(this.zc.tC()),d):(this.Nk(d,e),this.Ld.Zf&&(this.Ld.lq(),this.dC(this.Ld.Cl,e)))};g.prototype.TO=function(d){var e=this.Uf(d,0);d=this.Uf(d,1);this.zm(e,this.mn);this.zm(d,this.Ck);if(a.b.Zb(this.mn,this.Ck)<=this.Tx)return this.og=!0,-1;var g=this.mn.compare(this.Xg),m=this.Ck.compare(this.Xg);
return 0>=g&&0<m?d:0>=m&&0<g?e:-1};g.prototype.HM=function(){var d=new a.ga(0);d.xb(this.a.pd);for(var e=this.a.Gp(),g=e.next();-1!=g;g=e.next())-1!=this.a.Ra(g,this.Yg)&&d.add(g);this.a.Mu(d,d.size);this.IM(d)};g.prototype.IM=function(d){this.Ue.clear();this.Ue.de(d.size);this.Ue.Hn(new b(this.a));var e=new a.b;e.Eh();for(var g=-1,m=new a.b,h=0,c=d.size;h<c;h++){var p=d.get(h);this.a.uc(p,m);m.ub(e)?(p=this.a.Ra(p,this.Yg),this.Tl(g,p)):(g=this.se(p),this.a.uc(p,e),p=this.Ue.qm(p),this.Hr(g,p))}};
g.prototype.JM=function(){var d=new a.ga(0);d.xb(this.a.pd);for(var e=this.Ue.gc(-1);-1!=e;e=this.Ue.bb(e))d.add(this.Ue.da(e));this.Ue.clear();this.a.Mu(d,d.size);for(var e=0,g=d.size;e<g;e++){var m=d.get(e),b=this.se(m),m=this.Ue.qm(m);this.Hr(b,m)}};g.prototype.lC=function(d,e){var g=this.fk(d);if(-1!=g){var m=g;do a.Fc.Zw(this.Eo(m))&&e.add(m),m=this.Go(m,d);while(m!=g)}};g.prototype.yG=function(d,e){for(d=this.Kg.gc(this.rq(d));-1!=d;d=this.Kg.bb(d))this.a.Yi(this.Kg.da(d),e)};g.prototype.fG=
function(d,e,a,g){this.Os(d);-1!=e&&this.Os(e);this.UE(0,d,g);-1!=e&&this.UE(1,e,g);-1!=a&&(g.nf.w(this.mn),this.zm(a,this.Ck),this.Ck.ub(this.mn)||this.Hj.add(a));a=0;for(var m=this.Hj.size;a<m;a++){var b=this.Hj.get(a),h=this.nw(b);-1!=h&&(this.Ue.kd(h,-1),this.Hr(b,-1))}a=this.lh(d);m=-1!=e?this.lh(e):-1;this.YA(a,g,0);-1!=e&&this.YA(m,g,1);this.PB(d,g,0);-1!=e&&this.PB(e,g,1);this.Cd.Fg(a);this.Ns(d);-1!=e&&(this.Cd.Fg(m),this.Ns(e));a=0;for(m=this.Hj.size;a<m;a++)b=this.Hj.get(a),b==this.rp&&
(this.Ht=!0),h=this.nw(b),-1==h&&(h=this.Ue.PA(this.qC(b)),-1==h?(d=this.se(this.Ue.da(this.Ue.tC())),this.Tl(d,b)):this.Hr(b,h));this.Hj.clear(!1)};g.prototype.zm=function(d,e){this.a.SC(this.ow(d),e)};g.prototype.qC=function(d){return this.Kg.Dm(this.rq(d))};g.prototype.Xy=function(){this.Ht=!1;this.rp=-1;null==this.Ld&&(this.zc.Ct=!1,this.Ld=new e(this),this.zc.Qm=this.Ld);var g=new a.ga(0),m=null,b=null,c=0;this.iE=this.lE=-1;this.Mm=!1;for(var p=this.Ue.gc(-1);-1!=p;){c++;this.Mm=!1;var f=this.Ue.da(p);
this.rp=this.se(f);this.a.uc(f,this.Xg);this.Ld.XF(this.Xg.y,this.Xg.x);var l,q=this.fk(this.rp);l=-1==q;if(!l){f=q;do{var n=this.Eo(f);-1==n?(this.Mg.add(f),this.Nk(f,-3)):-3!=n&&g.add(n);f=this.Go(f,this.rp)}while(f!=q)}if(0<g.size){this.Mm=1==g.size&&1==this.Mg.size;l=0;for(q=g.size;l<q;l++)f=this.zc.da(g.get(l)),this.Nk(f,-2);var z=-2,k=-2;l=0;for(q=g.size;l<q;l++){n=g.get(l);if(-2==z){var t=this.zc.ge(n);-1!=t?(f=this.zc.da(t),f=this.Eo(f),-2!=f&&(z=t)):z=-1}-2==k&&(n=this.zc.bb(n),-1!=n?(f=
this.zc.da(n),f=this.Eo(f),-2!=f&&(k=n)):k=-1);if(-2!=z&&-2!=k)break}l=0;for(q=g.size;l<q;l++)n=g.get(l),f=this.zc.da(n),this.zc.kd(n,-1),this.Nk(f,-1);g.clear(!1);this.lE=-1!=z?z:-1;this.iE=-1!=k?k:-1;-1!=z&&-1!=k?this.Mm||this.NK(z,k):-1==z&&-1==k&&(this.Mm=!1)}else l&&(null==m&&(m=new d(this)),m.bh(this.Xg),this.zc.sF(m),m.Zf&&(m.lq(),this.VM(this.rp,m.Cl)));this.DO();this.Ht?(this.Ht=!1,null==b&&(b=new h(this.a)),b.bh(this.Xg),p=this.Ue.sF(b)):p=this.Ue.bb(p)}return this.Nm};g.prototype.Op=function(d){this.a=
d;this.Yg=this.a.re();this.$a.de(d.pd+32);this.nd.de(d.pd);this.Kg.Dr(d.pd);this.Kg.$l(d.pd);this.Cd.Dr(d.pd+32);this.Cd.$l(d.pd+32);for(d=this.a.$c;-1!=d;d=this.a.we(d))if(a.T.Kc(this.a.Lb(d)))for(p=this.a.Vb(d);-1!=p;p=this.a.bc(p)){var e=this.a.Ha(p),g=this.a.Cb(p),m=this.Ul(g),b=this.rr(g);this.yi(b,m);f=this.a.X(g);g=0;for(e-=2;g<e;g++){var h=this.a.X(f),c=this.Ul(f);this.yi(b,c);b=this.rr(f);this.yi(b,c);f=h}this.a.vc(p)?(c=this.Ul(f),this.yi(b,c),b=this.rr(f),this.yi(b,c),this.yi(b,m)):(c=
this.Ul(f),this.yi(b,c))}else for(var p=this.a.Vb(d);-1!=p;p=this.a.bc(p))for(var f=this.a.Cb(p),m=0,e=this.a.Ha(p);m<e;m++)this.Ul(f),f=this.a.X(f);this.HM()};return g}();a.aA=g})(A||(A={}));(function(a){var b=function(b){function e(d,e,m){b.call(this);if(void 0!==d)if(void 0!==m){this.description=a.Od.Tf();var g=new a.ee;g.K(d,e,m);this.Py(g)}else if(void 0!==e)this.description=a.Od.Tf(),this.ic(d,e);else if(d instanceof a.pa)this.description=d;else if(d instanceof a.b)this.description=a.Od.Tf(),
this.ic(d);else throw a.g.N();else this.description=a.Od.Tf()}z(e,b);e.prototype.w=function(d){if(void 0!==d){if(this.sc())throw a.g.ra("This operation should not be performed on an empty geometry.");d.ma(this.fa[0],this.fa[1])}else{if(this.sc())throw a.g.ra("This operation should not be performed on an empty geometry.");d=new a.b;d.ma(this.fa[0],this.fa[1]);return d}};e.prototype.ic=function(d,e){"number"===typeof d?(this.qc(),null==this.fa&&this.ko(),this.fa[0]=d,this.fa[1]=e):(this.qc(),this.ic(d.x,
d.y))};e.prototype.Lw=function(){if(this.sc())throw a.g.ra("This operation should not be performed on an empty geometry.");var d=new a.ee;d.x=this.fa[0];d.y=this.fa[1];this.description.WC()?d.z=this.fa[2]:d.z=a.pa.ue(1);return d};e.prototype.Py=function(d){this.qc();var e=this.hasAttribute(1);e||a.pa.nD(1,d.z)||(this.Ne(1),e=!0);null==this.fa&&this.ko();this.fa[0]=d.x;this.fa[1]=d.y;e&&(this.fa[2]=d.z)};e.prototype.lk=function(){if(this.sc())throw a.g.ra("This operation should not be performed on an empty geometry.");
return this.fa[0]};e.prototype.qS=function(d){this.setAttribute(0,0,d)};e.prototype.mk=function(){if(this.sc())throw a.g.ra("This operation should not be performed on an empty geometry.");return this.fa[1]};e.prototype.$F=function(d){this.setAttribute(0,1,d)};e.prototype.lO=function(){return this.ld(1,0)};e.prototype.rS=function(d){this.setAttribute(1,0,d)};e.prototype.NN=function(){return this.ld(2,0)};e.prototype.bS=function(d){this.setAttribute(2,0,d)};e.prototype.Qc=function(){return this.nC(3,
0)};e.prototype.ld=function(d,e){var g=this.description.zf(d);return 0<=g?this.fa[this.description.fj(g)+e]:a.pa.ue(d)};e.prototype.nC=function(d,e){var g=this.description.zf(d);return 0<=g?this.fa[this.description.fj(g)+e]:a.pa.ue(d)};e.prototype.setAttribute=function(d,e,a){this.qc();var g=this.description.zf(d);0>g&&(this.Ne(d),g=this.description.zf(d));null==this.fa&&this.ko();this.fa[this.description.fj(g)+e]=a};e.prototype.D=function(){return 33};e.prototype.fb=function(){return 0};e.prototype.Ja=
function(){this.qc();null!=this.fa&&(this.fa[0]=NaN,this.fa[1]=NaN)};e.prototype.nm=function(d){if(null!=this.fa){for(var e=a.Od.iu(d,this.description),m=[],b=0,h=0,c=d.Aa;h<c;h++){var p=d.Hd(h),f=a.pa.Wa(p);if(-1==e[h])for(var l=a.pa.ue(p),p=0;p<f;p++)m[b]=l,b++;else for(l=this.description.fj(e[h]),p=0;p<f;p++)m[b]=this.fa[l],b++,l++}this.fa=m}this.description=d};e.prototype.ko=function(){this.iF(this.description.le.length);e.ob(this.description.le,this.fa,this.description.le.length);this.fa[0]=
NaN;this.fa[1]=NaN};e.prototype.Oe=function(d){if(d instanceof a.Bg){if(!this.sc()){var e=this.w();d.Zi(e,e);this.ic(e)}}else this.sc()||(this.Ne(1),e=this.Lw(),this.Py(d.Qn(e)))};e.prototype.copyTo=function(d){if(33!=d.D())throw a.g.N();d.qc();null==this.fa?(d.Ja(),d.fa=null,d.Qf(this.description)):(d.Qf(this.description),d.iF(this.description.le.length),e.ob(this.fa,d.fa,this.description.le.length))};e.prototype.Pa=function(){return new e(this.description)};e.prototype.s=function(){return this.sc()};
e.prototype.sc=function(){return null==this.fa||isNaN(this.fa[0])||isNaN(this.fa[1])};e.prototype.Fp=function(d){d.Ja();this.description!=d.description&&d.Qf(this.description);d.Db(this)};e.prototype.o=function(d){this.sc()?d.Ja():(d.v=this.fa[0],d.C=this.fa[1],d.B=this.fa[0],d.G=this.fa[1])};e.prototype.Cn=function(d){if(this.sc())d.Ja();else{var e=this.Lw();d.v=e.x;d.C=e.y;d.Je=e.z;d.B=e.x;d.G=e.y;d.ig=e.z}};e.prototype.Ah=function(d,e){var g=new a.Nd;if(this.sc())return g.Ja(),g;d=this.ld(d,e);
g.qa=d;g.va=d;return g};e.prototype.iF=function(d){if(null==this.fa)this.fa=a.I.Lh(d);else if(this.fa.length<d){for(var e=this.fa.slice(0),m=this.fa.length;m<d;m++)e[m]=0;this.fa=e}};e.ob=function(d,e,a){if(0<a)for(a=0;a<d.length;a++)e[a]=d[a]};e.prototype.lc=function(d){if(d==this)return!0;if(!(d instanceof e)||this.description!=d.description)return!1;if(this.sc())return d.sc()?!0:!1;for(var a=0,m=this.description.le.length;a<m;a++)if(this.fa[a]!=d.fa[a])return!1;return!0};e.prototype.hc=function(){var d=
this.description.hc();if(!this.sc())for(var e=0,m=this.description.le.length;e<m;e++)var b=this.fa[e],b=a.I.truncate(b^b>>>32),d=a.I.kg(b,d);return d};e.prototype.Rf=function(){return null};return e}(a.T);a.Va=b})(A||(A={}));(function(a){var b=function(){function a(e,d,a){void 0!==e&&(this.x=e,this.y=d,this.z=a)}a.Oa=function(e,d,g){var m=new a;m.x=e;m.y=d;m.z=g;return m};a.prototype.K=function(e,d,a){this.x=e;this.y=d;this.z=a};a.prototype.Lu=function(){this.z=this.y=this.x=0};a.prototype.normalize=
function(){var e=this.length();0==e&&(this.x/=e,this.y/=e,this.z/=e)};a.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)};a.prototype.sub=function(e){return new a(this.x-e.x,this.y-e.y,this.z-e.z)};a.prototype.Ap=function(e){return new a(this.x*e,this.y*e,this.z*e)};a.prototype.FA=function(){this.x=NaN};a.prototype.pv=function(){return isNaN(this.x)};return a}();a.ee=b})(A||(A={}));(function(a){var b=function(){function b(e,d,a){this.gu=this.Yt=null;this.Gf=
d;this.KP=d.y-a;this.JP=d.y+a;this.xp=0;this.ix=e;this.ka=a;this.UP=a*a;this.jx=0!=a;this.xt=!1}b.prototype.result=function(){return 0!=this.xp?1:0};b.prototype.DJ=function(e){e=e.Kb(e.Gd(this.Gf,!1));return a.b.Zb(e,this.Gf)<=this.UP?!0:!1};b.prototype.WB=function(e){if(!this.jx&&(this.ix&&this.Gf.ub(e.Mb())||this.Gf.ub(e.oc())))this.xt=!0;else if(e.ja==this.Gf.y&&e.ja==e.ha){if(this.ix&&!this.jx){var d=Math.max(e.na,e.la);this.Gf.x>Math.min(e.na,e.la)&&this.Gf.x<d&&(this.xt=!0)}}else{var a=!1,d=
Math.max(e.na,e.la);this.Gf.x>d?a=!0:this.Gf.x>=Math.min(e.na,e.la)&&(a=0<e.nt(!0,this.Gf.y,this.gu,null)&&this.gu[0]<=this.Gf.x);if(a){if(this.Gf.y==e.Mb().y){if(this.Gf.y<e.oc().y)return}else if(this.Gf.y==e.oc().y&&this.Gf.y<e.Mb().y)return;this.xp=this.ix?this.xp^1:this.xp+(e.Mb().y>e.oc().y?1:-1)}}};b.prototype.zr=function(e){var d=e.Ah(0,1);if(d.qa>this.JP||d.va<this.KP)return!1;if(this.jx&&this.DJ(e))return!0;if(d.qa>this.Gf.y||d.va<this.Gf.y)return!1;null==this.Yt&&(this.Yt=[null,null,null,
null,null]);null==this.gu&&(this.gu=[0,0,0]);d=e.TC(this.Yt);if(0<d)for(e=0;e<d;e++){var a=this.Yt[e].get();this.WB(a);if(this.xt)return!0}else if(this.WB(e),this.xt)return!0;return!1};b.V=function(e,d,a){d=new b(0==e.Cm(),d,a);for(e=e.Ca();e.kb();)for(;e.La();)if(a=e.ia(),d.zr(a))return-1;return d.result()};b.Bd=function(e,d,g,m){var h=new a.i;e.dd(h);h.P(m,m);var c=new b(0==e.Cm(),g,m);e=e.Ca();var p=new a.i;p.K(h);p.B=g.x+m;p.C=g.y-m;p.G=g.y+m;g=d.xw(p,m);for(m=g.next();-1!=m;m=g.next())if(e.Sb(d.da(m)),
e.La()&&(m=e.ia(),c.zr(m)))return-1;return c.result()};b.xl=function(e,d,g){if(e.s())return 0;var m=new a.i;e.dd(m);m.P(g,g);if(!m.contains(d))return 0;m=e.pb;if(null!=m){var h=m.hi;if(null!=h){h=h.Kk(d.x,d.y);if(1==h)return 1;if(0==h)return 0}m=m.Ab;if(null!=m)return b.Bd(e,m,d,g)}return b.V(e,d,g)};b.aP=function(e,d,g,m){if(e.s())return 0;var h=new a.i;e.dd(h);h.P(m,m);if(!h.contains(d,g))return 0;h=e.pb;if(null!=h&&(h=h.hi,null!=h)){h=h.Kk(d,g);if(1==h)return 1;if(0==h)return 0}return b.V(e,a.b.Oa(d,
g),m)};b.$O=function(e,d,a){return d.s()?0:b.xl(e,d.w(),a)};b.vD=function(e,d,g,m,h){var c=new a.i;e.dd(c);c.P(m,m);if(!c.contains(g))return 0;var p=new b(!0,g,m);if(null!=h){var f=new a.i;f.K(c);f.B=g.x+m;f.C=g.y-m;f.G=g.y+m;e=e.Ca();m=h.xw(f,m);for(f=m.next();-1!=f;f=m.next())if(e.Sb(h.da(f),d),e.La()&&e.Qa==d&&(f=e.ia(),p.zr(f)))return-1}else if(e=e.Ca(),e.vy(d),e.kb())for(;e.La();)if(f=e.ia(),p.zr(f))return-1;return p.result()};b.tD=function(e,d,g){var m=new a.i;e.dd(m);m.P(g,g);if(!m.contains(d))return 0;
d=new b(!1,d,g);for(g=e.Ca();g.kb();)if(!(0>e.oo(g.Qa))){for(d.xp=0;g.La();)if(m=g.ia(),d.zr(m))return-1;if(0!=d.xp)return 1}return d.result()};b.$i=function(e,d,g,m,h){var c=e.Ca();c.vy(d);if(!c.kb()||!c.La())throw a.g.ra("corrupted geometry");for(d=2;2==d&&c.La();)d=c.ia().Kb(.5),d=b.vD(e,g,d,m,h);if(2==d)throw a.g.ra("internal error");return 1==d?!0:!1};b.An=function(e,d){e=e.F();return 16>e?!1:2*e+Math.log(e)/Math.log(2)*1*d<1*e*d};return b}();a.ff=b})(A||(A={}));(function(a){var b=function(a){function e(d){a.call(this,
!0,d)}z(e,a);e.prototype.Pa=function(){return new e(this.description)};e.prototype.fb=function(){return 2};e.prototype.D=function(){return 1736};return e}(a.al);a.Ka=b})(A||(A={}));(function(a){(function(a){a[a.PiPOutside=0]="PiPOutside";a[a.PiPInside=1]="PiPInside";a[a.PiPBoundary=2]="PiPBoundary"})(a.pI||(a.pI={}));var b=function(){function b(){}b.uD=function(e,d,g){e=a.ff.$O(e,d,g);return 0==e?0:1==e?1:2};b.he=function(e,d,g){e=a.ff.xl(e,d,g);return 0==e?0:1==e?1:2};b.CH=function(e,d,g,m){e=a.ff.aP(e,
d,g,m);return 0==e?0:1==e?1:2};b.gU=function(e,d,g,m){return 0==a.ff.vD(e,d,g,m,null)?0:1};b.tD=function(e,d,g){return 0==a.ff.tD(e,d,g)?0:1};b.ZS=function(e,d,g,m,h){if(d.length<g||h.length<g)throw a.g.N();for(var c=0;c<g;c++)h[c]=b.he(e,d[c],m)};b.eT=function(e,d,g,m,h){if(d.length/2<g||h.length<g)throw a.g.N();for(var c=0;c<g;c++)h[c]=b.CH(e,d[2*c],d[2*c+1],m)};b.nG=function(e,d,g,m,h){if(1736==e.D())b.ZS(e,d,g,m,h);else if(197==e.D()){var c=new a.i;e.o(c);b.jP(c,d,g,m,h)}else throw a.g.ra("invalid_call");
};b.nU=function(e,d,g,m,h){if(1736==e.D())b.eT(e,d,g,m,h);else if(197==e.D()){var c=new a.i;e.o(c);b.mP(c,d,g,m,h)}else throw a.g.xa();};b.jP=function(e,d,g,m,b){if(d.length<g||b.length<g)throw a.g.N();if(e.s())for(m=0;m<g;m++)b[m]=0;else for(e.P(.5*-m,.5*-m),e.P(.5*m,.5*m),m=0;m<g;m++)e.contains(d[m])?b[m]=1:e.contains(d[m])?b[m]=2:b[m]=0};b.mP=function(e,d,g,m,b){if(d.length/2<g||b.length<g)throw a.g.N();if(e.s())for(m=0;m<g;m++)b[m]=0;else for(e.P(.5*-m,.5*-m),e.P(.5*m,.5*m),m=0;m<g;m++)e.contains(d[2*
m],d[2*m+1])?b[m]=1:e.contains(d[2*m],d[2*m+1])?b[m]=2:b[m]=0};b.lT=function(e,d,a,m,b){for(var g=0;g<a;g++)b[g]=e.Eq(d[g],m)?2:0};b.hT=function(e,d,a,m,b){var g=e.pb,h=null;null!=g&&(h=g.hi);for(var g=a,c=0;c<a;c++)if(b[c]=1,null!=h){var p=d[c];0==h.Kk(p.x,p.y)&&(b[c]=0,g--)}if(0!=g)for(e=e.Ca();e.kb()&&0!=g;)for(;e.La()&&0!=g;)for(h=e.ia(),c=0;c<a&&0!=g;c++)1==b[c]&&h.Eq(d[c],m)&&(b[c]=2,g--);for(c=0;c<a;c++)1==b[c]&&(b[c]=0)};b.oG=function(e,d,g,m,h){var c=e.D();if(1607==c)b.hT(e,d,g,m,h);else if(a.T.Lc(c))b.lT(e,
d,g,m,h);else throw a.g.ra("Invalid call.");};return b}();a.gd=b})(A||(A={}));(function(a){var b=function(a){function e(d,e){2==arguments.length?(a.call(this,!1,d.description),this.df(d),this.lineTo(e)):a.call(this,!1,d)}z(e,a);e.prototype.Pa=function(){return new e(this.description)};e.prototype.fb=function(){return 1};e.prototype.D=function(){return 1607};return e}(a.al);a.Xa=b})(A||(A={}));(function(a){var b=function(){function a(){}a.GT=function(){};return a}();a.RT=b})(A||(A={}));(function(a){var b=
function(){function e(){}e.Rv=function(d){return d*e.rQ};e.aG=function(d,a){return e.cR(a-d)};e.kR=function(d){if(-360<=d&&720>d)return 0>d?d+=360:360<=d&&(d-=360),d;d=a.vi.gH(d);0>d&&(d+=360);return d};e.cR=function(d){d=e.kR(d);180<d&&(d-=360);return d};e.OT=.0174532925199433;e.rQ=57.29577951308232;return e}(),h=function(){function e(){}e.qo=function(d,e){var g=new a.i;d.o(g);var b=a.Ya.Fm(e),h=new a.i;h.K(b);h.v=g.v;h.B=g.B;h.P(.01*h.ba(),0);b=a.Ia.zd(e,g,!1);return h.contains(g)?d:a.Ed.clip(d,
h,b,0)};e.Rw=function(d,g,m,b){if(!a.Ya.Qo(g))throw a.g.N();var h=a.Ia.Cg(g,d,!1),c=a.Ya.Fm(g),p=a.Ya.Em(g),f=p.Se().Dj,u=a.Ya.ft(p),p=a.Ya.Ts(p),u=u*(2-u),l=new a.Nd;c.wu(l);var q=[[0,0],[0,0]];2==a.Nf.Am(g)?(q[0][0]=e.pu(b,l),q[0][1]=c.Vs(),a.Ya.tu(),c=q[0][0]*f):c=b*f;var n=new a.ca,z=new a.fd;d=z.Eb(d);for(var k=[0],t=new a.b,v=new a.b,A=new a.b,w=new a.b,y=new a.b,D=new a.b,B=z.Vb(d);-1!=B;B=z.bc(B)){var F=z.Cb(B);z.w(F,A);for(var J=!1,G=F=z.X(F);-1!=G;G=z.X(G)){if(G==F){if(J)break;J=!0}z.w(G,
w);if((h<b-A.x&&w.x-b>h||h<b-w.x&&A.x-b>h||h<-w.y&&A.y>h)&&!(Math.abs(A.x-w.x)>=.5*l.aa())&&(2==a.Nf.Am(g)?(q[0][0]=e.pu(A.x,l),q[0][1]=A.y,q[1][0]=e.pu(w.x,l),q[1][1]=w.y,a.Ya.YQ(),y.x=q[0][0]*f,y.y=q[0][1]*f,D.x=q[1][0]*f,D.y=q[1][1]*f):(y.x=A.x*f,y.y=A.y*f,D.x=w.x*f,D.y=w.y*f),D.x=6.283185307179586*(w.x-A.x)/l.aa()+y.x,v.x=c,v.y=e.yH(p,u,y,D,c,m),!isNaN(v.y))){a.zb.Rd(p,u,y.x,y.y,D.x,D.y,n,null,null,m);var I=n.l;a.zb.Rd(p,u,y.x,y.y,v.x,v.y,n,null,null,m);var r=n.l;2==a.Nf.Am(g)?(q[0][0]=v.x/f,
q[0][1]=v.y/f,a.Ya.qN(),t.y=q[0][1],t.x=b):(t.x=b,t.y=v.y/f);k[0]=0<I?a.I.Kr(r/I,0,1):.5;0!=k[0]&&1!=k[0]&&(I=z.Ua(G),z.Mr(I,k,1),z.ic(z.X(I),t.x,t.y))}A.J(w)}}return z.hf(d)};e.aN=function(d,g,m){if(d.s())return d;var b=a.Ya.IC(g);return e.gC(d,0-180*b,360*b,g,m)};e.yH=function(d,g,m,b,h,c){if(3.141592653589793<=Math.abs(m.x-b.x)||!e.Jv(m.x,b.x,h))return NaN;var p;m.x>b.x?p=b:(p=m,m=b);b=new a.ca(0);var f=new a.ca(0),u=new a.ca(0);a.zb.Rd(d,g,p.x,p.y,m.x,m.y,f,b,null,c);var l=f.l,q=0,n=1,C=new a.b;
for(C.J(p);l*(n-q)>1E-12*d;){var z=.5*(q+n);a.zb.dk(d,g,p.x,p.y,l*z,b.l,f,u,c);C.x=f.l;C.y=u.l;if(C.x==h)break;if(e.Jv(p.x,C.x,h))n=z;else if(e.Jv(m.x,C.x,h))q=z;else return NaN}return C.y};e.Jv=function(d,e,a){d=b.Rv(d);e=b.aG(d,b.Rv(e));a=b.aG(d,b.Rv(a));return 0==a||0<e&&0<a&&a<=e||0>e&&0>a&&a>=e?!0:!1};e.pu=function(d,e){var a=e.va-e.qa;return e.Sy(d-Math.floor((d-e.qa)/a)*a)};e.eU=function(d,e,m,b){var g=new a.Nd;g.K(e,m);m=b.aa();d=Math.floor((d-e)/m)*m+d;for(g=g.Af();Math.abs(d-g)>Math.abs(d+
m-g);)d+=m;return d};e.cU=function(d,e,m,b,h){var g;m.y>b.y?g=b:(g=m,m=b);b=new a.Nd;b.K(g.y,m.y);if(!b.contains(0)||3.141592653589793<=Math.abs(g.x-m.x))return NaN;if(g.x==m.x)return g.x;var c=new a.ca(0),p=new a.ca(0),f=new a.ca(0);a.zb.Rd(d,e,g.x,g.y,m.x,m.y,p,c,null,h);var u=p.l,l=0,q=1,n=new a.b;for(n.J(g);u*(q-l)>1E-12*d;){var C=.5*(l+q);a.zb.dk(d,e,g.x,g.y,u*C,c.l,p,f,h);n.x=p.l;n.y=f.l;b.K(g.y,n.y);if(0==n.y)break;if(b.contains(0))q=C;else if(b.K(m.y,n.y),b.contains(0))l=C;else return NaN}return n.x};
e.gC=function(d,e,m,b,h){var g=new a.i;d.o(g);if(g.s())return d;var c=new a.Nd;g.wu(c);var p=new a.Nd;p.K(e,e+m);if(p.contains(c)&&p.va!=c.va)return d;var f=new a.i;f.K(g);var u=d.D();if(33==u){f=h?d:d.vm();g=f.lk();if(g<p.qa||g>=p.va||g==p.va)g+=Math.ceil((p.qa-g)/m)*m,g=p.Sy(g),f.qS(g);return f}if(550==u){f=h?d:d.vm();b=f.mc(0);u=2*f.F();d=!1;for(h=0;h<u;h+=2)if(g=b.read(h),g<p.qa||g>=p.va||g==p.va)d=!0,g+=Math.ceil((p.qa-g)/m)*m,g=p.Sy(g),b.write(h,g);d&&f.ce(1993);return f}if(p.contains(c))return d;
if(197==u)return m=h?d:d.vm(),g.Ga(f),m.Cu(g),m;var l=.1*Math.max(g.ba(),g.aa());f.P(0,l);p=d;d=b.Ko();h=a.wi.local();for(var q=new a.Bg,n=0;;){var C=Math.floor((c.qa-e)/m),z=Math.ceil((c.va-e)/m);if(3<z-C){C=Math.floor(.5*(z+C));f.v=g.v-l;f.B=e+m*C;var k=a.Ed.clip(p,f,d,0);f.v=f.B;f.B=g.B+l;var t=a.Ed.clip(p,f,d,0);q.Nn((C-z)*m,0);t.Oe(q);1736==u?p=h.$(k,t,b,null):(p=k,p.add(t,!1));p.o(g);g.wu(c);n++}else break}f.v=e;f.B=e+m;e=new a.i;e.K(f);e.P(d,0);e=Math.floor((g.v-f.v)/m)*m;0!=e?(f.move(e,0),
q.Nn(-e,0)):q.IF();e=1607==u?new a.Xa(p.description):new a.Ka(p.description);c=new a.i;for(l=new a.i;g.B>f.v;){n=a.Ed.clip(p,f,d,0);n.o(l);if(1607==u?!n.s()&&(l.aa()>d||l.ba()>d):!n.s()&&(1736!=u||l.aa()>d))n.Oe(q),n.o(l),e.o(c),c.P(d,d),c.jc(l)&&1736==u?e=h.$(e,n,b,null):e.add(n,!1);f.move(m,0);q.shift(-m,0)}return e};e.ZQ=function(d,e,m,b){var g=new a.pe(m.description);g.Pd(m,0,-1);var g=a.Ya.Wl(g,d,e),h=m.F();b.Ja();if(!a.Ya.Qo(d)||h!=g.F())return!1;var c=new a.i;m.o(c);var p=new a.i;g.o(p);c=
c.aa();p=p.aa();if(0!=c&&0!=p){if(p/=c,d=a.Ya.Fm(e).aa()/a.Ya.Fm(d).aa(),1E-10<Math.abs(p/d-1))return!1}else if(0!=c||0!=p)return!1;b.add(m,!1);for(m=0;m<h;m++)d=g.Fa(m),b.ic(m,d);return!0};e.dU=function(){throw a.g.qe();};return e}();a.gh=h})(A||(A={}));(function(a){(function(a){a[a.rightSide=1]="rightSide"})(a.sI||(a.sI={}));var b=function(){function b(e,d,g){this.Nq=new a.b;void 0===e?this.tn=-1:(this.Nq.J(e),this.tn=d,this.Da=g,this.Ut=0)}b.prototype.UF=function(e){this.Ut=e?this.Ut|1:this.Ut&
-2};b.prototype.s=function(){return 0>this.tn};b.prototype.pw=function(){if(this.s())throw a.g.ra("invalid call");return new a.Va(this.Nq.x,this.Nq.y)};b.prototype.gb=function(){if(this.s())throw a.g.ra("invalid call");return this.tn};b.prototype.sw=function(){if(this.s())throw a.g.ra("invalid call");return this.Da};b.prototype.Xw=function(){return 0!=(this.Ut&1)};b.prototype.tv=function(e,d,a,m){this.Nq.x=e;this.Nq.y=d;this.tn=a;this.Da=m};return b}();a.dl=b})(A||(A={}));(function(a){var b=function(){function e(){}
e.prototype.Fn=function(d,e){this.Vg.resize(0);this.ai.length=0;this.Aj=-1;d.dd(this.Kj);this.Kj.P(e,e);this.Kj.jc(this.Ab.Qb)?((this.Iq=a.T.Lc(d.D()))?(this.rE=d.Mb(),this.qE=d.oc(),this.ka=e):this.ka=NaN,this.Vg.add(this.Ab.Ze),this.ai.push(this.Ab.Qb),this.ar=this.Ab.sq(this.Ab.Ze)):this.ar=-1};e.prototype.Ch=function(d,e){this.Vg.resize(0);this.ai.length=0;this.Aj=-1;this.Kj.K(d);this.Kj.P(e,e);this.ka=NaN;this.Kj.jc(this.Ab.Qb)?(this.Vg.add(this.Ab.Ze),this.ai.push(this.Ab.Qb),this.ar=this.Ab.sq(this.Ab.Ze),
this.Iq=!1):this.ar=-1};e.prototype.next=function(){if(0==this.Vg.size)return-1;this.Aj=this.ar;var d=null,e=null,m,b=null,c=null;this.Iq&&(d=new a.b,e=new a.b,b=new a.i);for(var p=!1;!p;){for(;-1!=this.Aj;){m=this.Ab.kw(this.Ab.Us(this.Aj));if(m.jc(this.Kj))if(this.Iq){if(d.J(this.rE),e.J(this.qE),b.K(m),b.P(this.ka,this.ka),0<b.Nv(d,e)){p=!0;break}}else{p=!0;break}this.Aj=this.Ab.at(this.Aj)}if(-1==this.Aj){m=this.Vg.tc();var f=this.ai[this.ai.length-1];null==c&&(c=[],c[0]=new a.i,c[1]=new a.i,
c[2]=new a.i,c[3]=new a.i);h.BF(f,c);this.Vg.af();--this.ai.length;for(f=0;4>f;f++){var l=this.Ab.zo(m,f);if(-1!=l&&0<this.Ab.gO(l)&&c[f].jc(this.Kj))if(this.Iq){if(d.J(this.rE),e.J(this.qE),b.K(c[f]),b.P(this.ka,this.ka),0<b.Nv(d,e)){var q=new a.i;q.K(c[f]);this.Vg.add(l);this.ai.push(q)}}else q=new a.i,q.K(c[f]),this.Vg.add(l),this.ai.push(q)}if(0==this.Vg.size)return-1;this.Aj=this.Ab.sq(this.Vg.get(this.Vg.size-1))}}this.ar=this.Ab.at(this.Aj);return this.Aj};e.HL=function(d,g,m){var b=new e;
b.Ab=d;b.Kj=new a.i;b.Vg=new a.ga(0);b.ai=[];b.Fn(g,m);return b};e.GL=function(d,g,m){var b=new e;b.Ab=d;b.Kj=new a.i;b.Vg=new a.ga(0);b.ai=[];b.Ch(g,m);return b};e.FL=function(d){var g=new e;g.Ab=d;g.Kj=new a.i;g.Vg=new a.ga(0);g.ai=[];return g};return e}();a.TT=b;var h=function(){function e(d,e){this.Ye=new a.Fc(11);this.qh=new a.Fc(5);this.Jq=[];this.Rt=new a.ga(0);this.Qb=new a.i;this.Rj(d,e)}e.prototype.reset=function(d,e){this.Ye.Nh(!1);this.qh.Nh(!1);this.Jq.length=0;this.Rt.clear(!1);this.Rj(d,
e)};e.prototype.lg=function(d,e){return this.lt(d,e,0,this.Qb,this.Ze,!1,-1)};e.prototype.kt=function(d,e,a){a=-1==a?this.Ze:this.KC(a);var g=this.ba(a),m=this.CN(a);return this.lt(d,e,g,m,a,!1,-1)};e.prototype.da=function(d){return this.yN(d)};e.prototype.uC=function(d){return this.kw(this.Us(d))};e.prototype.ba=function(d){return this.Xs(d)};e.prototype.CN=function(d){var e=new a.i;e.K(this.Qb);var m=this.Xs(d);d=this.EC(d);for(var b=0;b<2*m;b+=2){var h=a.I.truncate(3&d>>b);0==h?(e.v=.5*(e.v+e.B),
e.C=.5*(e.C+e.G)):1==h?(e.B=.5*(e.v+e.B),e.C=.5*(e.C+e.G)):(2==h?e.B=.5*(e.v+e.B):e.v=.5*(e.v+e.B),e.G=.5*(e.C+e.G))}return e};e.prototype.gO=function(d){return this.Kw(d)};e.prototype.KN=function(d,e){return b.HL(this,d,e)};e.prototype.xw=function(d,e){return b.GL(this,d,e)};e.prototype.Re=function(){return b.FL(this)};e.prototype.Rj=function(d,e){if(0>e||32<2*e)throw a.g.N("invalid height");this.GP=e;this.Qb.K(d);this.Ze=this.Ye.be();this.Ku(this.Ze,0);this.Eu(this.Ze,0);this.LF(this.Ze,0);this.HF(this.Ze,
0)};e.prototype.lt=function(d,g,m,b,h,c,p){if(!b.contains(g))return 0==m?-1:this.lt(d,g,0,this.Qb,this.Ze,c,p);if(!c)for(var f=h;-1!=f;f=this.UN(f))this.Ku(f,this.Kw(f)+1);f=new a.i;f.K(b);b=h;var u=[];u[0]=new a.i;u[1]=new a.i;u[2]=new a.i;for(u[3]=new a.i;m<this.GP&&this.IK(b);m++){e.BF(f,u);for(var l=!1,q=0;4>q;q++)if(u[q].contains(g)){var l=!0,n=this.zo(b,q);-1==n&&(n=this.OL(b,q));this.Ku(n,this.Kw(n)+1);b=n;f.K(u[q]);break}if(!l)break}return this.zO(d,g,m,f,b,c,h,p)};e.prototype.zO=function(d,
e,a,b,h,c,p,f){var g=this.AC(h);if(c){if(h==p)return f;this.mM(f);c=f}else c=this.QL(),this.By(c,d),this.IR(this.Us(c),e);this.gS(c,h);-1!=g?(this.Ju(c,g),this.Fu(g,c)):this.DF(h,c);this.Fy(h,c);this.Eu(h,this.Zs(h)+1);this.HK(h)&&this.$M(a,b,h);return c};e.prototype.mM=function(d){var e=this.KC(d),a=this.AC(e),b=this.$N(d),h=this.at(d);this.sq(e)==d?(-1!=h?this.Ju(h,-1):this.Fy(e,-1),this.DF(e,h)):a==d?(this.Fu(b,-1),this.Fy(e,b)):(this.Ju(h,b),this.Fu(b,h));this.Ju(d,-1);this.Fu(d,-1);this.Eu(e,
this.Zs(e)-1)};e.BF=function(d,e){var a=.5*(d.v+d.B),g=.5*(d.C+d.G);e[0].K(a,g,d.B,d.G);e[1].K(d.v,g,a,d.G);e[2].K(d.v,d.C,a,g);e[3].K(a,d.C,d.B,g)};e.prototype.HK=function(d){return 8==this.Zs(d)&&!this.VC(d)};e.prototype.$M=function(d,e,a){var g,b,m=this.sq(a);do b=this.Us(m),g=this.qh.O(m,0),b=this.kw(b),this.lt(g,b,d,e,a,!0,m),m=g=this.at(m);while(-1!=m)};e.prototype.IK=function(d){return 8<=this.Zs(d)||this.VC(d)};e.prototype.VC=function(d){return-1!=this.zo(d,0)||-1!=this.zo(d,1)||-1!=this.zo(d,
2)||-1!=this.zo(d,3)};e.prototype.OL=function(d,e){var a=this.Ye.be();this.MR(d,e,a);this.Ku(a,0);this.Eu(a,0);this.Tj(a,d);this.HF(a,this.Xs(d)+1);this.LF(a,e<<2*this.Xs(d)|this.EC(d));return a};e.prototype.QL=function(){var d=this.qh.be(),e;0<this.Rt.size?(e=this.Rt.tc(),this.Rt.af()):(e=this.Jq.length,this.Jq.push(new a.i));this.JR(d,e);return d};e.prototype.zo=function(d,e){return this.Ye.O(d,e)};e.prototype.MR=function(d,e,a){this.Ye.L(d,e,a)};e.prototype.sq=function(d){return this.Ye.O(d,4)};
e.prototype.DF=function(d,e){this.Ye.L(d,4,e)};e.prototype.AC=function(d){return this.Ye.O(d,5)};e.prototype.Fy=function(d,e){this.Ye.L(d,5,e)};e.prototype.EC=function(d){return this.Ye.O(d,6)};e.prototype.LF=function(d,e){this.Ye.L(d,6,e)};e.prototype.Zs=function(d){return this.Ye.O(d,7)};e.prototype.Kw=function(d){return this.Ye.O(d,8)};e.prototype.Eu=function(d,e){this.Ye.L(d,7,e)};e.prototype.Ku=function(d,e){this.Ye.L(d,8,e)};e.prototype.UN=function(d){return this.Ye.O(d,9)};e.prototype.Tj=function(d,
e){this.Ye.L(d,9,e)};e.prototype.Xs=function(d){return this.Ye.O(d,10)};e.prototype.HF=function(d,e){this.Ye.L(d,10,e)};e.prototype.yN=function(d){return this.qh.O(d,0)};e.prototype.By=function(d,e){this.qh.L(d,0,e)};e.prototype.$N=function(d){return this.qh.O(d,1)};e.prototype.at=function(d){return this.qh.O(d,2)};e.prototype.Ju=function(d,e){this.qh.L(d,1,e)};e.prototype.Fu=function(d,e){this.qh.L(d,2,e)};e.prototype.KC=function(d){return this.qh.O(d,3)};e.prototype.gS=function(d,e){this.qh.L(d,
3,e)};e.prototype.Us=function(d){return this.qh.O(d,4)};e.prototype.JR=function(d,e){this.qh.L(d,4,e)};e.prototype.kw=function(d){return this.Jq[d]};e.prototype.IR=function(d,e){this.Jq[d].K(e)};return e}();a.co=h})(A||(A={}));(function(a){(function(e){e[e.Outside=0]="Outside";e[e.Inside=1]="Inside";e[e.Border=2]="Border"})(a.wH||(a.wH={}));var b=function(){function e(d,e){this.Hg=null;this.SP=e;this.Hg=d}e.prototype.Bu=function(d,e){this.PD!=e&&d.flush();this.PD=e};e.prototype.XB=function(d,e){for(var a=
0;a<e;)for(var g=d[a++],b=d[a++],h=d[a++]*this.SP;g<b;g++)this.Hg[h+(g>>4)]|=this.PD<<2*(g&15)};return e}();a.VT=b;var h=function(){function e(d,e,a){this.Hg=null;this.Qx=this.Sx=this.zE=this.xE=this.Qq=this.VD=this.tf=this.Pl=0;this.ii=this.Nj=this.sk=null;this.jt(d,e,a)}e.create=function(d,g,b){if(!e.Cc(d))throw a.g.N();return e.Id(d,g,b)};e.ti=function(d,g,b){if(!e.Cc(d))throw a.g.N();return e.ye(d,g,b)};e.jR=function(d){switch(d){case 0:d=1024;break;case 1:d=16384;break;case 2:d=262144;break;
default:throw a.g.ra("Internal Error");}return d};e.Cc=function(d){return d.s()||1607!=d.D()&&1736!=d.D()?!1:!0};e.prototype.KM=function(d,e){e=e.Ca();for(var g=new a.b,b=new a.b;e.kb();)for(;e.La();){var h=e.ia();if(322!=h.D())throw a.g.ra("Internal Error");d.Zi(h.Mb(),g);d.Zi(h.oc(),b);this.ii.zv(g.x,g.y,b.x,b.y)}this.ii.fF(a.ev.$u)};e.prototype.LM=function(){throw a.g.ra("Internal Error");};e.prototype.cw=function(d,e){for(var g=1;4>g;g++)d.zv(e[g-1].x,e[g-1].y,e[g].x,e[g].y);d.zv(e[3].x,e[3].y,
e[0].x,e[0].y);this.ii.fF(a.ev.$u)};e.prototype.kG=function(d,e,b){for(var g=[null,null,null,null],m=0;m<g.length;m++)g[m]=new a.b;e=e.Ca();b=this.Nj.TS(b)+1.5;for(var m=new a.b,h=new a.b,c=new a.b,p=new a.b,f=new a.b,l=new a.i,q=new a.b;e.kb();){var n=!1,z=!0;for(q.ma(0,0);e.La();){var k=e.ia();p.x=k.na;p.y=k.ja;f.x=k.la;f.y=k.ha;l.Ja();l.Db(p.x,p.y);l.Oj(f.x,f.y);if(this.sk.rD(l)){this.Nj.Zi(f,f);z?(this.Nj.Zi(p,p),q.J(p),z=!1):p.J(q);m.pc(f,p);var k=m.length(),t=.5>k;0==k?m.ma(1,0):(t||q.J(f),
m.scale(b/k),h.ma(-m.y,m.x),c.ma(m.y,-m.x),p.sub(m),f.add(m),g[0].add(p,h),g[1].add(p,c),g[2].add(f,c),g[3].add(f,h),t?n=!0:this.cw(d,g))}else n&&(this.cw(d,g),n=!1),z=!0}n&&this.cw(d,g)}};e.prototype.fz=function(d){return a.I.truncate(d*this.VD+this.xE)};e.prototype.gz=function(d){return a.I.truncate(d*this.Qq+this.zE)};e.Id=function(d,a,b){return new e(d,a,b)};e.ye=function(d,a,b){return new e(d,a,b)};e.prototype.jt=function(d,e,m){this.tf=Math.max(a.I.truncate(2*Math.sqrt(m)+.5),64);this.Pl=a.I.truncate((2*
this.tf+31)/32);this.sk=new a.i;this.Sx=e;m=0;for(var g=this.tf,h=this.Pl;8<=g;)m+=g*h,g=a.I.truncate(g/2),h=a.I.truncate((2*g+31)/32);this.Hg=a.I.Lh(m,0);this.ii=new a.ev;m=new b(this.Hg,this.Pl,this);this.ii.vS(this.tf,this.tf,m);d.o(this.sk);this.sk.P(e,e);var g=new a.i,h=a.i.Oa(1,1,this.tf-2,this.tf-2),c=e*h.aa();e*=h.ba();g.K(this.sk.Af(),Math.max(c,this.sk.aa()),Math.max(e,this.sk.ba()));this.Qx=this.Sx;this.Nj=new a.Bg;this.Nj.wO(g,h);new a.Bg;switch(d.D()){case 550:m.Bu(this.ii,2);this.LM();
break;case 1607:m.Bu(this.ii,2);this.kG(this.ii,d,this.Qx);break;case 1736:m.Bu(this.ii,1),this.KM(this.Nj,d),m.Bu(this.ii,2),this.kG(this.ii,d,this.Qx)}this.VD=this.Nj.mb;this.Qq=this.Nj.eb;this.xE=this.Nj.Nb;this.zE=this.Nj.Ob;this.BK()};e.prototype.BK=function(){this.ii.flush();for(var d=0,e=this.tf*this.Pl,b=this.tf,h=a.I.truncate(this.tf/2),c=this.Pl,p=a.I.truncate((2*h+31)/32);8<b;){for(b=0;b<h;b++)for(var f=2*b,l=2*b+1,q=0;q<h;q++){var n=2*q,z=2*q+1,k=n>>4,n=2*(n&15),t=z>>4,z=2*(z&15),v=this.Hg[d+
c*f+k]>>n&3,v=v|this.Hg[d+c*f+t]>>z&3,v=v|this.Hg[d+c*l+k]>>n&3,v=v|this.Hg[d+c*l+t]>>z&3;this.Hg[e+p*b+(q>>4)]|=v<<2*(q&15)}b=h;c=p;d=e;h=a.I.truncate(b/2);p=a.I.truncate((2*h+31)/32);e=d+c*b}};e.prototype.Kk=function(d,e){if(!this.sk.contains(d,e))return 0;d=this.fz(d);e=this.gz(e);if(0>d||d>=this.tf||0>e||e>=this.tf)return 0;d=this.Hg[this.Pl*e+(d>>4)]>>2*(d&15)&3;return 0==d?0:1==d?1:2};e.prototype.Dn=function(d){if(!d.Ga(this.sk))return 0;var e=this.fz(d.v),b=this.fz(d.B),h=this.gz(d.C);d=this.gz(d.G);
0>e&&(e=0);0>h&&(h=0);b>=this.tf&&(b=this.tf-1);d>=this.tf&&(d=this.tf-1);if(e>b||h>d)return 0;for(var c=Math.max(b-e,1)*Math.max(d-h,1),p=0,f=this.Pl,l=this.tf,q=0;;){if(32>c||16>l){for(c=h;c<=d;c++)for(var n=e;n<=b;n++)if(q=this.Hg[p+f*c+(n>>4)]>>2*(n&15)&3,1<q)return 2;if(0==q)return 0;if(1==q)return 1}p+=f*l;l=a.I.truncate(l/2);f=a.I.truncate((2*l+31)/32);e=a.I.truncate(e/2);h=a.I.truncate(h/2);b=a.I.truncate(b/2);d=a.I.truncate(d/2);c=Math.max(b-e,1)*Math.max(d-h,1)}};e.prototype.cO=function(){return this.tf*
this.Pl};return e}();a.dA=h})(A||(A={}));(function(a){(function(e){e[e.contains=1]="contains";e[e.within=2]="within";e[e.equals=3]="equals";e[e.disjoint=4]="disjoint";e[e.touches=8]="touches";e[e.crosses=16]="crosses";e[e.overlaps=32]="overlaps";e[e.unknown=0]="unknown";e[e.intersects=1073741824]="intersects"})(a.zI||(a.zI={}));var b=function(){function e(){}e.Oa=function(d,a,b,h,c,p,f,l){var g=new e;g.Wt=d;g.Jl=a;g.Oi=b;g.ji=h;g.dE=c;g.tU=p;g.uU=f;g.vU=l;return g};return e}(),h=function(){function e(){}
e.vT=function(d,g,b){if(!e.pQ(d))return!1;var m=a.Ia.Cg(g,d,!1);g=!1;a.Wj.vB(d)&&(g=g||d.jv(m,b));m=d.D();1736!=m&&1607!=m||!a.Wj.tB(d)||0==b||(g=g||d.dj(b));1736!=m&&1607!=m||!a.Wj.uB(d)||0==b||(g=g||d.jJ());return g};e.pQ=function(d){return a.Wj.vB(d)||a.Wj.tB(d)||a.Wj.uB(d)};return e}();a.rT=h;h=function(){function e(){this.Tg=[]}e.qy=function(d,g,b,h,c){var m=d.D(),p=g.D();if(197==m){if(197==p)return e.AQ(d,g,b,h);if(33==p)return 2==h?h=1:1==h&&(h=2),e.Iz(g,d,b,h)}else if(33==m){if(197==p)return e.Iz(d,
g,b,h);if(33==p)return e.eR(d,g,b,h)}if(d.s()||g.s())return 4==h?!0:!1;var f=new a.i;d.o(f);var l=new a.i;g.o(l);var u=new a.i;u.K(f);u.Db(l);b=a.Ia.zd(b,u,!1);if(e.nj(f,l,b))return 4==h?!0:!1;f=!1;a.al.Lc(m)&&(m=new a.Xa(d.description),m.Bc(d,!0),d=m,m=1607);a.al.Lc(p)&&(p=new a.Xa(g.description),p.Bc(g,!0),g=p,p=1607);if(197!=m&&197!=p){if(d.fb()<g.fb()||33==m&&550==p)2==h?h=1:1==h&&(h=2)}else 1736!=m&&197!=p&&(2==h?h=1:1==h&&(h=2));switch(m){case 1736:switch(p){case 1736:f=e.vr(d,g,b,h,c);break;
case 1607:f=e.Vl(d,g,b,h,c);break;case 33:f=e.ur(d,g,b,h,c);break;case 550:f=e.tr(d,g,b,h,c);break;case 197:f=e.xD(d,g,b,h,c)}break;case 1607:switch(p){case 1736:f=e.Vl(g,d,b,h,c);break;case 1607:f=e.ey(d,g,b,h,c);break;case 33:f=e.xr(d,g,b,h,c);break;case 550:f=e.wr(d,g,b,h,c);break;case 197:f=e.WE(d,g,b,h)}break;case 33:switch(p){case 1736:f=e.ur(g,d,b,h,c);break;case 1607:f=e.xr(g,d,b,h,c);break;case 550:f=e.pr(g,d,b,h,c)}break;case 550:switch(p){case 1736:f=e.tr(g,d,b,h,c);break;case 1607:f=e.wr(g,
d,b,h,c);break;case 550:f=e.Wx(d,g,b,h,c);break;case 33:f=e.pr(d,g,b,h,c);break;case 197:f=e.oA(d,g,b,h)}break;case 197:switch(p){case 1736:f=e.xD(g,d,b,h,c);break;case 1607:f=e.WE(g,d,b,h);break;case 550:f=e.oA(g,d,b,h)}}return f};e.AQ=function(d,g,b,h){if(d.s()||g.s())return 4==h?!0:!1;var m=new a.i,c=new a.i,p=new a.i;d.o(m);g.o(c);p.K(m);p.Db(c);d=a.Ia.zd(b,p,!1);switch(h){case 4:return e.nj(m,c,d);case 2:return e.Bz(c,m,d);case 1:return e.Bz(m,c,d);case 3:return e.ye(m,c,d);case 8:return e.kT(m,
c,d);case 32:return e.fT(m,c,d);case 16:return e.cT(m,c,d)}return!1};e.Iz=function(d,g,b,h){if(d.s()||g.s())return 4==h?!0:!1;d=d.w();var m=new a.i,c=new a.i;g.o(m);c.K(d);c.Db(m);g=a.Ia.zd(b,c,!1);switch(h){case 4:return e.ru(d,m,g);case 2:return e.bx(d,m,g);case 1:return e.YL(d,m,g);case 3:return e.KA(d,m,g);case 8:return e.ax(d,m,g)}return!1};e.eR=function(d,g,b,h){if(d.s()||g.s())return 4==h?!0:!1;d=d.w();g=g.w();var m=new a.i;m.K(d);m.Db(g);b=a.Ia.zd(b,m,!1);switch(h){case 4:return e.rM(d,g,
b);case 2:return e.hz(g,d,b);case 1:return e.hz(d,g,b);case 3:return e.dB(d,g,b)}return!1};e.vr=function(d,a,b,h,c){switch(h){case 4:return e.dT(d,a,b);case 2:return e.su(a,d,b,c);case 1:return e.su(d,a,b,c);case 3:return e.TG(d,a,b);case 8:return e.vH(d,a,b);case 32:return e.bH(d,a,b,c)}return!1};e.Vl=function(d,a,b,h,c){switch(h){case 4:return e.gT(d,a,b);case 1:return e.dy(d,a,b,c);case 8:return e.zH(d,a,b,c);case 16:return e.lR(d,a,b)}return!1};e.ur=function(d,a,b,h){switch(h){case 4:return e.YS(d,
a,b);case 1:return e.qQ(d,a,b);case 8:return e.lH(d,a,b)}return!1};e.tr=function(d,a,b,h){switch(h){case 4:return e.OS(d,a,b);case 1:return e.hQ(d,a,b);case 8:return e.iH(d,a,b);case 16:return e.dR(d,a,b)}return!1};e.xD=function(d,a,b,h,c){if(e.ER(d,a,b))return 4==h?!0:!1;if(4==h)return!1;switch(h){case 2:return e.DH(d,a,b);case 1:return e.WP(d,a,b);case 3:return e.OG(d,a,b);case 8:return e.eH(d,a,b,c);case 32:return e.WG(d,a,b,c);case 16:return e.zQ(d,a,b,c)}return!1};e.ey=function(d,a,b,h){switch(h){case 4:return e.EI(d,
a,b);case 2:return e.JE(a,d,b);case 1:return e.JE(d,a,b);case 3:return e.QI(d,a,b);case 8:return e.cF(d,a,b);case 32:return e.$I(d,a,b);case 16:return e.LE(d,a,b)}return!1};e.xr=function(d,a,b,h){switch(h){case 4:return e.yI(d,a,b);case 1:return e.KH(d,a,b);case 8:return e.MG(d,a,b)}return!1};e.wr=function(d,a,b,h){switch(h){case 4:return e.vI(d,a,b);case 1:return e.IH(d,a,b);case 8:return e.fJ(d,a,b);case 16:return e.QH(d,a,b)}return!1};e.WE=function(d,a,b,h){if(e.nI(d,a,b))return 4==h?!0:!1;if(4==
h)return!1;switch(h){case 2:return e.WJ(d,a,b);case 1:return e.GH(d,a,b);case 3:return e.MI(d,a,b);case 8:return e.cJ(d,a,b);case 32:return e.XI(d,a,b);case 16:return e.MH(d,a,b)}return!1};e.Wx=function(d,a,b,h){switch(h){case 4:return e.xI(d,a,b);case 2:return e.kA(a,d,b);case 1:return e.kA(d,a,b);case 3:return e.LI(d,a,b);case 32:return e.bJ(d,a,b)}return!1};e.pr=function(d,a,b,h){switch(h){case 4:return e.lA(d,a,b);case 2:return e.HJ(d,a,b);case 1:return e.PH(d,a,b);case 3:return e.mu(d,a,b)}return!1};
e.oA=function(d,a,b,h){switch(h){case 4:return e.uI(d,a,b);case 2:return e.LG(d,a,b);case 1:return e.LH(d,a,b);case 3:return e.DI(d,a,b);case 8:return e.eJ(d,a,b);case 16:return e.mI(d,a,b)}return!1};e.TG=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(!e.ye(m,h,b))return!1;m=e.fc(d,g,!1);if(4==m||1==m||2==m)return!1;if(e.jA(d,g,b))return!0;m=d.$b();h=g.$b();return Math.abs(m-h)>4*Math.max(d.F(),g.F())*b?!1:e.Vv(d,g,b,!0)};e.dT=function(d,a,b){var g=e.fc(d,a,!0);return 4==g?!0:1==g||2==g||
1073741824==g?!1:e.ZC(d,a,b)};e.vH=function(d,a,b){var g=e.fc(d,a,!1);return 4==g||1==g||2==g?!1:e.AE(d,a,b,null)};e.bH=function(d,a,b,h){var g=e.fc(d,a,!1);return 4==g||1==g||2==g?!1:e.wD(d,a,b,h)};e.su=function(d,g,b,h){var m=new a.i,c=new a.i;d.o(m);g.o(c);if(!e.rc(m,c,b))return!1;m=e.fc(d,g,!1);return 4==m||2==m?!1:1==m?!0:e.bC(d,g,b,h)};e.gT=function(d,a,b){var g=e.fc(d,a,!0);return 4==g?!0:1==g||1073741824==g?!1:e.ZC(d,a,b)};e.zH=function(d,a,b,h){var g=e.fc(d,a,!1);return 4==g||1==g?!1:e.CE(d,
a,b,h)};e.lR=function(d,a,b){var g=e.fc(d,a,!1);return 4==g||1==g?!1:e.YC(d,a,b,null)};e.dy=function(d,g,b,h){var m=new a.i,c=new a.i;d.o(m);g.o(c);if(!e.rc(m,c,b))return!1;m=e.fc(d,g,!1);return 4==m?!1:1==m?!0:e.jC(d,g,b,h)};e.YS=function(d,e,b){return 0==a.gd.uD(d,e,b)?!0:!1};e.lH=function(d,a,b){a=a.w();return e.yD(d,a,b)};e.qQ=function(d,a,b){a=a.w();return e.YB(d,a,b)};e.OS=function(d,g,b){var m=e.fc(d,g,!1);if(4==m)return!0;if(1==m)return!1;m=new a.i;d.o(m);m.P(b,b);for(var h=new a.b,c=0;c<
g.F();c++)if(g.w(c,h),m.contains(h)){var p=a.gd.he(d,h,b);if(1==p||2==p)return!1}return!0};e.iH=function(d,e,b){var g=this.fc(d,e,!1);if(4==g||1==g)return!1;g=new a.i;d.o(g);g.P(b,b);var m,h=!1,c;c=d;for(var p=!1,f=0;f<e.F();f++){m=e.Fa(f);if(g.contains(m))if(m=a.gd.he(c,m,b),2==m)h=!0;else if(1==m)return!1;p||(!a.ff.An(d,e.F()-1)||null!=d.pb&&null!=d.pb.Ab?c=d:(c=new a.Ka,d.copyTo(c),c.dj(1)),p=!0)}return h?!0:!1};e.dR=function(d,e,b){var g=this.fc(d,e,!1);if(4==g||1==g)return!1;var m=new a.i,g=
new a.i,h=new a.i;d.o(m);e.o(h);g.K(m);g.P(b,b);var h=m=!1,c,p;p=d;for(var f=!1,l=0;l<e.F();l++){c=e.Fa(l);g.contains(c)?(c=a.gd.he(p,c,b),0==c?h=!0:1==c&&(m=!0)):h=!0;if(m&&h)return!0;f||(!a.ff.An(d,e.F()-1)||null!=d.pb&&null!=d.pb.Ab?p=d:(p=new a.Ka,d.copyTo(p),p.dj(1)),f=!0)}return!1};e.hQ=function(d,e,b){var g=new a.i,m=new a.i;d.o(g);e.o(m);if(!this.rc(g,m,b))return!1;m=this.fc(d,e,!1);if(4==m)return!1;if(1==m)return!0;var m=!1,h,c;c=d;for(var p=!1,f=0;f<e.F();f++){h=e.Fa(f);if(!g.contains(h))return!1;
h=a.gd.he(c,h,b);if(1==h)m=!0;else if(0==h)return!1;p||(!a.ff.An(d,e.F()-1)||null!=d.pb&&null!=d.pb.Ab?c=d:(c=new a.Ka,d.copyTo(c),c.dj(1)),p=!0)}return m};e.OG=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(!e.ye(m,h,b))return!1;m=new a.Ka;m.Wc(g,!1);return e.Vv(d,m,b,!0)};e.ER=function(d,g,b){var m=e.fc(d,g,!1);if(4==m)return!0;if(1==m||2==m)return!1;var h=new a.i,m=new a.i;d.o(h);g.o(m);if(e.rc(m,h,b))return!1;h=new a.b;m.Yl(h);g=a.gd.he(d,h,b);if(0!=g)return!1;m.YE(h);g=a.gd.he(d,h,
b);if(0!=g)return!1;m.Zl(h);g=a.gd.he(d,h,b);if(0!=g)return!1;m.aF(h);g=a.gd.he(d,h,b);if(0!=g)return!1;g=d.mc(0);h=new a.i;h.K(m);h.P(b,b);for(var c=0,p=d.F();c<p;c++){var f=g.read(2*c),l=g.read(2*c+1);if(h.contains(f,l))return!1}return!e.cA(d,m,b)};e.eH=function(d,g,b,h){var m=e.fc(d,g,!1);if(4==m||1==m||2==m)return!1;var m=new a.i,c=new a.i;d.o(m);g.o(c);if(e.rc(c,m,b))return!1;if(c.aa()<=b&&c.ba()<=b)return g=g.qq(),e.yD(d,g,b);if(c.aa()<=b||c.ba()<=b)return m=new a.Xa,c=new a.Va,g.uf(0,c),m.df(c),
g.uf(2,c),m.lineTo(c),e.CE(d,m,b,h);m=new a.Ka;m.Wc(g,!1);return e.AE(d,m,b,h)};e.WG=function(d,g,b,h){var m=e.fc(d,g,!1);if(4==m||1==m||2==m)return!1;var m=new a.i,c=new a.i;d.o(m);g.o(c);if(e.rc(c,m,b)||c.aa()<=b||c.ba()<=b)return!1;m=new a.Ka;m.Wc(g,!1);return e.wD(d,m,b,h)};e.DH=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.rc(h,m,b)};e.WP=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(!e.rc(m,h,b))return!1;m=e.fc(d,g,!1);if(4==m||2==m)return!1;if(1==m)return!0;if(h.aa()<=
b&&h.ba()<=b)return g=g.qq(),e.YB(d,g,b);if(h.aa()<=b||h.ba()<=b)return h=new a.Xa,m=new a.Va,g.uf(0,m),h.df(m),g.uf(2,m),h.lineTo(m),e.jC(d,h,b,null);h=new a.Ka;h.Wc(g,!1);return e.bC(d,h,b,null)};e.zQ=function(d,g,b,h){var m=new a.i,c=new a.i;d.o(m);g.o(c);if(e.rc(c,m,b)||c.ba()>b&&c.aa()>b||c.ba()<=b&&c.aa()<=b)return!1;m=new a.Xa;c=new a.Va;g.uf(0,c);m.df(c);g.uf(2,c);m.lineTo(c);return e.YC(d,m,b,h)};e.QI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.ye(m,h,b)&&4!=e.fc(d,g,!1)?
e.jA(d,g,b)?!0:e.Vv(d,g,b,!1):!1};e.EI=function(d,e,b){return 4==this.fc(d,e,!1)?!0:(new a.cl(d,e,b,!0)).next()?!this.ED(d,e,b):!1};e.cF=function(d,g,b){if(4==e.fc(d,g,!1))return!1;var m=new a.qd(0);if(0!=e.Zv(d,g,b,m))return!1;for(var h=new a.pe,c=0;c<m.size;c+=2){var p=m.read(c),f=m.read(c+1);h.zs(p,f)}d=d.Rf();g=g.Rf();d.Pd(g,0,g.F());return e.lu(d,h,b)};e.LE=function(d,g,b){if(4==e.fc(d,g,!1))return!1;var m=new a.qd(0);if(0!=e.Zv(d,g,b,m))return!1;for(var h=new a.pe,c=0;c<m.size;c+=2){var p=m.read(c),
f=m.read(c+1);h.zs(p,f)}d=d.Rf();g=g.Rf();d.Pd(g,0,g.F());return!e.lu(d,h,b)};e.$I=function(d,a,b){return 4==e.fc(d,a,!1)?!1:e.iA(d,a,b)};e.JE=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.rc(m,h,b)&&4!=e.fc(d,g,!1)?e.Wf(g,d,b,!1):!1};e.yI=function(d,a,b){if(4==e.fc(d,a,!1))return!0;a=a.w();return!e.ex(d,a,b)};e.MG=function(d,a,b){if(4==e.fc(d,a,!1))return!1;a=a.w();return e.bw(d,a,b)};e.KH=function(d,a,b){if(4==e.fc(d,a,!1))return!1;a=a.w();return e.bA(d,a,b)};e.vI=function(d,a,
b){return 4==e.fc(d,a,!1)?!0:!e.eA(d,a,b,!1)};e.fJ=function(d,e,b){if(4==this.fc(d,e,!1))return!1;var g=d.Ca(),m=new a.i,h=new a.i,c=new a.i;d.o(m);e.o(h);m.P(b,b);h.P(b,b);c.K(m);c.Ga(h);var p,f,m=null;p=d.pb;null!=p?(f=p.Ab,m=p.nn,null==f&&(f=p=a.Ia.ij(d,c))):f=p=a.Ia.ij(d,c);var l=f.Re(),q=null;null!=m&&(q=m.Re());var n=new a.b,z=new a.b,k=!1,t=b*b,m=new a.Wk(e.F());for(p=0;p<e.F();p++)m.write(p,0);for(p=0;p<e.F();p++)if(e.w(p,n),c.contains(n))if(h.K(n.x,n.y,n.x,n.y),null==q||(q.Ch(h,b),-1!=q.next())){l.Ch(h,
b);for(var v=l.next();-1!=v;v=l.next())if(g.Sb(f.da(v)),v=g.ia(),v.Kb(v.Gd(n,!1),z),a.b.Zb(n,z)<=t){m.write(p,1);k=!0;break}}if(!k)return!1;d=d.Rf();g=new a.pe;h=new a.b;for(p=0;p<e.F();p++)0!=m.read(p)&&(e.w(p,h),g.zs(h.x,h.y));return this.lu(d,g,b)};e.QH=function(d,e,b){if(4==this.fc(d,e,!1))return!1;var g=d.Ca(),m=new a.i,h=new a.i,c=new a.i;d.o(m);e.o(h);m.P(b,b);h.P(b,b);c.K(m);c.Ga(h);var p,f,m=null;p=d.pb;null!=p?(f=p.Ab,m=p.nn,null==f&&(f=p=a.Ia.ij(d,c))):f=p=a.Ia.ij(d,c);var l=f.Re(),q=null;
null!=m&&(q=m.Re());var n=new a.b,z=new a.b,k=!1,t=!1,v=b*b,m=new a.Wk(e.F());for(p=0;p<e.F();p++)m.write(p,0);for(p=0;p<e.F();p++)if(e.w(p,n),c.contains(n))if(h.K(n.x,n.y,n.x,n.y),null!=q&&(q.Ch(h,b),-1==q.next()))t=!0;else{l.Ch(h,b);for(var A=!1,w=l.next();-1!=w;w=l.next())if(g.Sb(f.da(w)),w=g.ia(),w.Kb(w.Gd(n,!1),z),a.b.Zb(n,z)<=v){m.write(p,1);A=k=!0;break}A||(t=!0)}else t=!0;if(!k||!t)return!1;d=d.Rf();g=new a.pe;h=new a.b;for(p=0;p<e.F();p++)0!=m.read(p)&&(e.w(p,h),g.zs(h.x,h.y));return!this.lu(d,
g,b)};e.IH=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(!e.rc(m,h,b)||4==e.fc(d,g,!1)||!e.eA(d,g,b,!0))return!1;d=d.Rf();return!e.nA(d,g,b)};e.MI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return h.ba()>b&&h.aa()>b?!1:e.ye(m,h,b)};e.nI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.rc(h,m,b)?!1:!e.cA(d,h,b)};e.cJ=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(h.ba()<=b&&h.aa()<=b)return h=g.qq(),e.bw(d,h,b);if(h.ba()<=b||h.aa()<=b)return h=new a.Xa,
m=new a.Va,g.uf(0,m),h.df(m),g.uf(2,m),h.lineTo(m),e.cF(d,h,b);d=d.Ca();g=new a.i;m=new a.i;g.K(h);m.K(h);g.P(-b,-b);m.P(b,b);for(var h=!1,c=new a.i,p=new a.i;d.kb();)for(;d.La();){d.ia().o(c);p.K(g);p.Ga(c);if(!p.s()&&(p.ba()>b||p.aa()>b))return!1;p.K(m);p.Ga(c);p.s()||(h=!0)}return h};e.XI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(e.rc(m,h,b)||e.rc(h,m,b)||e.rc(h,m,b)||h.ba()>b&&h.aa()>b||h.ba()<=b&&h.aa()<=b)return!1;m=new a.Xa;h=new a.Va;g.uf(0,h);m.df(h);g.uf(2,h);m.lineTo(h);
return e.iA(d,m,b)};e.WJ=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(!e.rc(h,m,b)||h.ba()<=b&&h.aa()<=b)return!1;if(h.ba()<=b||h.aa()<=b)return e.rc(h,m,b);d=d.Ca();g=new a.i;g.K(h);g.P(-b,-b);for(var h=!1,m=new a.i,c=new a.i;d.kb();)for(;d.La();)d.ia().o(m),g.jl(m)?h=!0:(c.K(g),c.Ga(m),!c.s()&&(c.ba()>b||c.aa()>b)&&(h=!0));return h};e.GH=function(d,g,b){var m=new a.i,h=new a.i;g.o(h);d.o(m);if(!e.rc(m,h,b)||h.ba()>b&&h.aa()>b)return!1;if(h.ba()<=b&&h.aa()<=b)return g=g.qq(),e.bA(d,g,
b);m=new a.Xa;h=new a.Va;g.uf(0,h);m.df(h);g.uf(2,h);m.lineTo(h);return e.Wf(m,d,b,!1)};e.MH=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(e.rc(h,m,b)||h.ba()<=b&&h.aa()<=b)return!1;if(h.ba()<=b||h.aa()<=b)return m=new a.Xa,h=new a.Va,g.uf(0,h),m.df(h),g.uf(2,h),m.lineTo(h),e.LE(d,m,b);d=d.Ca();g=new a.i;m=new a.i;m.K(h);g.K(h);m.P(-b,-b);g.P(b,b);for(var c=h=!1,p=new a.i,f=new a.i;d.kb();)for(;d.La();)if(d.ia().o(p),c||g.contains(p)||(c=!0),h||(f.K(m),f.Ga(p),!f.s()&&(f.ba()>b||f.aa()>
b)&&(h=!0)),h&&c)return!0;return!1};e.LI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.ye(m,h,b)?e.OI(d,g,b)?!0:e.Pw(d,g,b,!1,!0,!1):!1};e.xI=function(d,a,b){return!e.nA(d,a,b)};e.bJ=function(d,a,b){return e.Pw(d,a,b,!1,!1,!0)};e.kA=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.rc(m,h,b)?e.Pw(g,d,b,!0,!1,!1):!1};e.lu=function(d,e,b){b*=b;for(var g=new a.b,m=new a.b,h=0;h<e.F();h++){e.w(h,m);for(var c=!1,p=0;p<d.F();p++)if(d.w(p,g),a.b.Zb(g,m)<=b){c=!0;break}if(!c)return!1}return!0};
e.mu=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return e.ye(m,h,b)};e.lA=function(d,a,b){a=a.w();return e.or(d,a,b)};e.HJ=function(d,a,b){return e.mu(d,a,b)};e.PH=function(d,a,b){return!e.lA(d,a,b)};e.DI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);return h.ba()>b||h.aa()>b?!1:e.ye(m,h,b)};e.uI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(e.rc(h,m,b))return!1;g=new a.i;g.K(h);g.P(b,b);b=new a.b;for(h=0;h<d.F();h++)if(d.w(h,b),g.contains(b))return!1;return!0};e.eJ=function(d,
e,b){var g=new a.i,m=new a.i,h=new a.i;e.o(g);if(g.ba()<=b&&g.aa()<=b)return!1;if(g.ba()<=b||g.aa()<=b){e=new a.b;var c=!1;m.K(g);h.K(g);m.P(b,b);g.ba()>b?h.P(0,-b):h.P(-b,0);for(var p=0;p<d.F();p++)if(d.w(p,e),m.contains(e)){if(g.ba()>b){if(e.y>h.C&&e.y<h.G)return!1}else if(e.x>h.v&&e.x<h.B)return!1;c=!0}return c}m.K(g);h.K(g);m.P(b,b);h.P(-b,-b);e=new a.b;c=!1;for(p=0;p<d.F();p++)if(d.w(p,e),m.contains(e)){if(h.jl(e))return!1;c=!0}return c};e.LG=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);
if(!e.rc(h,m,b))return!1;if(h.ba()<=b&&h.aa()<=b)return e.ye(m,h,b);if(h.ba()<=b||h.aa()<=b){g=!1;var m=new a.i,c=new a.i;m.K(h);c.K(h);h.ba()>b?m.P(0,-b):m.P(-b,0);c.P(b,b);for(var p=new a.b,f=0;f<d.F();f++){d.w(f,p);if(!c.contains(p))return!1;h.ba()>b?p.y>m.C&&p.y<m.G&&(g=!0):p.x>m.v&&p.x<m.B&&(g=!0)}return g}g=!1;m=new a.i;c=new a.i;m.K(h);c.K(h);m.P(-b,-b);c.P(b,b);p=new a.b;for(f=0;f<d.F();f++){d.w(f,p);if(!c.contains(p))return!1;m.jl(p)&&(g=!0)}return g};e.LH=function(d,g,b){var m=new a.i,h=
new a.i;d.o(m);g.o(h);if(!e.rc(m,h,b)||h.ba()>b||h.aa()>b)return!1;g=g.qq();return!e.or(d,g,b)};e.mI=function(d,g,b){var m=new a.i,h=new a.i;d.o(m);g.o(h);if(e.rc(h,m,b)||h.ba()<=b&&h.aa()<=b)return!1;if(h.ba()<=b||h.aa()<=b){g=new a.i;m=new a.i;g.K(h);h.ba()>b?g.P(0,-b):g.P(-b,0);m.K(h);m.P(b,b);for(var c=new a.b,p=!1,f=!1,l=0;l<d.F();l++)if(d.w(l,c),p||(h.ba()>b?c.y>g.C&&c.y<g.G&&(p=!0):c.x>g.v&&c.x<g.B&&(p=!0)),f||m.contains(c)||(f=!0),p&&f)return!0;return!1}g=new a.i;m=new a.i;g.K(h);g.P(-b,-b);
m.K(h);m.P(b,b);c=new a.b;f=p=!1;for(l=0;l<d.F();l++)if(d.w(l,c),!p&&g.jl(c)&&(p=!0),f||m.contains(c)||(f=!0),p&&f)return!0;return!1};e.dB=function(d,e,b){return a.b.Zb(d,e)<=b*b?!0:!1};e.rM=function(d,e,b){return a.b.Zb(d,e)>b*b?!0:!1};e.hz=function(d,a,b){return e.dB(d,a,b)};e.KA=function(d,g,b){var m=new a.i;m.K(d);return e.ye(m,g,b)};e.ru=function(d,e,b){var g=new a.i;g.K(e);g.P(b,b);return!g.contains(d)};e.ax=function(d,e,b){if(e.ba()<=b&&e.aa()<=b)return!1;var g=new a.i,m=new a.i;g.K(e);g.P(b,
b);if(!g.contains(d))return!1;if(e.ba()<=b||e.aa()<=b){m.K(e);e.ba()>b?m.P(0,-b):m.P(-b,0);if(e.ba()>b){if(d.y>m.C&&d.y<m.G)return!1}else if(d.x>m.v&&d.x<m.B)return!1;return!0}m.K(e);m.P(-b,-b);return m.jl(d)?!1:!0};e.bx=function(d,e,b){if(e.ba()<=b&&e.aa()<=b)return!0;if(e.ba()<=b||e.aa()<=b){var g=new a.i;g.K(e);e.ba()>b?g.P(0,-b):g.P(-b,0);var m=!1;e.ba()>b?d.y>g.C&&d.y<g.G&&(m=!0):d.x>g.v&&d.x<g.B&&(m=!0);return m}g=new a.i;g.K(e);g.P(-b,-b);return g.jl(d)};e.YL=function(d,a,b){return e.KA(d,
a,b)};e.ye=function(d,a,b){return e.rc(d,a,b)&&e.rc(a,d,b)};e.nj=function(d,e,b){var g=new a.i;g.K(e);g.P(b,b);return!d.jc(g)};e.kT=function(d,g,b){if(d.ba()<=b&&d.aa()<=b){var m=d.Af();return e.ax(m,g,b)}if(g.ba()<=b&&g.aa()<=b)return m=g.Af(),e.ax(m,d,b);d.ba()>b&&d.aa()>b&&(g.ba()<=b||g.aa()<=b)?m=g:(m=d,d=g);if(m.ba()<=b||m.aa()<=b){if(d.ba()<=b||d.aa()<=b){g=new a.yb;var h=new a.yb,c=[0,0],p=[0,0],f=new a.b;m.Yl(f);g.ed(f);m.Zl(f);g.vd(f);d.Yl(f);h.ed(f);d.Zl(f);h.vd(f);g.Ga(h,null,c,p,b);return 1!=
g.Ga(h,null,null,null,b)?!1:0==c[0]||1==c[1]||0==p[0]||1==p[1]}g=new a.i;h=new a.i;g.K(d);g.P(-b,-b);h.K(g);h.Ga(m);return!h.s()&&(h.ba()>b||h.aa()>b)?!1:!0}d.P(b,b);h=new a.i;h.K(m);h.Ga(d);return h.s()||!h.s()&&h.ba()>b&&h.aa()>b?!1:!0};e.fT=function(d,g,b){if(e.rc(d,g,b)||e.rc(g,d,b)||d.ba()<=b&&d.aa()<=b||g.ba()<=b&&g.aa()<=b)return!1;if(d.ba()<=b||d.aa()<=b){if(g.ba()>b&&g.aa()>b)return!1;var m=new a.yb,h=new a.yb,c=[0,0],p=[0,0],f=new a.b;d.Yl(f);m.ed(f);d.Zl(f);m.vd(f);g.Yl(f);h.ed(f);g.Zl(f);
h.vd(f);m.Ga(h,null,c,p,b);return 2!=m.Ga(h,null,null,null,b)?!1:(0<c[0]||1>c[1])&&(0<p[0]||1>p[1])}if(g.ba()<=b||g.aa()<=b)return!1;m=new a.i;m.K(d);m.Ga(g);return m.s()||m.ba()<=b||m.aa()<=b?!1:!0};e.Bz=function(d,g,b){if(!e.rc(d,g,b))return!1;if(d.ba()<=b&&d.aa()<=b)return d=d.Af(),e.bx(d,g,b);if(g.ba()<=b&&g.aa()<=b)return g=g.Af(),e.bx(g,d,b);if(d.ba()<=b||d.aa()<=b)return e.rc(d,g,b);if(g.ba()<=b||g.aa()<=b){var m=new a.i;m.K(d);m.P(-b,-b);if(m.jl(g))return!0;d=new a.i;d.K(m);d.Ga(g);return d.s()||
d.ba()<=b&&d.aa()<=b?!1:!0}return e.rc(d,g,b)};e.cT=function(d,g,b){if(e.rc(d,g,b)||e.rc(g,d,b)||d.ba()<=b&&d.aa()<=b||g.ba()<=b&&g.aa()<=b||g.ba()>b&&g.aa()>b&&d.ba()>b&&d.aa()>b)return!1;var m;d.ba()>b&&d.aa()>b?m=g:(m=d,d=g);if(d.ba()>b&&d.aa()>b){g=new a.i;var h=new a.i;h.K(d);h.P(-b,-b);g.K(h);g.Ga(m);return g.s()||g.ba()<=b&&g.aa()<=b?!1:!0}g=new a.yb;var h=new a.yb,c=[0,0],p=[0,0],f=new a.b;m.Yl(f);g.ed(f);m.Zl(f);g.vd(f);d.Yl(f);h.ed(f);d.Zl(f);h.vd(f);g.Ga(h,null,c,p,b);return 1!=g.Ga(h,
null,null,null,b)?!1:0<c[0]&&1>c[1]&&0<p[0]&&1>p[1]};e.ZC=function(d,e,b){var g,m,h=new a.i,c=new a.i,p=new a.cl(d,e,b,!0);if(!p.next())return!0;if(this.ED(d,e,b))return!1;var f;f=d;var l;l=null;1736==e.D()&&(l=e);var q=!1,n=!1;do{g=p.jk();m=p.ek();m=e.Fa(e.Ea(m));h.K(p.Fw());h.P(b,b);if(h.contains(m)&&(m=a.gd.he(f,m,0),0!=m)||1736==e.D()&&(g=d.Fa(d.Ea(g)),c.K(p.jw()),c.P(b,b),c.contains(g)&&(m=a.gd.he(l,g,0),0!=m)))return!1;q||(!a.ff.An(d,e.ea()-1)||null!=d.pb&&null!=d.pb.Ab?f=d:(f=new a.Ka,d.copyTo(f),
f.dj(1)),q=!0);1736!=e.D()||n||(n=e,!a.ff.An(n,d.ea()-1)||null!=e.pb&&null!=e.pb.Ab?l=e:(l=new a.Ka,n.copyTo(l),l.dj(1)),n=!0)}while(p.next());return!0};e.rc=function(d,e,b){var g=new a.i;g.K(d);g.P(b,b);return g.contains(e)};e.lm=function(d,e,b){var g=new a.i;g.K(e);g.P(b,b);e=new a.b;d.Yl(e);if(!g.contains(e))return!0;d.YE(e);if(!g.contains(e))return!0;d.aF(e);if(!g.contains(e))return!0;d.Zl(e);return g.contains(e)?!1:!0};e.jA=function(d,e,b){if(d.ea()!=e.ea()||d.F()!=e.F())return!1;var g=new a.b,
m=new a.b,h=!0;b*=b;for(var c=0;c<d.ea();c++){if(d.Dc(c)!=e.Dc(c)){h=!1;break}for(var p=d.Ea(c);p<e.Dc(c);p++)if(d.w(p,g),e.w(p,m),a.b.Zb(g,m)>b){h=!1;break}if(!h)break}return h?!0:!1};e.OI=function(d,e,b){if(d.F()!=e.F())return!1;var g=new a.b,m=new a.b,h=!0;b*=b;for(var c=0;c<d.F();c++)if(d.w(c,g),e.w(c,m),a.b.Zb(g,m)>b){h=!1;break}return h?!0:!1};e.Pw=function(d,e,b,h,c,p){var g=!1,m;d.F()>e.F()?(h&&(h=!1,g=!0),m=e):(m=d,d=e);e=null;if(c||p||g){e=new a.Wk(d.F());for(var f=0;f<d.F();f++)e.write(f,
0)}var f=new a.i,l=new a.i,q=new a.i;m.o(f);d.o(l);f.P(b,b);l.P(b,b);q.K(f);q.Ga(l);for(var l=new a.b,n=new a.b,u=!0,z=a.Ia.oB(d,q),k=z.Re(),t=b*b,v=0;v<m.F();v++)if(m.w(v,l),q.contains(l)){var A=!1;f.K(l.x,l.y,l.x,l.y);k.Ch(f,b);for(var w=k.next();-1!=w&&!(w=z.da(w),d.w(w,n),a.b.Zb(l,n)<=t&&((c||p||g)&&e.write(w,1),A=!0,h));w=k.next());if(!A&&(u=!1,c||h))return!1}else{if(c||h)return!1;u=!1}if(p&&u)return!1;if(h)return!0;for(f=0;f<d.F();f++)if(1==e.read(f)){if(p)return!0}else if(c||g)return!1;return p?
!1:!0};e.nA=function(d,e,b){var g;d.F()>e.F()?g=e:(g=d,d=e);e=new a.i;var m=new a.i,h=new a.i;g.o(e);d.o(m);e.P(b,b);m.P(b,b);h.K(e);h.Ga(m);for(var m=new a.b,c=new a.b,p=b*b,f=a.Ia.oB(d,h),l=f.Re(),q=0;q<g.F();q++)if(g.w(q,m),h.contains(m)){e.K(m.x,m.y,m.x,m.y);l.Ch(e,b);for(var n=l.next();-1!=n;n=l.next())if(d.w(f.da(n),c),a.b.Zb(m,c)<=p)return!0}return!1};e.Vv=function(d,a,b,h){return e.Wf(d,a,b,h)&&e.Wf(a,d,b,h)};e.Wf=function(d,g,m,h){function c(d,e){return u.IB(d,e)}var p=!0,f=[0,0],l=[0,0],
q=0,n=new a.ga(0),u=new e,z,k=new a.i,t=new a.i,v=new a.i;d.o(k);g.o(t);k.P(m,m);t.P(m,m);v.K(k);v.Ga(t);d=d.Ca();var t=g.Ca(),A=null,w=A=null,y=g.pb;null!=y?(A=y.Ab,w=y.nn,null==A&&(A=a.Ia.ij(g,v))):A=a.Ia.ij(g,v);g=A.Re();y=null;for(null!=w&&(y=w.Re());d.kb();)for(;d.La();){var D=!1,B=d.ia();B.o(k);if(!k.jc(v))return!1;if(null!=y&&(y.Ch(k,m),-1==y.next()))return p=!1;w=B.$b();g.Fn(B,m);for(z=g.next();-1!=z;z=g.next()){t.Sb(A.da(z));z=t.ia();var F=B.Ga(z,null,f,l,m);if(2==F&&(!h||l[0]<=l[1])){var F=
f[0],J=f[1],G=l[0],I=l[1];if(F*w<=m&&(1-J)*w<=m){D=!0;q=0;n.resize(0);u.Tg.length=0;for(var r=d.Jb(),G=!0;G;){if(d.La()){B=d.ia();w=B.$b();F=B.Ga(z,null,f,l,m);if(2==F&&(!h||l[0]<=l[1])&&(F=f[0],J=f[1],F*w<=m&&(1-J)*w<=m)){r=d.Jb();continue}if(t.La()&&(z=t.ia(),F=B.Ga(z,null,f,l,m),2==F&&(!h||l[0]<=l[1])&&(F=f[0],J=f[1],F*w<=m&&(1-J)*w<=m))){r=d.Jb();continue}}G=!1}r!=d.Jb()&&(d.Sb(r),d.ia());break}else r=d.Jb(),z=b.Oa(r,d.Qa,F,J,t.Jb(),t.Qa,G,I),u.Tg.push(z),n.add(n.size)}}if(!D){if(q==u.Tg.length)return!1;
1<n.size-q&&n.xd(q,n.size,c);for(D=0;q<u.Tg.length;q++)if(z=u.Tg[n.get(q)],!(z.Oi<D&&z.ji<D)){if(w*(z.Oi-D)>m)return!1;D=z.ji;if(w*(1-D)<=m||1==D)break}if(w*(1-D)>m)return!1;q=0;n.resize(0);u.Tg.length=0}}return p};e.iA=function(d,g,b){if(1>e.Zv(d,g,b,null))return!1;var m=new a.i,h=new a.i;d.o(m);g.o(h);var c=e.lm(m,h,b),m=e.lm(h,m,b);return c&&m?!0:c&&!m?!e.Wf(g,d,b,!1):m&&!c?!e.Wf(d,g,b,!1):!e.Wf(d,g,b,!1)&&!e.Wf(g,d,b,!1)};e.Zv=function(d,g,m,h){function c(d,e){return t.IB(d,e)}var p,f;d.Iw()>
g.Iw()?(p=g,f=d):(p=d,f=g);d=p.Ca();g=f.Ca();var l=[0,0],q=[0,0],n=-1,u=0,z,k=new a.ga(0),t=new e,v,A=new a.i,w=new a.i,y=new a.i;p.o(A);f.o(w);A.P(m,m);w.P(m,m);y.K(A);y.Ga(w);p=null;null!=h&&(p=new a.b);z=w=w=null;var D=f.pb;null!=D?(w=D.Ab,z=D.nn,null==w&&(w=a.Ia.ij(f,y))):w=a.Ia.ij(f,y);f=w.Re();D=null;for(null!=z&&(D=z.Re());d.kb();)for(z=0;d.La();){var B=d.ia();B.o(A);if(A.jc(y)&&(null==D||(D.Ch(A,m),-1!=D.next()))){var F=B.$b();f.Fn(B,m);for(var J=f.next();-1!=J;J=f.next()){var G=w.da(J);g.Sb(G);
v=g.ia();var I=v.$b(),r=B.Ga(v,null,l,q,m);if(0<r){var J=l[0],n=q[0],K=2==r?l[1]:NaN,L=2==r?q[1]:NaN;if(2==r){if(F*(K-J)>m)return n=1;var Q=F*(K-J);if(g.La()){v=g.ia();r=B.Ga(v,null,l,null,m);if(2==r){var r=l[0],O=l[1],r=F*(O-r);if(Q+r>m)return n=1}g.Sb(G);g.ia()}if(!g.wl()){g.oi();v=g.oi();r=B.Ga(v,null,l,null,m);if(2==r&&(r=l[0],O=l[1],r=F*(O-r),Q+r>m))return n=1;g.Sb(G);g.ia()}if(d.La()){G=d.Jb();B=d.ia();r=B.Ga(v,null,l,null,m);if(2==r&&(r=l[0],O=l[1],r=F*(O-r),Q+r>m))return n=1;d.Sb(G);d.ia()}if(!d.wl()){G=
d.Jb();d.oi();B=d.oi();r=B.Ga(v,null,l,null,m);if(2==r&&(r=l[0],O=l[1],r=I*(O-r),Q+r>m))return n=1;d.Sb(G);d.ia()}v=b.Oa(d.Jb(),d.Qa,J,K,g.Jb(),g.Qa,n,L);t.Tg.push(v);k.add(k.size)}n=0;null!=h&&(B.Kb(J,p),h.add(p.x),h.add(p.y))}}if(u<t.Tg.length){k.xd(u,k.size,c);B=0;for(J=t.Tg[k.get(u)].Jl;u<t.Tg.length;u++)if(v=t.Tg[k.get(u)],!(v.Oi<B&&v.ji<B))if(F*(v.Oi-B)>m)z=F*(v.ji-v.Oi),B=v.ji,J=v.Jl;else{v.Jl!=J?(z=F*(v.ji-v.Oi),J=v.Jl):z+=F*(v.ji-v.Oi);if(z>m)return n=1;B=v.ji;if(1==B)break}F*(1-B)>m&&(z=
0);u=0;k.resize(0);t.Tg.length=0}}}return n};e.ED=function(d,e,b){var g=d.Ca(),m=e.Ca();for(d=new a.cl(d,e,b,!1);d.next();){e=d.jk();var h=d.ek();g.Sb(e);m.Sb(h);e=g.ia();if(0<m.ia().Ga(e,null,null,null,b))return!0}return!1};e.eA=function(d,e,b,h){var g=d.Ca(),m=new a.i,c=new a.i,p=new a.i;d.o(m);e.o(c);m.P(b,b);m.contains(c);c.P(b,b);p.K(m);p.Ga(c);m=d.pb;null!=m?(m=m.Ab,null==m&&(m=a.Ia.ij(d,p))):m=a.Ia.ij(d,p);d=m.Re();for(var f=new a.b,l=new a.b,q=b*b,n=0;n<e.F();n++)if(e.w(n,f),p.contains(f)){c.K(f.x,
f.y,f.x,f.y);d.Ch(c,b);for(var u=!1,z=d.next();-1!=z;z=d.next())if(g.Sb(m.da(z)),z=g.ia(),z.Kb(z.Gd(f,!1),l),a.b.Zb(l,f)<=q){u=!0;break}if(h){if(!u)return!1}else if(u)return!0}return h?!0:!1};e.ex=function(d,e,b){var g=new a.b,m=b*b,h=d.Ca();d=d.pb;if(null!=d&&(d=d.Ab,null!=d)){var c=new a.i;c.K(e);b=d.xw(c,b);for(c=b.next();-1!=c;c=b.next())if(h.Sb(d.da(c)),h.La()){var c=h.ia(),p=c.Gd(e,!1);c.Kb(p,g);if(a.b.Zb(e,g)<=m)return!0}return!1}for(d=new a.i;h.kb();)for(;h.La();)if(c=h.ia(),c.o(d),d.P(b,
b),d.contains(e)&&(p=c.Gd(e,!1),c.Kb(p,g),a.b.Zb(e,g)<=m))return!0;return!1};e.bA=function(d,a,b){return e.ex(d,a,b)&&!e.bw(d,a,b)};e.bw=function(d,a,b){d=d.Rf();return!e.or(d,a,b)};e.cA=function(d,e,b){if(d.Hm()){var g=new a.yb(e.v,e.C,e.v,e.G),m=new a.yb(e.v,e.G,e.B,e.G),h=new a.yb(e.B,e.G,e.B,e.C);e=new a.yb(e.B,e.C,e.v,e.C);for(d=d.Ca();d.kb();)for(;d.La();){var c=d.ia();if(c.jc(g,b)||c.jc(m,b)||c.jc(h,b)||c.jc(e,b))return!0}}else{g=new a.i;g.K(e);g.P(b,b);b=d.mc(0);m=new a.b;h=new a.b;e=new a.b;
for(var c=new a.b,p=0,f=d.ea();p<f;p++)for(var l=!0,q=d.Ea(p),n=d.Dc(p);q<n;q++)if(l)b.ec(2*q,h),l=!1;else{b.ec(2*q,m);e.J(h);c.J(m);if(0!=g.Nv(e,c))return!0;h.J(m)}}return!1};e.fc=function(d,g,b){var h=d.D(),m=g.D();if(a.T.Th(h)){var c=d.pb;if(null!=c&&(c=c.hi,null!=c))if(33==m){var p=g.w(),p=c.Kk(p.x,p.y);if(1==p)return 1;if(0==p)return 4}else{p=new a.i;g.o(p);p=c.Dn(p);if(1==p)return 1;if(0==p)return 4;if(b&&a.T.Th(m)&&e.zz(g,c))return 1073741824}}if(a.T.Th(m)&&(c=g.pb,null!=c&&(c=c.hi,null!=c)))if(33==
h){d=d.w();p=c.Kk(d.x,d.y);if(1==p)return 2;if(0==p)return 4}else{g=new a.i;d.o(g);p=c.Dn(g);if(1==p)return 2;if(0==p)return 4;if(b&&a.T.Th(h)&&e.zz(d,c))return 1073741824}return 0};e.zz=function(d,e){for(var g=d.F(),b=new a.b,h=0;h<g;h++)if(d.w(h,b),1==e.Kk(b.x,b.y))return!0;return!1};e.AE=function(d,e,b,h){for(var g=1<=d.rj(0)&&1<=e.rj(0),m=d.Ca(),c=e.Ca(),p=[0,0],f=[0,0],l=new a.cl(d,e,b,!1),q=!1;l.next();){var n=l.jk(),u=l.ek();m.Sb(n);c.Sb(u);n=m.ia();u=c.ia().Ga(n,null,f,p,b);if(2==u){q=p[0];
u=p[1];n=n.$b();if(g&&(u-q)*n>b)return!1;q=!0}else if(0!=u){q=p[0];n=f[0];if(0<q&&1>q&&0<n&&1>n)return!1;q=!0}}if(!q)return!1;m=new a.i;c=new a.i;g=new a.i;d.o(m);e.o(c);m.P(1E3*b,1E3*b);c.P(1E3*b,1E3*b);g.K(m);g.Ga(c);return 10<d.F()&&(d=a.Ed.clip(d,g,b,0),d.s())||10<e.F()&&(e=a.Ed.clip(e,g,b,0),e.s())?!1:a.el.vr(d,e,b,"F********",h)};e.wD=function(d,g,b,h){var m=1<=d.rj(0)&&1<=g.rj(0),c=new a.i,p=new a.i,f=new a.i;d.o(c);g.o(p);for(var l=!1,q=e.lm(c,p,b),n=e.lm(p,c,b),u=d.Ca(),z=g.Ca(),k=[0,0],
t=[0,0],v=new a.cl(d,g,b,!1);v.next();){var A=v.jk(),w=v.ek();u.Sb(A);z.Sb(w);w=u.ia();A=z.ia().Ga(w,null,t,k,b);if(2==A){var A=k[0],y=k[1],w=w.$b();if(m&&(y-A)*w>b&&(l=!0,q&&n))return!0}else if(0!=A&&(A=k[0],w=t[0],0<A&&1>A&&0<w&&1>w))return!0}m=new a.i;u=new a.i;m.K(c);m.P(1E3*b,1E3*b);u.K(p);u.P(1E3*b,1E3*b);f.K(m);f.Ga(u);c="";c=l?c+"**":c+"T*";if(q){if(10<g.F()&&(g=a.Ed.clip(g,f,b,0),g.s()))return!1;c+="****"}else c+="T***";if(n){if(10<d.F()&&(d=a.Ed.clip(d,f,b,0),d.s()))return!1;c+="***"}else c+=
"T**";return a.el.vr(d,g,b,c.toString(),h)};e.bC=function(d,g,b,h){var m=[!1],c=e.wB(d,g,b,m);if(m[0])return c;m=new a.i;g.o(m);m.P(1E3*b,1E3*b);return 10<d.F()&&(d=a.Ed.clip(d,m,b,0),d.s())?!1:a.el.su(d,g,b,h)};e.wB=function(d,e,b,h){h[0]=!1;for(var g=d.Ca(),m=e.Ca(),c=[0,0],p=[0,0],f=new a.cl(d,e,b,!1),l=!1;f.next();){var q=f.jk(),n=f.ek();g.Sb(q,-1);m.Sb(n,-1);q=g.ia();q=m.ia().Ga(q,null,p,c,b);if(0!=q&&(l=!0,1==q&&(q=c[0],n=p[0],0<q&&1>q&&0<n&&1>n)))return h[0]=!0,!1}if(!l){h[0]=!0;c=new a.i;
d.o(c);c.P(b,b);f=d;l=!1;p=new a.i;h=0;for(g=e.ea();h<g;h++)if(0<e.Ha(h)){e.Ti(h,p);if(c.jc(p)){if(m=e.Fa(e.Ea(h)),m=a.ff.xl(f,m,0),0==m)return!1}else return!1;l||(!a.ff.An(d,e.ea()-1)||null!=d.pb&&null!=d.pb.Ab?f=d:(m=new a.Ka,d.copyTo(m),m.dj(1),f=m),l=!0)}if(1==d.ea()||1607==e.D())return!0;c=new a.i;e.o(c);c.P(b,b);p=e;f=!1;b=new a.i;h=0;for(g=d.ea();h<g;h++)if(0<d.Ha(h)){d.Ti(h,b);if(c.jc(b)&&(m=d.Fa(d.Ea(h)),m=a.ff.xl(p,m,0),1==m))return!1;f||(!a.ff.An(e,d.ea()-1)||null!=e.pb&&null!=e.pb.Ab?
p=e:(m=new a.Ka,e.copyTo(m),m.dj(1),p=m),f=!0)}return!0}return!1};e.CE=function(d,e,b,h){for(var g=d.Ca(),m=e.Ca(),c=[0,0],p=[0,0],f=new a.cl(d,e,b,!1),l=!1;f.next();){var q=f.jk(),n=f.ek();g.Sb(q);m.Sb(n);q=g.ia();q=m.ia().Ga(q,null,p,c,b);if(2==q)l=!0;else if(0!=q){l=c[0];q=p[0];if(0<l&&1>l&&0<q&&1>q)return!1;l=!0}}if(!l)return!1;m=new a.i;c=new a.i;g=new a.i;d.o(m);e.o(c);m.P(1E3*b,1E3*b);c.P(1E3*b,1E3*b);g.K(m);g.Ga(c);return 10<d.F()&&(d=a.Ed.clip(d,g,b,0),d.s())||10<e.F()&&(e=a.Ed.clip(e,g,
b,0),e.s())?!1:a.el.Vl(d,e,b,"F********",h)};e.YC=function(d,g,b,h){for(var m=d.Ca(),c=g.Ca(),p=[0,0],f=[0,0],l=new a.cl(d,g,b,!1),q=!1;l.next();){var n=l.jk(),u=l.ek();m.Sb(n);c.Sb(u);n=m.ia();n=c.ia().Ga(n,null,f,p,b);if(2==n)q=!0;else if(0!=n){q=p[0];n=f[0];if(0<q&&1>q&&0<n&&1>n)return!0;q=!0}}if(!q)return!1;c=new a.i;p=new a.i;f=new a.i;l=new a.i;m=new a.i;d.o(c);g.o(p);return e.lm(p,c,b)?(f.K(c),f.P(1E3*b,1E3*b),l.K(p),l.P(1E3*b,1E3*b),m.K(f),m.Ga(l),10<d.F()&&(d=a.Ed.clip(d,m,b,0),d.s())||10<
g.F()&&(g=a.Ed.clip(g,m,b,0),g.s())?!1:b=a.el.Vl(d,g,b,"T********",h)):b=a.el.Vl(d,g,b,"T*****T**",h)};e.jC=function(d,g,b,h){var m=[!1],c=e.wB(d,g,b,m);if(m[0])return c;m=new a.i;g.o(m);m.P(1E3*b,1E3*b);return 10<d.F()&&(d=a.Ed.clip(d,m,b,0),d.s())?!1:a.el.dy(d,g,b,h)};e.YB=function(d,e,b){return 1==a.gd.he(d,e,b)?!0:!1};e.yD=function(d,e,b){return 2==a.gd.he(d,e,b)?!0:!1};e.or=function(d,e,b){var g=new a.b;b*=b;for(var h=0;h<d.F();h++)if(d.w(h,g),a.b.Zb(g,e)<=b)return!1;return!0};e.prototype.IB=
function(d,e){d=this.Tg[d];e=this.Tg[e];return d.Jl<e.Jl||d.Jl==e.Jl&&(d.Wt<e.Wt||d.Wt==e.Wt&&(d.Oi<e.Oi||d.Oi==e.Oi&&(d.ji<e.ji||d.ji==e.ji&&d.dE<e.dE)))?-1:1};return e}();a.hd=h})(A||(A={}));(function(a){var b;(function(e){e[e.InteriorInterior=0]="InteriorInterior";e[e.InteriorBoundary=1]="InteriorBoundary";e[e.InteriorExterior=2]="InteriorExterior";e[e.BoundaryInterior=3]="BoundaryInterior";e[e.BoundaryBoundary=4]="BoundaryBoundary";e[e.BoundaryExterior=5]="BoundaryExterior";e[e.ExteriorInterior=
6]="ExteriorInterior";e[e.ExteriorBoundary=7]="ExteriorBoundary";e[e.ExteriorExterior=8]="ExteriorExterior"})(b||(b={}));var h;(function(e){e[e.AreaAreaPredicates=0]="AreaAreaPredicates";e[e.AreaLinePredicates=1]="AreaLinePredicates";e[e.LineLinePredicates=2]="LineLinePredicates";e[e.AreaPointPredicates=3]="AreaPointPredicates";e[e.LinePointPredicates=4]="LinePointPredicates";e[e.PointPointPredicates=5]="PointPointPredicates"})(h||(h={}));b=function(){function e(){this.Xd=0;this.h=new a.gs;this.A=
[0,0,0,0,0,0,0,0,0];this.Ta=[0,0,0,0,0,0,0,0,0];this.Y=[!1,!1,!1,!1,!1,!1,!1,!1,!1];this.Nl=this.$t=-1}e.py=function(d,e,b,h,c){if(9!=h.length)throw a.g.ra("relation string length has to be 9 characters");for(var g=0;9>g;g++){var m=h.charAt(g);if("*"!=m&&"T"!=m&&"F"!=m&&"0"!=m&&"1"!=m&&"2"!=m)throw a.g.ra("relation string");}g=this.YN(h,d.fb(),e.fb());if(0!=g)return a.hd.qy(d,e,b,g,c);g=new a.i;d.o(g);m=new a.i;e.o(m);var p=new a.i;p.K(g);p.Db(m);b=a.Ia.zd(b,p,!1);d=this.NB(d,b);e=this.NB(e,b);if(d.s()||
e.s())return this.rR(d,e,h);g=e.D();m=!1;switch(d.D()){case 1736:switch(g){case 1736:m=this.vr(d,e,b,h,c);break;case 1607:m=this.Vl(d,e,b,h,c);break;case 33:m=this.ur(d,e,b,h,c);break;case 550:m=this.tr(d,e,b,h,c)}break;case 1607:switch(g){case 1736:m=this.Vl(e,d,b,this.Lo(h),c);break;case 1607:m=this.ey(d,e,b,h,c);break;case 33:m=this.xr(d,e,b,h,c);break;case 550:m=this.wr(d,e,b,h,c)}break;case 33:switch(g){case 1736:m=this.ur(e,d,b,this.Lo(h),c);break;case 1607:m=this.xr(e,d,b,this.Lo(h),c);break;
case 33:m=this.KQ(d,e,b,h);break;case 550:m=this.pr(e,d,b,this.Lo(h),c)}break;case 550:switch(g){case 1736:m=this.tr(e,d,b,this.Lo(h),c);break;case 1607:m=this.wr(e,d,b,this.Lo(h),c);break;case 550:m=this.Wx(d,e,b,h,c);break;case 33:m=this.pr(d,e,b,h,c)}break;default:m=!1}return m};e.vr=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.vF();var p=new a.i,f=new a.i;d.o(p);g.o(f);h=!1;a.hd.nj(p,f,b)&&(m.Bs(d,g),h=!0);h||(p=a.hd.fc(d,g,!1),4==p?(m.Bs(d,g),h=!0):1==p?(m.Bv(g),h=!0):2==p&&(m.$A(d),h=!0));
h||(h=new a.fd,d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.so(d,g),m.h.xg());return e.Mf(m.A,m.Hc)};e.su=function(d,g,b,h){var m=new e;m.pi();m.si("T*****F**");m.vF();var c=new a.i,p=new a.i;d.o(c);g.o(p);var f=!1;a.hd.nj(c,p,b)&&(m.Bs(d,g),f=!0);f||(c=a.hd.fc(d,g,!1),4==c?(m.Bs(d,g),f=!0):1==c?(m.Bv(g),f=!0):2==c&&(m.$A(d),f=!0));if(f)return c=this.Mf(m.A,m.Hc);f=new a.fd;d=f.Eb(d);c=f.Eb(g);a.aj.$(f,b,h,!1);b=f.hf(c).Rf();f.xo(0,!0,!0);a.mm.$(f,d,-1,!1,h);if(0==f.F(d))return!1;a.mm.$(f,c,-1,!1,h);m.Op(f,
h);g=0==f.F(c);if(!g&&(m.so(d,c),m.h.xg(),c=this.Mf(m.A,m.Hc),!c))return c;d=f.hf(d);f=new a.fd;d=f.Eb(d);c=f.Eb(b);m.Op(f,h);m.Xd=0;m.pi();m.si(g?"T*****F**":"******F**");m.wy();m.so(d,c);m.h.xg();return c=this.Mf(m.A,m.Hc)};e.Vl=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.wy();var p=new a.i,f=new a.i;d.o(p);g.o(f);h=!1;a.hd.nj(p,f,b)&&(m.Cs(d,g),h=!0);h||(p=a.hd.fc(d,g,!1),4==p?(m.Cs(d,g),h=!0):1==p&&(m.aB(g),h=!0));h||(h=new a.fd,d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.Jg=m.h.uo(),e.es(g,m.h,m.Jg),
m.so(d,g),m.h.vo(m.Jg),m.h.xg());return e.Mf(m.A,m.Hc)};e.dy=function(d,g,b,h){var m=new e;m.pi();m.si("T*****F**");m.wy();var c=new a.i,p=new a.i;d.o(c);g.o(p);var f=!1;a.hd.nj(c,p,b)&&(m.Cs(d,g),f=!0);f||(c=a.hd.fc(d,g,!1),4==c?(m.Cs(d,g),f=!0):1==c&&(m.aB(g),f=!0));if(f)return b=this.Mf(m.A,m.Hc);f=new a.fd;d=f.Eb(d);g=f.Eb(g);m.In(f,b,h);if(0==f.F(d))return!1;m.so(d,g);m.h.xg();return b=this.Mf(m.A,m.Hc)};e.tr=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.wF();var p=new a.i,f=new a.i;d.o(p);
g.o(f);h=!1;a.hd.nj(p,f,b)&&(m.Ds(d),h=!0);h||(p=a.hd.fc(d,g,!1),4==p?(m.Ds(d),h=!0):1==p&&(m.cK(),h=!0));h||(h=new a.fd,d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.Pv(d,g),m.h.xg());return e.Mf(m.A,m.Hc)};e.ey=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.ZR();h=new a.i;var p=new a.i;d.o(h);g.o(p);var f=!1;a.hd.nj(h,p,b)&&(m.CD(d,g),f=!0);f||4!=a.hd.fc(d,g,!1)||(m.CD(d,g),f=!0);f||(h=new a.fd,d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.ph=m.h.uo(),m.Jg=m.h.uo(),e.es(d,m.h,m.ph),e.es(g,m.h,m.Jg),m.so(d,g),m.h.vo(m.ph),
m.h.vo(m.Jg),m.h.xg());return e.Mf(m.A,m.Hc)};e.wr=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.KF();h=new a.i;var p=new a.i;d.o(h);g.o(p);var f=!1;a.hd.nj(h,p,b)&&(m.dx(d),f=!0);f||4!=a.hd.fc(d,g,!1)||(m.dx(d),f=!0);f||(h=new a.fd,d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.ph=m.h.uo(),e.es(d,m.h,m.ph),m.Pv(d,g),m.h.vo(m.ph),m.h.xg());return e.Mf(m.A,m.Hc)};e.Wx=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);m.PF();h=new a.i;var p=new a.i;d.o(h);g.o(p);var f=!1;a.hd.nj(h,p,b)&&(m.PE(),f=!0);f||(h=new a.fd,
d=h.Eb(d),g=h.Eb(g),m.In(h,b,c),m.Pv(d,g),m.h.xg());return e.Mf(m.A,m.Hc)};e.ur=function(d,g,b,h){var m=new e;m.pi();m.si(h);m.wF();var c=new a.i;d.o(c);g=g.w();var p=!1;a.hd.ru(g,c,b)&&(m.Ds(d),p=!0);p||(b=a.gd.he(d,g,b),1==b?(m.A[0]=0,m.A[2]=2,m.A[3]=-1,m.A[5]=1,m.A[6]=-1):2==b?(m.A[6]=-1,0!=d.Mh()?(m.A[0]=-1,m.A[3]=0,m.A[2]=2,m.A[5]=1):(m.A[0]=0,m.A[3]=-1,m.A[5]=-1,b=new a.i,d.o(b),m.A[2]=0==b.ba()&&0==b.aa()?-1:1)):m.Ds(d));return this.Mf(m.A,h)};e.xr=function(d,g,b,h,c){var m=new e;m.pi();m.si(h);
m.KF();var p=new a.i;d.o(p);h=g.w();var f=!1;a.hd.ru(h,p,b)&&(m.dx(d),f=!0);if(!f){var p=null,l=f=!1;if(m.Y[0]||m.Y[6])a.hd.ex(d,h,b)?(m.Y[0]&&(p=a.Hh.il(d,c),l=!a.hd.or(p,h,b),f=!0,m.A[0]=l?-1:0),m.A[6]=-1):(m.A[0]=-1,m.A[6]=0);m.Y[3]&&(null!=p&&p.s()?m.A[3]=-1:(f||(null==p&&(p=a.Hh.il(d,c)),l=!a.hd.or(p,h,b),f=!0),m.A[3]=l?0:-1));m.Y[5]&&(null!=p&&p.s()?m.A[5]=-1:f&&!l?m.A[5]=0:(null==p&&(p=a.Hh.il(d,c)),c=a.hd.mu(p,g,b),m.A[5]=c?-1:0));m.Y[2]&&(0!=d.$b()?m.A[2]=1:(c=new a.pe(d.description),c.Pd(d,
0,d.F()),d=a.hd.mu(c,g,b),m.A[2]=d?-1:0))}return this.Mf(m.A,m.Hc)};e.pr=function(d,g,b,h){var m=new e;m.pi();m.si(h);m.PF();var c=new a.i;d.o(c);g=g.w();var p=!1;a.hd.ru(g,c,b)&&(m.PE(),p=!0);if(!p){c=!1;p=!0;b*=b;for(var f=0;f<d.F();f++){var l=d.Fa(f);a.b.Zb(l,g)<=b?c=!0:p=!1;if(c&&!p)break}c?(m.A[0]=0,m.A[2]=p?-1:0,m.A[6]=-1):(m.A[0]=-1,m.A[2]=0,m.A[6]=0)}return e.Mf(m.A,h)};e.KQ=function(d,g,b,h){d=d.w();g=g.w();for(var m=[],c=0;9>c;c++)m[c]=-1;a.b.Zb(d,g)<=b*b?m[0]=0:(m[2]=0,m[6]=0);m[8]=2;return e.Mf(m,
h)};e.Mf=function(d,e){for(var a=0;9>a;a++)switch(e.charAt(a)){case "T":if(-1==d[a])return!1;break;case "F":if(-1!=d[a])return!1;break;case "0":if(0!=d[a])return!1;break;case "1":if(1!=d[a])return!1;break;case "2":if(2!=d[a])return!1}return!0};e.rR=function(d,e,b){var g=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(d.s()&&e.s()){for(var m=0;9>m;m++)g[m]=-1;return this.Mf(g,b)}m=!1;d.s()&&(d=e,m=!0);g[0]=-1;g[1]=-1;g[3]=-1;g[4]=-1;g[6]=-1;g[7]=-1;g[8]=2;e=d.D();a.T.Kc(e)?1736==e?0!=d.Mh()?(g[2]=2,g[5]=1):(g[5]=
-1,e=new a.i,d.o(e),g[2]=0==e.ba()&&0==e.aa()?0:1):(e=0!=d.$b(),g[2]=e?1:0,g[5]=a.Hh.No(d)?0:-1):(g[2]=0,g[5]=-1);m&&this.qG(g);return this.Mf(g,b)};e.YN=function(d,a,b){return e.mT(d)?3:e.NS(d)?4:e.nT(d,a,b)?8:e.CR(d,a,b)?16:e.yQ(d)?1:e.LK(d,a,b)?32:0};e.mT=function(d){return"T"==d.charAt(0)&&"*"==d.charAt(1)&&"F"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"F"==d.charAt(5)&&"F"==d.charAt(6)&&"F"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1};e.NS=function(d){return"F"==d.charAt(0)&&"F"==d.charAt(1)&&
"*"==d.charAt(2)&&"F"==d.charAt(3)&&"F"==d.charAt(4)&&"*"==d.charAt(5)&&"*"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1};e.nT=function(d,e,a){if(0==e&&0==a)return!1;if(2!=e||2!=a)if("F"==d.charAt(0)&&"*"==d.charAt(1)&&"*"==d.charAt(2)&&"T"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"*"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)||1==e&&1==a&&"F"==d.charAt(0)&&"T"==d.charAt(1)&&"*"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"*"==d.charAt(6)&&"*"==d.charAt(7)&&
"*"==d.charAt(8))return!0;return 0!=a&&"F"==d.charAt(0)&&"*"==d.charAt(1)&&"*"==d.charAt(2)&&"*"==d.charAt(3)&&"T"==d.charAt(4)&&"*"==d.charAt(5)&&"*"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1};e.CR=function(d,e,a){return e>a?"T"==d.charAt(0)&&"*"==d.charAt(1)&&"*"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"T"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1:1==e&&1==a&&"0"==d.charAt(0)&&"*"==d.charAt(1)&&"*"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&
"*"==d.charAt(5)&&"*"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1};e.yQ=function(d){return"T"==d.charAt(0)&&"*"==d.charAt(1)&&"*"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"F"==d.charAt(6)&&"F"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1};e.LK=function(d,e,a){if(e==a){if(1!=e)return"T"==d.charAt(0)&&"*"==d.charAt(1)&&"T"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"T"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8)?!0:!1;if("1"==d.charAt(0)&&
"*"==d.charAt(1)&&"T"==d.charAt(2)&&"*"==d.charAt(3)&&"*"==d.charAt(4)&&"*"==d.charAt(5)&&"T"==d.charAt(6)&&"*"==d.charAt(7)&&"*"==d.charAt(8))return!0}return!1};e.es=function(d,e,a){d=e.ya(d);for(var g=e.Be;-1!=g;g=e.Bf(g))if(0!=(e.md(g)&d)){var b=e.te(g);if(-1==b)e.fm(g,a,0);else{var m=b,h=0;do 0!=(e.Gg(m)&d)&&h++,m=e.Wb(e.sa(m));while(m!=b);e.fm(g,a,h)}}};e.Lo=function(d){var e;e=""+d.charAt(0);e+=d.charAt(3);e+=d.charAt(6);e+=d.charAt(1);e+=d.charAt(4);e+=d.charAt(7);e+=d.charAt(2);e+=d.charAt(5);
return e+=d.charAt(8)};e.prototype.pi=function(){for(var d=0;9>d;d++)this.A[d]=-2,this.Ta[d]=-2};e.qG=function(d){var e=d[1],a=d[2],b=d[5];d[1]=d[3];d[2]=d[6];d[5]=d[7];d[3]=e;d[6]=a;d[7]=b};e.prototype.si=function(d){this.Hc=d;for(d=0;9>d;d++)"*"!=this.Hc.charAt(d)?(this.Y[d]=!0,this.Xd++):this.Y[d]=!1};e.prototype.SF=function(){for(var d=0;9>d;d++)this.Y[d]&&-2==this.A[d]&&(this.A[d]=-1,this.Y[d]=!1)};e.prototype.dc=function(d){if(-2==this.A[d])return!1;if(-1==this.A[d])return this.Y[d]=!1,this.Xd--,
!0;if("T"!=this.Hc.charAt(d)&&"F"!=this.Hc.charAt(d)){if(this.A[d]<this.Ta[d])return!1;this.Y[d]=!1;this.Xd--;return!0}this.Y[d]=!1;this.Xd--;return!0};e.prototype.vF=function(){this.$t=0;this.Ta[0]=2;this.Ta[1]=1;this.Ta[2]=2;this.Ta[3]=1;this.Ta[4]=1;this.Ta[5]=1;this.Ta[6]=2;this.Ta[7]=1;this.Ta[8]=2;this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.wy=function(){this.$t=1;this.Nl=3;this.Ta[0]=1;this.Ta[1]=0;this.Ta[2]=2;this.Ta[3]=1;this.Ta[4]=0;this.Ta[5]=1;this.Ta[6]=1;this.Ta[7]=
0;this.Ta[8]=2;this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.ZR=function(){this.$t=2;this.Nl=4;this.Ta[0]=1;this.Ta[1]=0;this.Ta[2]=1;this.Ta[3]=0;this.Ta[4]=0;this.Ta[5]=0;this.Ta[6]=1;this.Ta[7]=0;this.Ta[8]=2;this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.wF=function(){this.Nl=3;this.Ta[0]=0;this.Ta[1]=-1;this.Ta[2]=2;this.Ta[3]=0;this.Ta[4]=-1;this.Ta[5]=1;this.Ta[6]=0;this.Ta[7]=-1;this.Ta[8]=2;this.Y[1]&&(this.A[1]=-1,this.Y[1]=!1,this.Xd--);this.Y[4]&&(this.A[4]=
-1,this.Y[4]=!1,this.Xd--);this.Y[7]&&(this.A[7]=-1,this.Y[7]=!1,this.Xd--);this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.KF=function(){this.Nl=4;this.Ta[0]=0;this.Ta[1]=-1;this.Ta[2]=1;this.Ta[3]=0;this.Ta[4]=-1;this.Ta[5]=0;this.Ta[6]=0;this.Ta[7]=-1;this.Ta[8]=2;this.Y[1]&&(this.A[1]=-1,this.Y[1]=!1,this.Xd--);this.Y[4]&&(this.A[4]=-1,this.Y[4]=!1,this.Xd--);this.Y[7]&&(this.A[7]=-1,this.Y[7]=!1,this.Xd--);this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.PF=function(){this.Nl=
5;this.Ta[0]=0;this.Ta[1]=-1;this.Ta[2]=0;this.Ta[3]=-1;this.Ta[4]=-1;this.Ta[5]=-1;this.Ta[6]=0;this.Ta[7]=-1;this.Ta[8]=2;this.Y[1]&&(this.A[1]=-1,this.Y[1]=!1,this.Xd--);this.Y[3]&&(this.A[3]=-1,this.Y[3]=!1,this.Xd--);this.Y[4]&&(this.A[4]=-1,this.Y[4]=!1,this.Xd--);this.Y[5]&&(this.A[5]=-1,this.Y[5]=!1,this.Xd--);this.Y[7]&&(this.A[7]=-1,this.Y[7]=!1,this.Xd--);this.Y[8]&&(this.A[8]=2,this.Y[8]=!1,this.Xd--)};e.prototype.aK=function(d,e,a){var g=!0;this.Y[0]&&(this.HO(d,e,a),g=g&&this.dc(0));
this.Y[1]&&(this.eD(d,e,1),g=g&&this.dc(1));this.Y[2]&&(this.fD(d,e,a,2),g=g&&this.dc(2));this.Y[3]&&(this.eD(d,a,3),g=g&&this.dc(3));this.Y[4]&&(this.gK(d,e,a),g=g&&this.dc(4));this.Y[5]&&(this.eB(d,a,5),g=g&&this.dc(5));this.Y[6]&&(this.fD(d,a,e,6),g=g&&this.dc(6));this.Y[7]&&(this.eB(d,e,7),g=g&&this.dc(7));return g};e.prototype.Bs=function(d,e){this.A[0]=-1;this.A[1]=-1;this.A[3]=-1;this.A[4]=-1;this.iq(d,this.Y[2]?2:-1,this.Hc.charAt(2),this.Y[5]?5:-1,this.Hc.charAt(5));this.iq(e,this.Y[6]?6:
-1,this.Hc.charAt(6),this.Y[7]?7:-1,this.Hc.charAt(7))};e.prototype.iq=function(d,e,b,h,c){if(-1!=e||-1!=h)("T"!=b&&"F"!=b&&-1!=e||"T"!=c&&"F"!=c&&-1!=h?0!=d.Mh():1)?(-1!=e&&(this.A[e]=2),-1!=h&&(this.A[h]=1)):(-1!=h&&(this.A[h]=-1),-1!=e&&(b=new a.i,d.o(b),this.A[e]=0==b.ba()&&0==b.aa()?0:1))};e.prototype.Bv=function(d){this.A[2]=2;this.A[3]=-1;this.A[4]=-1;this.A[5]=1;this.A[6]=-1;this.A[7]=-1;this.iq(d,this.Y[0]?0:-1,this.Hc.charAt(0),this.Y[1]?1:-1,this.Hc.charAt(1))};e.prototype.$A=function(d){this.Bv(d);
e.qG(this.A)};e.prototype.Cs=function(d,e){this.A[0]=-1;this.A[1]=-1;this.A[3]=-1;this.A[4]=-1;if(this.Y[6]){var g=this.Hc.charAt(6),g="T"!=g&&"F"!=g?0!=e.$b():!0;this.A[6]=g?1:0}this.Y[7]&&(g=a.Hh.No(e),this.A[7]=g?0:-1);this.iq(d,this.Y[2]?2:-1,this.Hc.charAt(2),this.Y[5]?5:-1,this.Hc.charAt(5))};e.prototype.aB=function(d){if(this.Y[0]){var e=this.Hc.charAt(0),e="T"!=e&&"F"!=e?0!=d.$b():!0;this.A[0]=e?1:0}this.Y[1]&&(d=a.Hh.No(d),this.A[1]=d?0:-1);this.A[2]=2;this.A[3]=-1;this.A[4]=-1;this.A[5]=
1;this.A[6]=-1;this.A[7]=-1};e.prototype.Ds=function(d){this.A[0]=-1;this.A[3]=-1;this.A[6]=0;this.iq(d,this.Y[2]?2:-1,this.Hc.charAt(2),this.Y[5]?5:-1,this.Hc.charAt(5))};e.prototype.cK=function(){this.A[0]=0;this.A[2]=2;this.A[3]=-1;this.A[5]=1;this.A[6]=-1};e.prototype.CD=function(d,e){this.A[0]=-1;this.A[1]=-1;this.A[3]=-1;this.A[4]=-1;if(this.Y[2]){var g=this.Hc.charAt(2),g="T"!=g&&"F"!=g?0!=d.$b():!0;this.A[2]=g?1:0}this.Y[5]&&(g=a.Hh.No(d),this.A[5]=g?0:-1);this.Y[6]&&(g=this.Hc.charAt(6),
g="T"!=g&&"F"!=g?0!=e.$b():!0,this.A[6]=g?1:0);this.Y[7]&&(g=a.Hh.No(e),this.A[7]=g?0:-1)};e.prototype.dx=function(d){this.A[0]=-1;this.A[3]=-1;if(this.Y[2]){var e=this.Hc.charAt(2),e="T"!=e&&"F"!=e?0!=d.$b():!0;this.A[2]=e?1:0}this.Y[5]&&(d=a.Hh.No(d),this.A[5]=d?0:-1);this.A[6]=0};e.prototype.PE=function(){this.A[0]=-1;this.A[2]=0;this.A[6]=0};e.prototype.bK=function(d,e,a){var g=!0;this.Y[0]&&(this.IO(d,e),g=g&&this.dc(0));this.Y[1]&&(this.EO(d,e,a,this.Jg),g=g&&this.dc(1));this.Y[2]&&(this.FO(d,
e),g=g&&this.dc(2));this.Y[3]&&(this.kK(d,e,a,this.Jg),g=g&&this.dc(3));this.Y[4]&&(this.hK(d,e,a,this.Jg),g=g&&this.dc(4));this.Y[5]&&(this.iK(d,e,a),g=g&&this.dc(5));this.Y[6]&&(this.BM(d,e),g=g&&this.dc(6));this.Y[7]&&(this.AM(d,e,a,this.Jg),g=g&&this.dc(7));return g};e.prototype.uP=function(d,e,a){var g=!0;this.Y[0]&&(this.LO(d,e,a,this.ph,this.Jg),g=g&&this.dc(0));this.Y[1]&&(this.gD(d,e,a,this.ph,this.Jg,1),g=g&&this.dc(1));this.Y[2]&&(this.hD(d,e,a,2),g=g&&this.dc(2));this.Y[3]&&(this.gD(d,
a,e,this.Jg,this.ph,3),g=g&&this.dc(3));this.Y[4]&&(this.mK(d,e,a,this.ph,this.Jg),g=g&&this.dc(4));this.Y[5]&&(this.fB(d,a,this.ph,5),g=g&&this.dc(5));this.Y[6]&&(this.hD(d,a,e,6),g=g&&this.dc(6));this.Y[7]&&(this.fB(d,e,this.Jg,7),g=g&&this.dc(7));return g};e.prototype.bB=function(d,e,a){var g=!0;this.Y[0]&&(this.JO(d,e),g=g&&this.dc(0));this.Y[2]&&(this.GO(d,e),g=g&&this.dc(2));this.Y[3]&&(this.lK(d,e,a),g=g&&this.dc(3));this.Y[5]&&(this.jK(d,e),g=g&&this.dc(5));this.Y[6]&&(this.CM(d,e),g=g&&this.dc(6));
return g};e.prototype.DD=function(d,e,a){var g=!0;this.Y[0]&&(this.MO(d,e,a,this.ph),g=g&&this.dc(0));this.Y[2]&&(this.KO(d,a),g=g&&this.dc(2));this.Y[3]&&(this.oK(d,e,a,this.ph),g=g&&this.dc(3));this.Y[5]&&(this.nK(d,e,a,this.ph),g=g&&this.dc(5));this.Y[6]&&(this.DM(d,e,a),g=g&&this.dc(6));return g};e.prototype.JQ=function(d,e,a){var g=!0;this.Y[0]&&(this.NO(d,e,a),g=g&&this.dc(0));this.Y[2]&&(this.iD(d,e,a,2),g=g&&this.dc(2));this.Y[6]&&(this.iD(d,a,e,6),g=g&&this.dc(6));return g};e.prototype.HO=
function(d,e,a){2!=this.A[0]&&(d=this.h.Qe(d),0!=(d&e)&&0!=(d&a)&&(this.A[0]=2))};e.prototype.eD=function(d,e,a){if(1!=this.A[a]){var g=this.h.Qe(this.h.sa(d));0!=(this.h.Qe(d)&e)&&0!=(g&e)&&(this.A[a]=1)}};e.prototype.fD=function(d,e,a,b){2!=this.A[b]&&(d=this.h.Qe(d),0!=(d&e)&&0==(d&a)&&(this.A[b]=2))};e.prototype.gK=function(d,e,a){if(1!=this.A[4]){var g=this.h.Gg(d);0!=(g&e)&&0!=(g&a)?this.A[4]=1:0!=this.A[4]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)&&(d=this.h.md(this.h.jf(d)),0!=(d&e)&&
0!=(d&a)&&(this.A[4]=0))}};e.prototype.eB=function(d,e,a){if(1!=this.A[a]){var g=this.h.Qe(this.h.sa(d));0==(this.h.Qe(d)&e)&&0==(g&e)&&(this.A[a]=1)}};e.prototype.IO=function(d,e){if(1!=this.A[0]){var a=this.h.Qe(this.h.sa(d));0!=(this.h.Qe(d)&e)&&0!=(a&e)&&(this.A[0]=1)}};e.prototype.EO=function(d,e,a,b){if(0!=this.A[1]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)){var g=this.h.jf(d),h=this.h.md(g);0==(h&e)&&0!=(this.h.Qe(d)&e)&&(d=this.h.Sf(g,b),0!=(h&a)&&0!=d%2&&(this.A[1]=0))}};e.prototype.FO=
function(d,e){2!=this.A[2]&&0!=(this.h.Gg(d)&e)&&(this.A[2]=2)};e.prototype.kK=function(d,e,a,b){if(1!=this.A[3]){var g=this.h.Gg(d);0!=(g&e)&&0!=(g&a)?this.A[3]=1:0!=this.A[3]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)&&(g=this.h.jf(d),d=this.h.md(g),0!=(d&e)&&(e=this.h.Sf(g,b),0!=(d&a)&&0==e%2&&(this.A[3]=0)))}};e.prototype.hK=function(d,e,a,b){if(0!=this.A[4]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)){var g=this.h.jf(d);d=this.h.md(g);0!=(d&e)&&(e=this.h.Sf(g,b),0!=(d&a)&&0!=e%2&&(this.A[4]=
0))}};e.prototype.iK=function(d,e,a){1!=this.A[5]&&(d=this.h.Gg(d),0!=(d&e)&&0==(d&a)&&(this.A[5]=1))};e.prototype.BM=function(d,e){if(1!=this.A[6]){var a=this.h.Qe(this.h.sa(d));0==(this.h.Qe(d)&e)&&0==(a&e)&&(this.A[6]=1)}};e.prototype.AM=function(d,e,a,b){if(0!=this.A[7]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)){var g=this.h.jf(d),h=this.h.md(g);0==(h&e)&&0==(this.h.Qe(d)&e)&&(d=this.h.Sf(g,b),0!=(h&a)&&0!=d%2&&(this.A[7]=0))}};e.prototype.LO=function(d,e,a,b,h){if(1!=this.A[0]){var g=this.h.Gg(d);
0!=(g&e)&&0!=(g&a)?this.A[0]=1:0!=this.A[0]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)&&(d=this.h.jf(d),g=this.h.md(d),0!=(g&e)&&0!=(g&a)&&(e=this.h.Sf(d,b),h=this.h.Sf(d,h),0==e%2&&0==h%2&&(this.A[0]=0)))}};e.prototype.gD=function(d,e,a,b,h,c){if(0!=this.A[c]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)){d=this.h.jf(d);var g=this.h.md(d);0!=(g&e)&&0!=(g&a)&&(e=this.h.Sf(d,b),h=this.h.Sf(d,h),0==e%2&&0!=h%2&&(this.A[c]=0))}};e.prototype.hD=function(d,e,a,b){1!=this.A[b]&&(d=this.h.Gg(d),0!=
(d&e)&&0==(d&a)&&(this.A[b]=1))};e.prototype.mK=function(d,e,a,b,h){if(0!=this.A[4]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)){d=this.h.jf(d);var g=this.h.md(d);0!=(g&e)&&0!=(g&a)&&(e=this.h.Sf(d,b),h=this.h.Sf(d,h),0!=e%2&&0!=h%2&&(this.A[4]=0))}};e.prototype.fB=function(d,e,a,b){0!=this.A[b]&&1!=this.h.tb(this.h.fe(this.h.sa(d)),this.ni)&&(d=this.h.jf(d),0==(this.h.md(d)&e)&&0!=this.h.Sf(d,a)%2&&(this.A[b]=0))};e.prototype.JO=function(d,e){0!=this.A[0]&&0==(this.h.md(d)&e)&&0!=(this.h.pj(this.h.mw(d))&
e)&&(this.A[0]=0)};e.prototype.GO=function(d,e){2!=this.A[2]&&0!=(this.h.md(d)&e)&&(this.A[2]=2)};e.prototype.lK=function(d,e,a){0!=this.A[3]&&(d=this.h.md(d),0!=(d&e)&&0!=(d&a)&&(this.A[3]=0))};e.prototype.jK=function(d,e){1!=this.A[5]&&0!=(this.h.md(d)&e)&&(this.A[5]=1)};e.prototype.CM=function(d,e){0!=this.A[6]&&0==(this.h.md(d)&e)&&0==(this.h.pj(this.h.mw(d))&e)&&(this.A[6]=0)};e.prototype.MO=function(d,e,a,b){if(0!=this.A[0]){var g=this.h.md(d);0!=(g&e)&&0!=(g&a)&&0==this.h.Sf(d,b)%2&&(this.A[0]=
0)}};e.prototype.KO=function(d,e){1!=this.A[2]&&(-1!=this.h.te(d)?this.A[2]=1:0!=this.A[2]&&0==(this.h.md(d)&e)&&(this.A[2]=0))};e.prototype.oK=function(d,e,a,b){if(0!=this.A[3]){var g=this.h.md(d);0!=(g&e)&&0!=(g&a)&&0!=this.h.Sf(d,b)%2&&(this.A[3]=0)}};e.prototype.nK=function(d,e,a,b){if(0!=this.A[5]){var g=this.h.md(d);0!=(g&e)&&0==(g&a)&&0!=this.h.Sf(d,b)%2&&(this.A[5]=0)}};e.prototype.DM=function(d,e,a){0!=this.A[6]&&(d=this.h.md(d),0==(d&e)&&0!=(d&a)&&(this.A[6]=0))};e.prototype.NO=function(d,
e,a){0!=this.A[0]&&(d=this.h.md(d),0!=(d&e)&&0!=(d&a)&&(this.A[0]=0))};e.prototype.iD=function(d,e,a,b){0!=this.A[b]&&(d=this.h.md(d),0!=(d&e)&&0==(d&a)&&(this.A[b]=0))};e.prototype.so=function(d,e){var g=!1;d=this.h.ya(d);e=this.h.ya(e);this.ni=this.h.Eg();for(var b=this.h.Be;-1!=b;b=this.h.Bf(b)){var h=this.h.te(b);if(-1==h){if(-1!=this.Nl)switch(this.Nl){case 3:g=this.bB(b,d,e);break;case 4:g=this.DD(b,d,e);break;default:throw a.g.ra("internal error");}}else{var c=h;do{var p=c;if(1!=this.h.tb(p,
this.ni)){do{switch(this.$t){case 0:g=this.aK(p,d,e);break;case 1:g=this.bK(p,d,e);break;case 2:g=this.uP(p,d,e);break;default:throw a.g.ra("internal error");}if(g)break;this.h.Bb(p,this.ni,1);p=this.h.Wb(p)}while(p!=c&&!g)}if(g)break;c=this.h.Wb(this.h.sa(p))}while(c!=h);if(g)break}}g||this.SF();this.h.kh(this.ni)};e.prototype.Pv=function(d,e){var g=!1;d=this.h.ya(d);e=this.h.ya(e);for(var b=this.h.Be;-1!=b;b=this.h.Bf(b)){switch(this.Nl){case 3:g=this.bB(b,d,e);break;case 4:g=this.DD(b,d,e);break;
case 5:g=this.JQ(b,d,e);break;default:throw a.g.wa();}if(g)break}g||this.SF()};e.prototype.Op=function(d,e){this.h.Mp(d,e)};e.prototype.In=function(d,e,a){this.tM(d,e,a);this.Op(d,a)};e.prototype.tM=function(d,e,b){a.aj.$(d,e,b,!1);d.xo(0,!0,!0);for(e=d.$c;-1!=e;e=d.we(e))1736==d.Lb(e)&&a.mm.$(d,e,-1,!1,b)};e.NB=function(d,e){var g=d.D();if(a.T.Lc(g))return g=new a.Xa(d.description),g.Bc(d,!0),g;if(197==g){g=new a.i;d.o(g);if(g.ba()<=e&&g.aa()<=e)return g=new a.Va(d.description),d.Af(g),g;if(g.ba()<=
e||g.aa()<=e)return g=new a.Xa(d.description),e=new a.Va,d.uf(0,e),g.df(e),d.uf(2,e),g.lineTo(e),g;g=new a.Ka(d.description);g.Wc(d,!1);return g}return d};return e}();a.el=b})(A||(A={}));(function(a){var b=function(){function d(d){this.Dl=new a.ga(0);this.Ot=new a.ga(0);this.Ar=new a.b;this.Br=new a.b;this.a=d;this.Tq=-1}d.prototype.cc=function(d){return this.a.cc(this.Jw(d))};d.prototype.ot=function(d){var e=this.tw(d);d=this.vC(d);if(this.a.Ua(e)==d){var a=e,e=d;d=a}this.a.uc(e,this.Ar);this.a.uc(d,
this.Br);return this.Ar.y<this.Br.y};d.prototype.Jw=function(d){var e=this.tw(d);d=this.vC(d);return this.a.X(e)==d?e:d};d.prototype.tw=function(d){return this.Dl.get(d)};d.prototype.vC=function(d){return this.Ot.get(d)};d.prototype.hC=function(d){this.Dl.set(d,this.Tq);this.Tq=d};d.prototype.GE=function(d){if(-1!=this.Tq){var e=this.Tq;this.Tq=this.Dl.get(e);this.Dl.set(e,d);this.Ot.set(e,this.a.X(d));return e}null==this.Dl&&(this.Dl=new a.ga(0),this.Ot=new a.ga(0));e=this.Dl.size;this.Dl.add(d);
this.Ot.add(this.a.X(d));return e};d.prototype.Dw=function(d){return this.a.rd(this.tw(d))};return d}();a.BT=b;var h=function(){function d(d){this.me=d;this.Vd=new a.yb;this.Kl=new a.yb;this.eE=0;this.on=null;this.zx=-1}d.prototype.compare=function(d,e,a){a=d.da(a);var g=this.me.$a,b;this.zx==e?b=this.eE:(this.on=g.cc(e),null==this.on?(d=g.a,d.Oc(g.Jw(e),this.Vd),this.on=this.Vd,b=this.Vd.xe(this.me.Zg,0)):b=this.on.xe(this.me.Zg,0),this.eE=b,this.zx=e);d=g.cc(a);var h;null==d?(d=g.a,d.Oc(g.Jw(a),
this.Kl),d=this.Kl,h=this.Kl.xe(this.me.Zg,0)):h=d.xe(this.me.Zg,0);b==h&&(e=g.ot(e),a=g.ot(a),a=Math.min(e?this.on.ha:this.on.ja,a?d.ha:d.ja),e=.5*(a+this.me.Zg),e==this.me.Zg&&(e=a),b=this.on.xe(e,0),h=d.xe(e,0));return b<h?-1:b>h?1:0};d.prototype.reset=function(){this.zx=-1};return d}(),e=function(){function d(){this.Rl=this.Dk=null;this.Za=new a.bj;this.Za.lM();this.Ld=new h(this);this.Za.Hn(this.Ld)}d.prototype.XM=function(){var d=!1;this.Qt&&(d=this.YM());if(1==this.a.ea(this.U)){var e=this.a.Vb(this.U),
d=this.a.Gw(e);this.a.Dy(e,!0);return 0>d?(d=this.a.Cb(e),this.a.lF(d),this.a.Wi(e,this.a.Ua(d)),!0):!1}this.Ak=this.a.Uv();this.kn=this.a.Uv();for(e=this.a.Vb(this.U);-1!=e;e=this.a.bc(e))this.a.Rp(e,this.Ak,0),this.a.Rp(e,this.kn,-1);e=new a.ga(0);this.Zg=NaN;var b=new a.b;this.lr=this.a.ea(this.U);this.fn=this.a.re();this.br=this.a.re();for(var h=this.Dk.gc(this.Dk.Wd);-1!=h;h=this.Dk.bb(h)){var c=this.Dk.getData(h);this.a.uc(c,b);b.y!=this.Zg&&0!=e.size&&(d=this.yr(e)||d,this.Ld.reset(),e.clear(!1));
e.add(c);this.Zg=b.y;if(0==this.lr)break}0<this.lr&&(d=this.yr(e)||d,e.clear(!1));this.a.bf(this.fn);this.a.bf(this.br);for(e=this.a.Vb(this.U);-1!=e;)if(3==this.a.Ei(e,this.Ak)){this.a.Dy(e,!0);b=e;for(e=this.a.Ei(e,this.kn);-1!=e;)h=this.a.Ei(e,this.kn),this.a.bQ(this.U,this.a.bc(b),e),b=e,e=h;e=this.a.bc(b)}else this.a.Dy(e,!1),e=this.a.bc(e);this.a.ty(this.Ak);this.a.ty(this.kn);return d};d.prototype.yr=function(d){return this.WQ(d)};d.prototype.WQ=function(d){var e=!1;null==this.$a&&(this.$a=
new b(this.a));null==this.Rl?(this.Rl=new a.ga(0),this.Rl.xb(16)):this.Rl.clear(!1);this.VQ(d);for(var g=0,h=d.size;g<h;g++){var c=d.get(g);-1!=c&&this.bD(c,-1)}for(g=0;g<this.Rl.size&&0<this.lr;g++)if(d=this.Rl.get(g),c=this.$a.Dw(this.Za.da(d)),h=-1,0==this.a.Ei(c,this.Ak)){for(var c=this.Za.ge(d),p=d,f;-1!=c;){var l=this.Za.da(c),q=this.$a.Dw(l),n=this.a.Ei(q,this.Ak);if(0!=n){h=q;break}p=c;c=this.Za.ge(c)}-1==c?(f=!0,c=p):(l=this.Za.da(c),f=this.$a.ot(l),c=this.Za.bb(c),f=!f);do{l=this.Za.da(c);
q=this.$a.Dw(l);n=this.a.Ei(q,this.Ak);if(0==n&&(f!=this.$a.ot(l)&&(e=this.a.Cb(q),this.a.lF(e),this.a.Wi(q,this.a.Ua(e)),e=!0),this.a.Rp(q,this.Ak,f?3:2),f||(p=this.a.Ei(h,this.kn),this.a.Rp(h,this.kn,q),this.a.Rp(q,this.kn,p)),this.lr--,0==this.lr))return e;h=q;p=c;c=this.Za.bb(c);f=!f}while(p!=d)}return e};d.prototype.VQ=function(d){for(var e=0,a=d.size;e<a;e++){var g=d.get(e),b=this.a.Ra(g,this.fn),h=this.a.Ra(g,this.br);if(-1!=b){var c=this.Za.da(b);this.$a.hC(c);this.a.lb(g,this.fn,-1)}-1!=
h&&(c=this.Za.da(h),this.$a.hC(c),this.a.lb(g,this.br,-1));c=-1;-1!=b&&-1!=h?(this.Za.kd(b,-1),this.Za.kd(h,-1),d.set(e,-1)):c=-1!=b?b:h;-1!=c&&(this.bD(g,c)||this.Za.kd(c,-1),d.set(e,-1))}};d.prototype.bD=function(d,e){var g=new a.b,b=new a.b;this.a.uc(d,g);var h=this.a.X(d);this.a.uc(h,b);var m=!1;if(g.y<b.y){var m=!0,c=this.$a.GE(d),p;-1==e?p=this.Za.addElement(c,-1):(p=e,this.Za.Vi(p,c));c=this.a.Ra(h,this.fn);-1==c?this.a.lb(h,this.fn,p):this.a.lb(h,this.br,p);h=this.a.rd(d);0==this.a.Ei(h,this.Ak)&&
this.Rl.add(p)}h=this.a.Ua(d);this.a.uc(h,b);g.y<b.y&&(m=!0,c=this.$a.GE(h),-1==e?p=this.Za.addElement(c,-1):(p=e,this.Za.Vi(p,c)),c=this.a.Ra(h,this.fn),-1==c?this.a.lb(h,this.fn,p):this.a.lb(h,this.br,p),h=this.a.rd(d),0==this.a.Ei(h,this.Ak)&&this.Rl.add(p));return m};d.$=function(e,a,b,h){var g=new d;g.a=e;g.U=a;g.Dk=b;g.Qt=h;return g.XM()};d.prototype.YM=function(){var d=new a.ga(0),e=new a.ga(0),b=-1,h=-1,c=new a.b;c.Eh();for(var p=-1,f=-1,l=-1,q=new a.b,n=this.Dk.gc(this.Dk.Wd);-1!=n;n=this.Dk.bb(n)){var z=
this.Dk.getData(n);this.a.uc(z,q);var k=this.a.rd(z);c.ub(q)&&f==k?(-1==h&&(b=this.a.Uv(),h=this.a.re()),-1==l&&(l=e.size,this.a.lb(p,h,l),e.add(1),-1==this.a.Ei(k,b)&&(this.a.Rp(k,b,p),d.add(k))),this.a.lb(z,h,l),e.JF(e.tc()+1)):(l=-1,c.J(q));p=z;f=k}if(0==d.size)return!1;c=new a.ga(0);p=new a.ga(0);f=0;for(l=d.size;f<l;f++){var k=d.get(f),t=this.a.Ei(k,b),z=this.a.Ra(t,h);c.clear(!1);p.clear(!1);c.add(t);p.add(z);for(z=this.a.X(t);z!=t;z=this.a.X(z)){var v=z,q=this.a.Ra(v,h);if(-1!=q)if(0==p.size)p.add(q),
c.add(v);else if(p.tc()==q){var n=c.tc(),A=this.a.X(n),t=this.a.X(v);this.a.Sc(n,t);this.a.Tc(t,n);this.a.Sc(v,A);this.a.Tc(A,v);v=[!1];A=this.a.aD(this.U,A,this.a.Cb(k),v);this.a.lb(z,h,-1);v[0]&&this.a.Dh(k,t);z=this.a.Ha(k);t=this.a.Ha(A);z-=t;this.a.hm(k,z);e.set(q,e.get(q)-1);1==e.get(q)&&(e.set(q,0),p.af(),c.af());z=t=n}else c.add(z),p.add(q)}}this.a.ty(b);this.a.bf(h);return!0};return d}();a.AI=e})(A||(A={}));(function(a){var b=function(){function b(){}b.prototype.Ag=function(){this.Mx=this.ib=
null};b.prototype.get=function(){return this.Mx};b.prototype.set=function(e){this.Mx=e;if(null!=e)throw 322==e.D()&&(this.ib=e),a.g.wa();};b.prototype.create=function(e){if(322==e)this.mq();else throw a.g.ra("Not Implemented");};b.prototype.mq=function(){null==this.ib&&(this.ib=new a.yb);this.Mx=this.ib};return b}();a.Ag=b})(A||(A={}));(function(a){a=a.FI||(a.FI={});a[a.enumLineSeg=1]="enumLineSeg";a[a.enumBezierSeg=2]="enumBezierSeg";a[a.enumArcSeg=4]="enumArcSeg";a[a.enumNonlinearSegmentMask=6]=
"enumNonlinearSegmentMask";a[a.enumSegmentMask=7]="enumSegmentMask";a[a.enumDensified=8]="enumDensified"})(A||(A={}));(function(a){var b=function(){return function(e){this.ri=e;this.dz=this.ez=1;this.ky=this.jy=this.ly=0}}(),h=function(){function e(){this.op=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Ij=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.nf=new a.Va;this.ka=this.fu=0;this.an=[];this.ir=[];this.bu=[];this.qp=[];this.Jx=[]}e.prototype.ny=function(d){if(null!=d){for(var e=0,a=d.length;e<a;e++)this.oR(d[e]);
d.length=0}};e.prototype.oR=function(d){d.ri=null;this.qp.push(d)};e.prototype.nu=function(d){if(0===this.qp.length)var e=new b(d);else e=this.qp[this.qp.length-1],e.ri=d,--this.qp.length;return e};e.prototype.dO=function(d,e){return 0==d?this.ir[e]:this.bu[e]};e.prototype.Zx=function(){this.fu>=this.Jx.length&&this.Jx.push(new a.Ag);var d=this.Jx[this.fu];this.fu++;return d};e.prototype.clear=function(){this.ny(this.an);this.ny(this.ir);this.ny(this.bu);this.fu=0};e.prototype.zn=function(d){this.an.push(this.nu(d))};
e.prototype.kk=function(d){return 0==d?this.ir.length:this.bu.length};e.prototype.Io=function(d,e){return this.dO(d,e).ri};e.prototype.Ga=function(d,e){if(2!=this.an.length)throw a.g.wa();this.ka=d;var g=a.vi.Ty(.01*d),b=!1,h=this.an[0],c=this.an[1];if(e||0!=(h.ri.fq(c.ri,d,!0)&5)){if(322==h.ri.D()&&(e=h.ri,322==c.ri.D())){var p=c.ri,f=a.yb.ov(e,p,null,this.op,this.Ij,d);if(0==f)throw a.yb.ov(e,p,null,this.op,this.Ij,d),a.g.wa();d=Array(9);a.I.Ps(d,null);for(var l=0;l<f;l++){var q=this.op[l],n=this.Ij[l],
z=h.ky,k=1;0==q?(z=h.ly,k=h.ez):1==q&&(z=h.jy,k=h.dz);var t=c.ky,v=1;0==n?(t=c.ly,v=c.ez):1==n&&(t=c.jy,v=c.dz);var A=new a.b;z==t?(z=new a.b,e.Kb(q,z),q=new a.b,p.Kb(n,q),n=k+v,v/=n,a.vi.BD(z,q,v,A),a.b.Zb(A,z)+a.b.Zb(A,q)>g&&(b=!0)):z>t?(e.Kb(q,A),q=new a.b,p.Kb(n,q),a.b.Zb(A,q)>g&&(b=!0)):(p.Kb(n,A),z=new a.b,e.Kb(q,z),a.b.Zb(A,z)>g&&(b=!0));d[l]=A}h=0;c=-1;for(l=0;l<=f;l++)v=l<f?this.op[l]:1,v!=h&&(g=this.Zx(),e.Bi(h,v,g),-1!=c&&g.get().ed(d[c]),l!=f&&g.get().vd(d[l]),h=v,this.ir.push(this.nu(g.get()))),
c=l;e=[0,0,0,0,0,0,0,0,0];for(l=0;l<f;l++)e[l]=l;1<f&&this.Ij[0]>this.Ij[1]&&(v=this.Ij[0],this.Ij[0]=this.Ij[1],this.Ij[1]=v,l=e[0],e[0]=e[1],e[1]=l);h=0;c=-1;for(l=0;l<=f;l++)v=l<f?this.Ij[l]:1,v!=h&&(g=this.Zx(),p.Bi(h,v,g),-1!=c&&(h=e[c],g.get().ed(d[h])),l!=f&&(h=e[l],g.get().vd(d[h])),h=v,this.bu.push(this.nu(g.get()))),c=l;return b}throw a.g.wa();}return!1};e.prototype.Tw=function(d,e,b){e.copyTo(this.nf);if(1!=this.an.length)throw a.g.wa();this.ka=d;var g=this.an[0];if(b||g.ri.qs(e.w(),d,
!0))if(322==g.ri.D()){d=g.ri;var h=d.Gd(e.w(),!1);this.op[0]=h;var c=g.ky;b=1;0==h?(c=g.ly,b=g.ez):1==h&&(c=g.jy,b=g.dz);g=new a.b;0==c?(c=new a.b,d.Kb(h,c),e=e.w(),a.vi.BD(c,e,1/(b+1),g)):0<c?(g=new a.b,d.Kb(h,g)):g=e.w();b=0;h=-1;for(c=0;1>=c;c++){e=1>c?this.op[c]:1;if(e!=b){var m=this.Zx();d.Bi(b,e,m);-1!=h&&m.get().ed(g);1!=c&&m.get().vd(g);b=e;this.ir.push(this.nu(m.get()))}h=c}this.nf.ic(g)}else throw a.g.wa();};return e}();a.gA=h})(A||(A={}));(function(a){var b=function(){function b(e){this.Pq=
this.yj=this.ib=null;this.zk=this.Ee=this.Gc=this.ze=this.Sg=this.Qa=0;this.ab=null;this.zl=!1;this.ze=-1;this.Sg=this.Gc=0;this.Qa=-1;this.ab=e;this.Ee=this.eq(this.Sg);this.zl=!1;this.yj=null;this.zk=-1;this.Pq=new a.b}b.Yn=function(e,d){if(0>d||d>=e.F())throw a.g.Uc();var g=new b(e),h=e.Ew(d);g.Gc=d-e.Ea(h);g.Sg=h+1;g.Qa=h;g.Ee=g.eq(g.Qa);g.zk=g.ab.Ea(g.Qa);return g};b.Un=function(e,d,g){if(0>d||d>=e.ea()||0>g)throw a.g.Uc();var h=e.vc(d)?0:1;if(g>=e.Ha(d)-h)throw a.g.Uc();e=new b(e);e.ze=-1;e.Gc=
g;e.Qa=d;e.Sg=e.Gc+1;e.Ee=e.eq(e.Sg);e.zk=e.ab.Ea(e.Qa);return e};b.prototype.xR=function(e){if(this.ab!=e.ab)throw a.g.xa();this.ze=e.ze;this.Gc=e.Gc;this.Qa=e.Qa;this.Sg=e.Sg;this.Ee=e.Ee;this.zl=e.zl;this.zk=e.zk;this.yj=null};b.prototype.ia=function(){this.ze!=this.Gc&&this.JA();if(this.zl)this.Gc=(this.Gc+1)%this.Ee;else{if(this.Gc==this.Ee)throw a.g.Uc();this.Gc++}return this.yj};b.prototype.oi=function(){if(this.zl)this.Gc=(this.Ee+this.Gc-1)%this.Ee;else{if(0==this.Gc)throw a.g.Uc();this.Gc--}this.Gc!=
this.ze&&this.JA();return this.yj};b.prototype.yR=function(){this.ze=-1;this.Gc=0};b.prototype.zR=function(){this.Gc=this.Ee;this.ze=-1};b.prototype.Sb=function(e,d){void 0===d&&(d=-1);if(0<=this.Qa&&this.Qa<this.ab.ea()){var a=this.uJ();if(e>=a&&e<this.ab.Dc(this.Qa)){this.ze=-1;this.Gc=e-a;return}}a=0<=d&&d<this.ab.ea()&&e>=this.ab.Ea(d)&&e<this.ab.Dc(d)?d:this.ab.Ew(e);this.Sg=a+1;this.Qa=a;this.ze=-1;this.Gc=e-this.ab.Ea(a);this.Ee=this.eq(a);this.zk=this.ab.Ea(this.Qa)};b.prototype.kb=function(){this.Qa=
this.Sg;if(this.Qa>=this.ab.ea())return!1;this.ze=-1;this.Gc=0;this.Ee=this.eq(this.Qa);this.zk=this.ab.Ea(this.Qa);this.Sg++;return!0};b.prototype.Lk=function(){this.Ee=this.Gc=this.ze=-1;this.Sg=0;this.zk=this.Qa=-1};b.prototype.vy=function(e){if(0>e)throw a.g.Uc();this.Sg=e;this.zk=this.Ee=this.Gc=this.ze=this.Qa=-1};b.prototype.eq=function(e){if(this.ab.sc())return 0;var d=1;this.ab.vc(e)&&(d=0);return this.ab.Ha(e)-d};b.prototype.lD=function(){return this.ze==this.Ee-1&&this.ab.vc(this.Qa)};
b.prototype.NR=function(){this.zl=!0};b.prototype.Jb=function(){return this.ab.jb.f[this.Qa]+this.ze};b.prototype.uJ=function(){return this.ab.Ea(this.Qa)};b.prototype.Bm=function(){return this.lD()?this.ab.Ea(this.Qa):this.Jb()+1};b.prototype.wl=function(){return 0==this.ze};b.prototype.Jm=function(){return this.ze==this.Ee-1};b.prototype.La=function(){return this.Gc<this.Ee};b.prototype.Ow=function(){return 0<this.Gc};b.prototype.vm=function(){var e=new b(this.ab);e.ze=this.ze;e.Gc=this.Gc;e.Ee=
this.Ee;e.Qa=this.Qa;e.Sg=this.Sg;e.ab=this.ab;e.zl=this.zl;return e};b.prototype.JA=function(){if(0>this.Gc||this.Gc>=this.Ee)throw a.g.Uc();this.ze=this.Gc;var e=this.Jb();this.ab.kc();var d=this.ab.Fe,g=1;null!=d&&(g=d.read(e)&7);d=this.ab.description;switch(g){case 1:null==this.ib&&(this.ib=new a.yb);this.yj=this.ib;break;case 2:throw a.g.ra("internal error");case 4:throw a.g.wa();default:throw a.g.wa();}this.yj.Qf(d);g=this.Bm();this.ab.uc(e,this.Pq);this.yj.ed(this.Pq);this.ab.uc(g,this.Pq);
this.yj.vd(this.Pq);for(var b=1,h=d.Aa;b<h;b++)for(var c=d.Hd(b),p=a.pa.Wa(c),f=0;f<p;f++){var l=this.ab.ld(c,e,f);this.yj.My(c,f,l);l=this.ab.ld(c,g,f);this.yj.Cy(c,f,l)}};b.prototype.YO=function(){return this.Qa==this.ab.ea()-1};return b}();a.GI=b})(A||(A={}));(function(a){var b=function(){function b(e){e instanceof a.T?(this.ZD=e,this.ua=-1,this.Wh=1):(this.DP=e.slice(0),this.ua=-1,this.Wh=e.length)}b.prototype.ya=function(){return this.ua};b.prototype.next=function(){return this.ua<this.Wh-1?
(this.ua++,null!=this.ZD?this.ZD:this.DP[this.ua]):null};return b}();a.Pc=b})(A||(A={}));(function(a){var b=function(){return function(){this.next=null}}(),h=function(){function e(){this.Cp=this.ju=this.ku=this.vj=this.eh=0;this.aC=!1;this.eG=0;this.am=this.wf=this.Vk=this.hh=null;this.Mk=0;this.Kv=null;this.vj=this.eh=-1}e.prototype.vS=function(d,e,b){this.eh=d;this.vj=e;this.hh=this.Vk=null;this.Cp=0;this.Kv=b;null==this.am&&(this.am=a.I.Lh(384,0));this.hG()};e.prototype.aa=function(){return this.eh};
e.prototype.ba=function(){return this.vj};e.prototype.flush=function(){0<this.Mk&&(this.Kv.XB(this.am,this.Mk),this.Mk=0)};e.prototype.hG=function(){if(0<this.Cp){for(var d=0;d<this.vj;d++){for(var e=this.Vk[d];null!=e;){var a=e,e=e.next;a.next=null}this.Vk[d]=null}this.hh=null}this.ku=this.vj;this.ju=-1;this.Cp=0};e.prototype.fF=function(d){this.aC=d==e.$u;for(d=this.ku;d<=this.ju;d++)this.VJ(),this.PJ(d),this.vM();this.hG()};e.prototype.zv=function(d,e,h,c){if(e!=c){var g=1;e>c&&(g=d,d=h,h=g,g=
e,e=c,c=g,g=-1);if(!(0>c||e>=this.vj)){0>d&&0>h?h=d=-1:d>=this.eh&&h>=this.eh&&(h=d=this.eh);var m=(h-d)/(c-e);c>this.vj&&(c=this.vj,h=m*(c-e)+d);0>e&&(d=m*(0-e)+d,e=0);var p=Math.max(this.eh+1,8388607);-8388607>d?(e=(0-d)/m+e,d=0):d>p&&(e=(this.eh-d)/m+e,d=this.eh);-8388607>h?c=(0-d)/m+e:h>p&&(c=(this.eh-d)/m+e);e=a.I.truncate(e);c=a.I.truncate(c);e!=c&&(h=new b,h.x=a.I.truncate(4294967296*d),h.y=e,h.G=c,h.pM=a.I.truncate(4294967296*m),h.dir=g,null==this.Vk&&(this.Vk=a.I.Lh(this.vj,null)),h.next=
this.Vk[h.y],this.Vk[h.y]=h,h.y<this.ku&&(this.ku=h.y),h.G>this.ju&&(this.ju=h.G),this.Cp++)}}};e.prototype.VJ=function(){if(null!=this.hh){for(var d=!1,e=null,a=this.hh;null!=a;)if(a.y++,a.y==a.G){var b=a,a=a.next;null!=e?e.next=a:this.hh=a;b.next=null}else a.x+=a.pM,null!=e&&e.x>a.x&&(d=!0),e=a,a=a.next;d&&(this.hh=this.dG(this.hh))}};e.prototype.PJ=function(d){if(!(d>=this.vj)){var e=this.Vk[d];if(null!=e){this.Vk[d]=null;e=this.dG(e);this.Cp-=this.eG;d=this.hh;for(var a=!0,b=e,h=null;null!=d&&
null!=b;)d.x>b.x?(a&&(this.hh=b),a=b.next,b.next=d,null!=h&&(h.next=b),h=b,b=a):(a=d.next,d.next=b,null!=h&&(h.next=d),h=d,d=a),a=!1;null==this.hh&&(this.hh=e)}}};e.Mz=function(d,e){return 0>d?0:d>e?e:d};e.prototype.vM=function(){if(null!=this.hh)for(var d=0,g=this.hh,b=a.I.truncate(a.I.FD(g.x)),h=g.next;null!=h;h=h.next)if(d=this.aC?d^1:d+h.dir,h.x>g.x){var c=a.I.truncate(a.I.FD(h.x));0!=d&&(g=e.Mz(b,this.eh),b=e.Mz(c,this.eh),b>g&&g<this.eh&&(this.am[this.Mk++]=g,this.am[this.Mk++]=b,this.am[this.Mk++]=
h.y,this.Mk==this.am.length&&(this.Kv.XB(this.am,this.Mk),this.Mk=0)));g=h;b=c}};e.prototype.dG=function(d){for(var g=0,b=d;null!=b;b=b.next)g++;this.eG=g;if(1==g)return d;null==this.wf?this.wf=a.I.Lh(Math.max(g,16),null):this.wf.length<g&&(this.wf=a.I.Lh(Math.max(g,2*this.wf.length),null));for(var h=0,b=d;null!=b;b=b.next)this.wf[h++]=b;2==g?this.wf[0].x>this.wf[1].x&&(d=this.wf[0],this.wf[0]=this.wf[1],this.wf[1]=d):e.pP(this.wf,g,function(d,e){return d==e?0:d.x<e.x?-1:d.x>e.x?1:0});d=this.wf[0];
this.wf[0]=null;b=d;for(h=1;h<g;h++)b.next=this.wf[h],b=this.wf[h],this.wf[h]=null;b.next=null;return d};e.pP=function(d,e,a){if(e==d.length)d.sort(a);else{var g=d.slice(0,0),b=d.slice(e);e=d.slice(0,e).sort(a);d.length=0;d.push.apply(d,g.concat(e).concat(b))}};e.$u=0;e.sT=1;return e}();a.ev=h})(A||(A={}));(function(a){var b=function(){function b(){}b.prototype.Jh=function(e,d){var a=this.a.Ra(e,this.vp);this.yk==a&&(this.yk=this.$d.bb(this.yk));this.Xm==a&&(this.Xm=this.$d.bb(this.Xm));this.$d.Jc(this.Ox,
a);this.hj(e);if(d&&(a=this.a.rd(e),-1!=a&&this.a.Cb(a)==e)){d=this.a.X(e);if(d!=e){var b=this.a.rd(d);if(b==a){this.a.Dh(a,d);return}d=this.a.Ua(e);if(d!=e&&(b=this.a.rd(d),b==a)){this.a.Dh(a,d);return}}this.a.Dh(a,-1);this.a.Wi(a,-1)}};b.prototype.yA=function(){for(var e=!1,d=0,g=new a.b;;){d++;null==this.nh?(this.nh=new a.ga(0),this.Mq=new a.ga(0),this.ie=new a.ga(0)):(this.nh.clear(!1),this.Mq.clear(!1),this.ie.clear(!1));for(var b=this.Xm,h=0,c=!0;b!=this.yk;){var p=this.$d.getData(b),f=new a.b;
this.a.uc(p,f);c&&(this.a.uc(p,g),c=!1);var f=this.a.Ua(p),l=this.a.X(p);-559038737!=this.a.Ra(f,this.fg)&&(this.nh.add(f),this.a.lb(f,this.fg,-559038737),this.Mq.add(p),this.ie.add(h++));-559038737!=this.a.Ra(l,this.fg)&&(this.nh.add(l),this.a.lb(l,this.fg,-559038737),this.Mq.add(p),this.ie.add(h++));b=this.$d.bb(b)}if(2>this.nh.size)break;var q=this;this.ie.xd(0,this.ie.size,function(d,e){return q.mJ(d,e)});b=0;for(h=this.ie.size;b<h;b++)c=this.ie.get(b),c=this.nh.get(c),this.a.lb(c,this.fg,b),
f=new a.b,this.a.uc(c,f);f=this.zJ(g);b=0;for(h=this.ie.size;b<h;b++)c=this.ie.get(b),-1!=c&&(c=this.nh.get(c),this.a.lb(c,this.fg,-1));if(f)e=!0;else break}return e};b.prototype.zJ=function(e){for(var d=!1,a=!0;a;){var a=!1,b=0;-1==this.ie.get(b)&&(b=this.fl(b));for(var h=this.fl(b),c=0,p=this.ie.size;c<p&&-1!=b&&-1!=h&&b!=h;c++){var f=this.ie.get(b),h=this.ie.get(h),f=this.nh.get(f),h=this.nh.get(h),l=this.a.X(f);this.a.pt(l,e)||(l=this.a.Ua(f));var q=this.a.X(h);this.a.pt(q,e)||(q=this.a.Ua(h));
var n=this.os(l,f),z=this.os(q,h),k=n?this.a.Ua(l):this.a.X(l),t=z?this.a.Ua(q):this.a.X(q),v=!1;this.io(l)?v=!0:this.io(q)?v=!0:this.io(f)?v=!0:this.io(h)?v=!0:this.io(k)?v=!0:this.io(t)&&(v=!0);!v&&this.a.Cq(f,h)&&(v=!0,this.BA(n,z,l,f,q,h));!v&&this.a.Cq(k,t)&&(v=!0,this.BA(!n,!z,l,k,q,t));v&&(d=!0);a=a||v;b=this.fl(b);h=this.fl(b)}}if(!d)for(b=0,-1==this.ie.get(b)&&(b=this.fl(b)),h=this.fl(b),c=0,p=this.ie.size;c<p&&-1!=b&&-1!=h&&b!=h;c++)f=this.ie.get(b),h=this.ie.get(h),f=this.nh.get(f),h=this.nh.get(h),
l=this.a.X(f),this.a.pt(l,e)||(l=this.a.Ua(f)),q=this.a.X(h),this.a.pt(q,e)||(q=this.a.Ua(h)),n=this.os(l,f),z=this.os(q,h),k=n?this.a.Ua(l):this.a.X(l),t=z?this.a.Ua(q):this.a.X(q),this.qJ(n,z,f,l,k,h,q,t)&&(d=!0),b=this.fl(b),h=this.fl(b);return d};b.prototype.CJ=function(){1736==this.a.Lb(this.U)&&1==this.a.Cm(this.U)&&(new a.Of).DQ(this.Qt,this.a,this.U,this.oe);var e=!1,d=!0;this.fg=this.vp=-1;var g=this.a.F(this.U),b=new a.ga(0);b.xb(g);for(var h=this.a.Vb(this.U);-1!=h;h=this.a.bc(h))for(var c=
this.a.Cb(h),p=0,f=this.a.Ha(h);p<f;p++)b.add(c),c=this.a.X(c);var l=this.a.cd.f,q=this.a.cd.Ic;this.a.wb.kc();var n=this.a.wb.Ba[0].f;b.xd(0,g,function(d,e){var a=l[q*d],g=l[q*e],b=n[2*a],a=n[2*a+1],h=n[2*g],g=n[2*g+1],b=a<g?-1:a>g?1:b<h?-1:b>h?1:0;0==b&&(b=l[q*d+3],g=l[q*e+3],b=b<g?-1:b==g?0:1);return b});this.vp=this.a.re();this.$d=new a.$n;this.Ox=this.$d.jh(0);this.$d.$l(g);for(h=0;h<g;h++)c=b.get(h),p=this.$d.addElement(this.Ox,c),this.a.lb(c,this.vp,p);this.fg=this.a.re();this.yk=-1;for(this.sA()&&
(e=!0);d;){d=!1;g=0;b=!1;do{b=!1;this.Xm=-1;for(var f=0,h=new a.b,p=new a.b,z=this.$d.gc(this.Ox);-1!=z;)c=this.$d.getData(z),-1!=this.Xm?(this.a.uc(c,p),h.ub(p))?f++:(h.J(p),this.yk=z,0<f&&(c=this.yA())&&(b=!0,-1!=this.yk&&(c=this.$d.getData(this.yk),this.a.uc(c,h))),this.Xm=z=this.yk,f=0):(this.Xm=z,this.a.uc(this.$d.getData(z),h),f=0),-1!=z&&(z=this.$d.bb(z));this.yk=-1;0<f&&(c=this.yA())&&(b=!0);if(10<g++)throw a.g.wa();b&&this.tJ();this.sA()&&(b=!0);d=d||b&&!1;e=e||b}while(b)}this.a.bf(this.vp);
this.a.bf(this.fg);return e=a.AI.$(this.a,this.U,this.$d,this.Qt)||e};b.prototype.os=function(e,d){return this.a.X(d)==e?!1:!0};b.prototype.qJ=function(e,d,a,b,h,c,p,f){if(b==p)return this.hj(a),this.hj(c),!1;var g=this.a.Ra(a,this.fg),m=this.a.Ra(h,this.fg),l=this.a.Ra(c,this.fg),q=this.a.Ra(f,this.fg);a=[0,0,0,0,0,0,0,0];var n=[0,0,0,0];a[0]=0;n[0]=g;a[1]=0;n[1]=m;a[2]=1;n[2]=l;a[3]=1;n[3]=q;for(g=1;4>g;g++){m=n[g];l=a[g];for(q=g-1;0<=q&&n[q]>m;)n[q+1]=n[q],a[q+1]=a[q],q--;n[q+1]=m;a[q+1]=l}n=0;
0!=a[0]&&(n|=1);0!=a[1]&&(n|=2);0!=a[2]&&(n|=4);0!=a[3]&&(n|=8);if(5!=n&&10!=n)return!1;e==d?e?(this.a.Sc(f,b),this.a.Tc(b,f),this.a.Sc(h,p),this.a.Tc(p,h)):(this.a.Tc(f,b),this.a.Sc(b,f),this.a.Tc(h,p),this.a.Sc(p,h)):e?(this.a.Tc(b,c),this.a.Sc(c,b),this.a.Tc(p,h),this.a.Sc(h,p)):(this.a.Sc(b,c),this.a.Tc(c,b),this.a.Sc(p,h),this.a.Tc(h,p));return!0};b.prototype.BA=function(e,d,a,b,h,c){this.pU?this.BJ():this.AJ(e,d,a,b,h,c)};b.prototype.BJ=function(){throw a.g.ra("not implemented.");};b.prototype.AJ=
function(e,d,a,b,h,c){if(e!=d)e?(this.a.Sc(a,h),this.a.Tc(h,a),this.a.Sc(c,b),this.a.Tc(b,c),this.pm(h,a),this.Jh(h,!0),this.a.Ui(h,!0),this.hj(a),this.pm(c,b),this.Jh(c,!0),this.a.Ui(c,!1)):(this.a.Sc(h,a),this.a.Tc(a,h),this.a.Sc(b,c),this.a.Tc(c,b),this.pm(h,a),this.Jh(h,!0),this.a.Ui(h,!1),this.hj(a),this.pm(c,b),this.Jh(c,!0),this.a.Ui(c,!0)),this.hj(b);else{var g=e?a:b,m=d?h:c;e=e?b:a;d=d?c:h;h=!1;this.a.Sc(g,m);this.a.Sc(m,g);this.a.Tc(e,d);this.a.Tc(d,e);for(c=d;c!=m;)a=this.a.Ua(c),b=this.a.X(c),
this.a.Tc(c,b),this.a.Sc(c,a),h=h||c==g,c=b;h||(a=this.a.Ua(m),b=this.a.X(m),this.a.Tc(m,b),this.a.Sc(m,a));this.pm(m,g);this.Jh(m,!0);this.a.Ui(m,!1);this.hj(g);this.pm(d,e);this.Jh(d,!0);this.a.Ui(d,!1);this.hj(e)}};b.prototype.sA=function(){for(var e=!1,d=this.a.Vb(this.U);-1!=d;){for(var a=this.a.Cb(d),b=0,h=this.a.Ha(d);b<h&&1<h;){var c=this.a.Ua(a),p=this.a.X(a);this.a.Cq(c,p)?(e=!0,this.Jh(a,!1),this.a.vf(a,!0),this.Jh(p,!1),this.a.vf(p,!0),a=c,b=0,h=this.a.Ha(d)):(a=p,b++)}if(2>this.a.Ha(d)){e=
this.a.Cb(d);b=0;for(h=this.a.Ha(d);b<h;b++)this.Jh(e,!1),e=this.a.X(e);d=this.a.Cr(d);e=!0}else d=this.a.bc(d)}return e};b.prototype.io=function(e){for(var d=!1;;){var a=this.a.X(e),b=this.a.Ua(e);if(a==e)return this.Jh(e,!0),this.a.Ui(e,!1),!0;if(!this.a.Cq(a,b))break;d=!0;this.hj(b);this.hj(a);this.Jh(e,!0);this.a.Ui(e,!1);this.pm(a,b);this.Jh(a,!0);this.a.Ui(a,!0);if(a==b)break;e=b}return d};b.prototype.tJ=function(){for(var e=0,d=this.$d.gc(this.$d.Wd);-1!=d;d=this.$d.bb(d)){var a=this.$d.getData(d);
this.a.im(a,-1)}for(var b=0,h=this.a.Vb(this.U);-1!=h;)if(d=this.a.Cb(h),-1==d||-1!=this.a.rd(d))a=h,h=this.a.bc(h),this.a.yu(a);else{this.a.im(d,h);for(var c=1,a=this.a.X(d);a!=d;a=this.a.X(a))this.a.im(a,h),c++;this.a.Jr(h,!1);this.a.hm(h,c);this.a.Wi(h,this.a.Ua(d));b+=c;e++;h=this.a.bc(h)}for(d=this.$d.gc(this.$d.Wd);-1!=d;d=this.$d.bb(d))a=this.$d.getData(d),-1==this.a.rd(a)&&(h=this.a.aD(this.U,a,a,null),b+=this.a.Ha(h),e++);this.a.gm(this.U,e);this.a.Pk(this.U,b);e=0;for(b=this.a.$c;-1!=b;b=
this.a.we(b))e+=this.a.F(b);this.a.ZF(e)};b.prototype.fl=function(e){for(var d=0,a=this.ie.size-1;d<a;d++)if(e=(e+1)%this.ie.size,-1!=this.ie.get(e))return e;return-1};b.prototype.pm=function(e,d){var a=this.a.Ra(d,this.vp),b=this.a.Ra(d,this.fg);this.a.Zy(e,d);this.a.lb(d,this.vp,a);this.a.lb(d,this.fg,b)};b.prototype.hj=function(e){var d=this.a.Ra(e,this.fg);-1!=d&&(this.ie.set(d,-1),this.a.lb(e,this.fg,-1))};b.$=function(e,d,a,h,c){var g=new b;g.a=e;g.U=d;g.yx=a;g.Qt=h;g.oe=c;return g.CJ()};b.prototype.mJ=
function(e,d){var g=this.nh.get(e),b=new a.b;this.a.uc(g,b);var g=new a.b,h=this.nh.get(d);this.a.uc(h,g);if(b.ub(g))return 0;e=this.Mq.get(e);h=new a.b;this.a.uc(e,h);d=this.Mq.get(d);e=new a.b;this.a.uc(d,e);d=new a.b;d.pc(b,h);b=new a.b;b.pc(g,e);return a.b.cq(d,b)};return b}();a.mm=b})(A||(A={}));(function(a){(function(a){a[a.Local=0]="Local";a[a.Geographic=1]="Geographic";a[a.Projected=2]="Projected";a[a.Unknown=3]="Unknown"})(a.HI||(a.HI={}));(function(a){a[a.Integer32=0]="Integer32";a[a.Integer64=
1]="Integer64";a[a.FloatingPoint=2]="FloatingPoint"})(a.rI||(a.rI={}));var b=function(){function b(){this.fo="";this.mi=0;this.Sl=null}b.prototype.Qc=function(){return this.mi};b.prototype.Ko=function(){var e=.001;0!=this.mi?e=a.ls.SM(this.mi):null!=this.Sl&&(e=a.mA.TM(this.Sl));return e};b.prototype.Se=function(){if(0!=this.mi)return a.Tb.Qd(a.ls.cC(this.mi));if(null!=this.Sl)return a.mA.UM(this.Sl)};b.Am=function(e){if(0!=e.mi){if(!0===a.ls.WO(e.mi))return 1;if(!0===a.ls.ZO(e.mi))return 2}return 3};
b.create=function(e){if(0>=e)throw a.g.N("Invalid or unsupported wkid: "+e);var d=new b;d.mi=e;return d};b.NL=function(e){if(null==e||0==e.length)throw a.g.N("Cannot create SpatialReference from null or empty text.");var d=new b;d.Sl=e;return d};b.prototype.lc=function(e){return this==e?!0:null==e||this.constructor!=e.constructor||this.mi!=e.mi||0==this.mi&&this.Sl!==e.Sl?!1:!0};b.mN=function(e,d){var g=Math.PI/180,b=new a.ca;a.nH.pN(e.w().x*g,e.w().y*g,d.w().x*g,d.w().y*g,b);return b.l};b.prototype.toString=
function(){return"[ tol: "+this.xq()+"; wkid: "+this.Qc()+"; wkt: "+this.Sl+"]"};b.prototype.hc=function(){if(""!==this.fo)return this.fo;var e=this.toString();if(Array.prototype.reduce)return this.fo="S"+e.split("").reduce(function(d,e){d=(d<<5)-d+e.charCodeAt(0);return d&d},0);var d=0;if(0===e.length)return"";for(var a=0;a<e.length;a++)d=(d<<5)-d+e.charCodeAt(a),d&=d;return this.fo="S"+d};b.prototype.xq=function(){return this.Ko()};b.jU=!0;b.ET=2147483645;b.FT=9007199254740990;return b}();a.Nf=
b})(A||(A={}));(function(a){function b(d,e){89.99999<e?e=89.99999:-89.99999>e&&(e=-89.99999);e*=.017453292519943;return[111319.49079327169*d,3189068.5*Math.log((1+Math.sin(e))/(1-Math.sin(e)))]}function h(d,e,a){d=d/6378137*57.29577951308232;return a?[d,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*e/6378137)))]:[d-360*Math.floor((d+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*e/6378137)))]}function e(d,e){var g=d.vm();if(33===d.D()){var b=e(g.lk(),g.mk());
g.ic(b[0],b[1])}else if(197===d.D())b=e(d.R.v,d.R.C,!0),d=e(d.R.B,d.R.G,!0),g.K(b[0],b[1],d[0],d[1]);else for(b=new a.b,d=0;d<g.F();d++){g.w(d,b);var h=e(b.x,b.y,!0);b.ma(h[0],h[1]);g.ic(d,b)}return g}function d(d){return e(d,h)}function g(d){return e(d,b)}var c=function(){function d(){}d.Xr=function(d){var e=Math.PI/180,g=Math.sin(d.y*e);return a.b.Oa(6378137*d.x*e,3167719.6636462314*(g/(1-.006694379990197414*g*g)-6.111035746609262*Math.log((1-.0818191908429643*g)/(1+.0818191908429643*g))))};d.Wu=
function(d,e,g,b){var h=1/298.257223563,c=Math.sin(g);g=Math.cos(g);var m=(1-h)*Math.tan(d);d=1/Math.sqrt(1+m*m);for(var p=m*d,f=Math.atan2(m,g),m=d*c*d*c,l=1-m,q=2.7233160610754688E11*l/4.040829998466145E13,n=1+q/16384*(4096+q*(-768+q*(320-175*q))),z=q/1024*(256+q*(-128+q*(74-47*q))),q=b/(6356752.31424518*n),k=2*Math.PI,t,v,A,w;1E-12<Math.abs(q-k);)A=Math.cos(2*f+q),t=Math.sin(q),v=Math.cos(q),w=z*t*(A+z/4*(v*(-1+2*A*A)-z/6*A*(-3+4*t*t)*(-3+4*A*A))),k=q,q=b/(6356752.31424518*n)+w;b=p*t-d*v*g;l=h/
16*l*(4+h*(4-3*l));return a.b.Oa((e+(Math.atan2(t*c,d*v-p*t*g)-(1-l)*h*Math.sqrt(m)*(q+l*t*(A+l*v*(-1+2*A*A)))))/(Math.PI/180),Math.atan2(p*v+d*t*g,(1-h)*Math.sqrt(m+b*b))/(Math.PI/180))};d.cN=function(d,e,a,g){var b=1/298.257223563,h=g-e,c=Math.atan((1-b)*Math.tan(d)),m=Math.atan((1-b)*Math.tan(a)),p=Math.sin(c),c=Math.cos(c),f=Math.sin(m),m=Math.cos(m),l=h,q,n=1E3,z,k,t,v,A,w,y;do{t=Math.sin(l);v=Math.cos(l);k=Math.sqrt(m*t*m*t+(c*f-p*m*v)*(c*f-p*m*v));if(0===k)return 0;v=p*f+c*m*v;A=Math.atan2(k,
v);w=c*m*t/k;z=1-w*w;t=v-2*p*f/z;isNaN(t)&&(t=0);y=b/16*z*(4+b*(4-3*z));q=l;l=h+(1-y)*b*w*(A+y*k*(t+y*v*(-1+2*t*t)))}while(1E-12<Math.abs(l-q)&&0<--n);if(0===n)return p=g-e,{azimuth:Math.atan2(Math.sin(p)*Math.cos(a),Math.cos(d)*Math.sin(a)-Math.sin(d)*Math.cos(a)*Math.cos(p)),geodesicDistance:6371009*Math.acos(Math.sin(d)*Math.sin(a)+Math.cos(d)*Math.cos(a)*Math.cos(g-e))};d=2.7233160610754688E11*z/4.040829998466145E13;e=d/1024*(256+d*(-128+d*(74-47*d)));return{azimuth:Math.atan2(m*Math.sin(l),c*
f-p*m*Math.cos(l)),lN:6356752.31424518*(1+d/16384*(4096+d*(-768+d*(320-175*d))))*(A-e*k*(t+e/4*(v*(-1+2*t*t)-e/6*t*(-3+4*k*k)*(-3+4*t*t)))),yU:Math.atan2(c*Math.sin(l),c*f*Math.cos(l)-p*m)}};d.oT=function(d){var e=d.hasAttribute(1),g=d.hasAttribute(2),b=[],h=d.ea(),c=null,m=null;e&&(c=d.mc(1));g&&(m=d.mc(2));for(var p=new a.b,f=0;f<h;f++){for(var l=d.Ea(f),q=d.Ha(f),n=0,z=0,k=NaN,t=NaN,v=NaN,A=NaN,w=d.vc(f),y=[],u=l;u<l+q;u++){d.w(u,p);var A=v=NaN,D=[p.x,p.y];e&&(v=c.get(u),D.push(v));g&&(h=m.get(u),
D.push(A));u==l&&w&&(n=p.x,z=p.y,k=v,t=A);y.push(D)}!w||n==p.x&&z==p.y&&(!e||isNaN(k)&&isNaN(v)||k==v)&&(!g||isNaN(t)&&isNaN(A)||t==A)||y.push(y[0].slice(0));b.push(y)}return b};d.fw=function(e,a){e=d.oT(e);var g=Math.PI/180;637.100877151506>a&&(a=637.100877151506);for(var b=[],h=0;h<e.length;h++){var c=e[h],m;b.push(m=[]);m.push([c[0][0],c[0][1]]);var p,f,l,q,n,z;p=c[0][0]*g;f=c[0][1]*g;for(n=0;n<c.length-1;n++)if(l=c[n+1][0]*g,q=c[n+1][1]*g,p!==l||f!==q){q=d.cN(f,p,q,l);l=q.azimuth;q=q.lN;var k=
q/a;if(1<k){for(z=1;z<=k-1;z++){var t=d.Wu(f,p,l,z*a);m.push([t.x,t.y])}z=d.Wu(f,p,l,(q+Math.floor(k-1)*a)/2);m.push([z.x,z.y])}f=d.Wu(f,p,l,q);m.push([f.x,f.y]);p=f.x*g;f=f.y*g}}return{mF:b}};d.kN=function(e){for(var g=[],b=0;b<e.length;b++){var h=e[b],h=d.fw(h,1E4);g.push(h)}e=[];for(var c,m,p=0;p<g.length;p++){for(var h=g[p],f=0,b=0;b<h.mF.length;b++){var l=h.mF[b];c=d.Xr(a.b.Oa(l[0][0],l[0][1]));m=d.Xr(a.b.Oa(l[l.length-1][0],l[l.length-1][1]));var q=m.x*c.y-c.x*m.y,n;for(n=0;n<l.length-1;n++)c=
d.Xr(a.b.Oa(l[n+1][0],l[n+1][1])),m=d.Xr(a.b.Oa(l[n][0],l[n][1])),q+=m.x*c.y-c.x*m.y;q/=4046.87;f+=q}e.push(f/-2*4046.85642)}return e};return d}();a.oH=c;c=function(){function e(){}e.oy=function(d,a,g,b,h,c,m){e.AG[d.hc()]=a;0==isNaN(g)&&(e.CG[d.hc()]=g);0==isNaN(b)&&(e.iz[d.hc()]=b);0==isNaN(h)&&(e.lG[d.hc()]=h);e.EG[d.hc()]=c;null!==m&&(e.GG[d.hc()]=m)};e.xu=function(d,a,g){e.IG[d.hc()+"-"+a.hc()]=g};e.Em=function(d){d=e.AG[d.hc()];if(void 0==d)throw a.g.qe();return d};e.IC=function(d){d=e.CG[d.hc()];
if(void 0==d)throw a.g.qe();return d};e.ft=function(d){d=e.iz[d.hc()];if(void 0==d)throw a.g.qe();return d};e.Ts=function(d){d=e.lG[d.hc()];if(void 0==d)throw a.g.qe();return d};e.Fm=function(d){d=e.GG[d.hc()];if(void 0==d)throw a.g.qe();return a.i.Oa(d[0],d[1],d[2],d[3])};e.Qo=function(d){d=e.EG[d.hc()];if(void 0==d)throw a.g.qe();return d};e.Wl=function(d,g,b){if(g.lc(b))return d;var h=e.IG[g.hc()+"-"+b.hc()];if(void 0!==h)return h(d,g,b);throw a.g.qe();};e.tu=function(){throw a.g.qe();};e.qN=function(){throw a.g.qe();
};e.YQ=function(){throw a.g.qe();};e.TN=function(){throw a.g.qe();};e.qR=function(){var e=a.Nf.create(102100),b=a.Nf.create(3857),h=a.Nf.create(4326);a.Ya.oy(e,h,NaN,NaN,NaN,!1,null);a.Ya.oy(h,h,1,.0033528106647474805,6378137,!0,[-180,-90,180,90]);a.Ya.oy(b,h,NaN,NaN,NaN,!1,null);a.Ya.xu(e,h,d);a.Ya.xu(h,e,g);a.Ya.xu(b,h,d);a.Ya.xu(h,b,g)};e.AG=[];e.CG=[];e.iz=[];e.lG=[];e.EG=[];e.GG=[];e.IG=[];return e}();a.Ya=c})(A||(A={}));A.Ya.qR();(function(a){var b=function(){function b(e){this.f=null;this.qg=
-1;this.Xc=this.size=this.We=0;this.Ic=e}b.prototype.Jc=function(e){e<this.We?(this.f[e*this.Ic]=this.qg,this.qg=e):this.We--;this.size--};b.prototype.O=function(e,d){return this.f[e*this.Ic+d]};b.prototype.L=function(e,d,a){this.f[e*this.Ic+d]=a};b.prototype.be=function(){var e=this.qg;if(-1==e){if(this.We==this.Xc){e=0!=this.Xc?a.I.truncate(3*(this.Xc+1)/2):1;2147483647<e&&(e=2147483647);if(e==this.Xc)throw a.g.Uc();this.Gm(e)}e=this.We;this.We++}else this.qg=this.f[e*this.Ic];this.size++;for(var d=
e*this.Ic+this.Ic,g=e*this.Ic;g<d;g++)this.f[g]=-1;return e};b.prototype.Pj=function(e){var d=this.qg;if(-1==d){if(this.We==this.Xc){d=0!=this.Xc?a.I.truncate(3*(this.Xc+1)/2):1;2147483647<d&&(d=2147483647);if(d==this.Xc)throw a.g.Uc();this.Gm(d)}d=this.We;this.We++}else this.qg=this.f[d*this.Ic];this.size++;for(var g=d*this.Ic,b=this.Ic,h=0;h<b;h++)this.f[g+h]=e[h];return d};b.prototype.Nh=function(e){this.qg=-1;this.size=this.We=0;e&&(this.f=null,this.Xc=0)};b.prototype.de=function(e){e>this.Xc&&
this.Gm(e)};b.prototype.Pu=function(e,d,a){var g=this.f[this.Ic*d+a];this.f[this.Ic*d+a]=this.f[this.Ic*e+a];this.f[this.Ic*e+a]=g};b.Zk=function(){return-2};b.lm=function(){return-3};b.Zw=function(e){return 0<=e};b.prototype.Gm=function(e){null==this.f&&(this.f=[]);this.Xc=e};return b}();a.Fc=b;b=function(){function b(e){this.f=new Int32Array(0);this.qg=-1;this.Xc=this.size=this.We=0;this.Ic=e}b.prototype.Jc=function(e){e<this.We?(this.f[e*this.Ic]=this.qg,this.qg=e):this.We--;this.size--};b.prototype.O=
function(e,d){return this.f[e*this.Ic+d]};b.prototype.L=function(e,d,a){this.f[e*this.Ic+d]=a};b.prototype.be=function(){var e=this.qg;if(-1==e){if(this.We==this.Xc){e=0!=this.Xc?a.I.truncate(3*(this.Xc+1)/2):1;2147483647<e&&(e=2147483647);if(e==this.Xc)throw a.g.Uc();this.Gm(e)}e=this.We;this.We++}else this.qg=this.f[e*this.Ic];this.size++;for(var d=e*this.Ic;d<e*this.Ic+this.Ic;d++)this.f[d]=-1;return e};b.prototype.Pj=function(e){var d=this.qg;if(-1==d){if(this.We==this.Xc){d=0!=this.Xc?a.I.truncate(3*
(this.Xc+1)/2):1;2147483647<d&&(d=2147483647);if(d==this.Xc)throw a.g.Uc();this.Gm(d)}d=this.We;this.We++}else this.qg=this.f[d*this.Ic];this.size++;for(var g=d*this.Ic,b=0;b<e.length;b++)this.f[g+b]=e[b];return d};b.prototype.Nh=function(e){this.qg=-1;this.size=this.We=0;e&&(this.f=null,this.Xc=0)};b.prototype.de=function(e){e>this.Xc&&this.Gm(e)};b.prototype.Pu=function(e,d,a){var g=this.f[this.Ic*d+a];this.f[this.Ic*d+a]=this.f[this.Ic*e+a];this.f[this.Ic*e+a]=g};b.Zk=function(){return-2};b.lm=
function(){return-3};b.Zw=function(e){return 0<=e};b.prototype.Gm=function(e){null==this.f&&(this.f=new Int32Array(0));var d=new Int32Array(this.Ic*e);d.set(this.f,0);this.f=d;this.Xc=e};return b}();a.II=b;!0===a.ah.Sk&&(a.Fc=a.II)})(A||(A={}));(function(a){var b;(function(d){d[d.enumInputModeBuildGraph=0]="enumInputModeBuildGraph";d[d.enumInputModeSimplifyAlternate=4]="enumInputModeSimplifyAlternate";d[d.enumInputModeSimplifyWinding=5]="enumInputModeSimplifyWinding";d[d.enumInputModeIsSimplePolygon=
7]="enumInputModeIsSimplePolygon"})(b||(b={}));var h=function(){function d(d){this.me=d;this.Zg=NaN;this.LD=new a.Ag;this.MD=new a.Ag;this.Aq=new a.Nd;this.Bq=new a.Nd}d.prototype.compare=function(d,e,a){d=d.da(a);this.me.iy(e,this.LD);this.me.iy(d,this.MD);e=this.LD.get();d=this.MD.get();this.Aq.K(e.na,e.la);this.Bq.K(d.na,d.la);if(this.Aq.va<this.Bq.qa)return-1;if(this.Aq.qa>this.Bq.va)return 1;a=e.ja==e.ha;var g=d.ja==d.ha;if(a||g){if(a&&g)return 0;if(e.ja==d.ja&&e.na==d.na)return a?1:-1;if(e.ha==
d.ha&&e.la==d.la)return a?-1:1}a=e.xe(this.Zg,this.Aq.qa);g=d.xe(this.Zg,this.Bq.qa);a==g&&(a=Math.min(e.ha,d.ha),g=.5*(a+this.Zg),g==this.Zg&&(g=a),a=e.xe(g,this.Aq.qa),g=d.xe(g,this.Bq.qa));return a<g?-1:a>g?1:0};d.prototype.$F=function(d){this.Zg=d};return d}(),e=function(){function d(d){this.ab=d;this.uE=new a.Ag;this.nf=new a.b;this.xx=new a.Nd}d.prototype.eS=function(d){this.nf.J(d)};d.prototype.compare=function(d,e){this.ab.iy(d.da(e),this.uE);d=this.uE.get();this.xx.K(d.na,d.la);if(this.nf.x<
this.xx.qa)return-1;if(this.nf.x>this.xx.va)return 1;d=d.xe(this.nf.y,this.nf.x);return this.nf.x<d?-1:this.nf.x>d?1:0};return d}();b=function(){function d(){this.OD=this.Vh=this.Yh=this.px=this.Pm=this.je=this.xc=this.Ig=this.Td=null;this.sn=this.eg=-1;this.ND=!0;this.tx=!1;this.qx=NaN;this.ei=new a.wd;this.EK=2147483647;this.DK=a.I.truncate(-2147483648);this.Kf=this.Md=this.Ek=this.lp=this.Bl=this.kp=this.Zq=this.Be=-1;this.ta=0}d.prototype.Mv=function(d){this.qx=d};d.prototype.Ul=function(){null==
this.Td&&(this.Td=new a.Fc(8));var d=this.Td.be();this.Td.L(d,1,0);return d};d.prototype.kQ=function(){null==this.xc&&(this.xc=new a.Fc(8));var d=this.xc.be();this.xc.L(d,2,0);this.xc.L(d,3,0);var e=this.xc.be();this.xc.L(e,2,0);this.xc.L(e,3,0);this.GF(d,e);this.GF(e,d);return d};d.prototype.FE=function(){null==this.je&&(this.je=new a.Fc(8));var d=this.je.be();this.je.L(d,2,0);return d};d.prototype.QR=function(d,e){this.Td.L(d,7,e)};d.prototype.em=function(d,e){this.Td.L(d,2,e)};d.prototype.PR=function(d,
e){this.Td.L(d,1,e)};d.prototype.fS=function(d,e){this.Td.L(d,3,e)};d.prototype.cS=function(d,e){this.Td.L(d,4,e)};d.prototype.Lp=function(d,e){this.Td.L(d,5,e)};d.prototype.uN=function(d){return this.Td.O(d,5)};d.prototype.OR=function(d,e){this.Td.L(d,6,e)};d.prototype.IJ=function(d,e){this.OR(e,d)};d.prototype.FF=function(d,e){this.xc.L(d,1,e)};d.prototype.GF=function(d,e){this.xc.L(d,4,e)};d.prototype.Rk=function(d,e){this.xc.L(d,5,e)};d.prototype.Qk=function(d,e){this.xc.L(d,6,e)};d.prototype.VR=
function(d,e){this.xc.L(d,2,e)};d.prototype.Du=function(d,e){this.xc.L(d,3,e)};d.prototype.zC=function(d){return this.xc.O(d,3)};d.prototype.Ir=function(d,e){this.xc.L(d,7,e)};d.prototype.zG=function(d,e){if(-1!=this.ql(d))for(e=e?-1:d,d=this.ql(d);-1!=d;d=this.zq(d))this.a.lb(this.Gi(d),this.lp,e)};d.prototype.Tu=function(d,e){-1!=d&&(this.zG(d,e),this.zG(this.sa(d),e))};d.prototype.Gr=function(d,e){this.je.L(d,1,e)};d.prototype.yg=function(d,e){this.je.L(d,2,e)};d.prototype.cm=function(d,e){this.je.L(d,
3,e);this.LR(d,this.tN(e));this.KR(e,d)};d.prototype.KR=function(d,e){this.je.L(d,4,e)};d.prototype.LR=function(d,e){this.je.L(d,5,e)};d.prototype.AF=function(d,e){this.je.L(d,6,e)};d.prototype.yF=function(d,e){this.je.L(d,7,e)};d.prototype.xF=function(d,e){this.Pm.write(d,e)};d.prototype.zF=function(d,e){this.px.write(d,e)};d.prototype.bT=function(d){var e=0,g=0,b=this.pC(d),h=new a.b,c=new a.b,p=new a.b;this.tq(b,h);c.J(h);var f=b;do this.pl(f,p),g+=a.b.Fb(c,p),this.Pe(this.sa(f))!=d&&(e+=(p.x-
h.x-(c.x-h.x))*(p.y-h.y+(c.y-h.y))*.5),c.J(p),f=this.Wb(f);while(f!=b);this.Pm.write(d,e);this.px.write(d,g)};d.prototype.GQ=function(d){var g=new h(this),b=new a.bj;b.de(a.I.truncate(this.ta/2));b.Hn(g);for(var c=new a.ga(0),p=this.Eg(),f=null,l=0,q=new a.b,n=this.Be;-1!=n;n=this.Bf(n)){l++;var z=this.te(n);if(-1!=z){c.cf(0);if(!this.VS(b,p,c,z)){this.w(n,q);g.$F(q.y);var k=z;do{var t=this.tb(k,p);-1!=t&&(b.kd(t,-1),this.Bb(k,p,-2));k=this.Wb(this.sa(k))}while(z!=k);k=z;do t=this.tb(k,p),-1==t&&
(t=b.addElement(k,-1),c.add(t)),k=this.Wb(this.sa(k));while(z!=k)}for(z=c.size-1;0<=z;z--)t=c.get(z),k=b.da(t),this.Bb(this.sa(k),p,t),this.FQ(b,t,d)}else-1==this.mw(n)&&(null==f&&(f=new e(this)),this.w(n,q),f.eS(q),k=b.GR(f),z=this.Ek,-1!=k&&(t=b.da(k),this.Pe(t)==this.Pe(this.sa(t))&&(t=this.BC(b,k)),-1!=t&&(z=this.Pe(t))),this.IJ(z,n))}this.kh(p)};d.prototype.FQ=function(d,e,a){var g=d.da(e),b=this.Pe(g);if(-1==this.ym(b)){var h=this.BC(d,e),c=this.sa(g),m=this.Pe(c);this.yo(b);this.yo(m);var p=
this.ym(b),f=this.ym(m);-1==h&&-1==p&&(m==b?(this.cm(m,this.Ek),p=f=this.Ek):(-1==f&&(this.cm(m,this.Ek),f=this.Ek),this.cm(b,m),p=m));if(-1!=h){var l=this.Pe(h);-1==f&&(0>=this.yo(l)?(f=this.ym(l),this.cm(m,f)):(this.cm(m,l),f=l),m==b&&(p=f))}-1==p&&this.WS(b,m);0==a?this.aR(d,e,g,h,b,m):5==a?this.bR(d,e,g,c,b,m):4==a&&this.$Q(g,h,b,m)}};d.prototype.aR=function(d,e,a,b,h,c){var g=this.pj(h);if(-1!=b){var m=this.pj(c),p=this.pj(this.Pe(b));b=g&m&p;p^=p&this.Gg(a);p|=b;0!=p&&(this.yg(c,m|p),this.yg(h,
p|g),g=g||p)}for(e=d.bb(e);-1!=e;e=d.bb(e)){b=d.da(e);a=this.Pe(this.sa(b));h=this.pj(a);c=this.Gg(b);m=this.Pe(b);p=this.pj(m);b=h&p&g;g^=g&c;g|=b;if(0==g)break;this.yg(a,h|g);this.yg(m,p|g)}};d.prototype.bR=function(d,e,b,h,c,p){if(c!=p){b=this.tb(b,this.Kf);b+=this.tb(h,this.Kf);h=0;var g=new a.ga(0),m=new a.ga(0);m.add(0);for(var f=d.gc(-1);f!=e;f=d.bb(f)){var l=d.da(f),q=this.sa(l),n=this.Pe(l),z=this.Pe(q);if(n!=z){l=this.tb(l,this.Kf);l+=this.tb(q,this.Kf);h+=l;q=!1;0!=g.size&&g.tc()==z&&(m.af(),
g.af(),q=!0);if(-1==this.ym(z))throw a.g.wa();q&&this.ym(z)==n||(m.add(h),g.add(n))}}h+=b;0!=g.size&&g.tc()==p&&(m.af(),g.af());0!=h?0==m.tc()&&(d=this.a.$c,d=this.ya(d),this.yg(c,d)):0!=m.tc()&&(d=this.a.$c,d=this.ya(d),this.yg(c,d))}};d.prototype.$Q=function(d,e,a,b){var g=this.ya(this.a.$c);if(-1==e)this.yg(b,this.sn),d=this.tb(d,this.eg),0!=(d&1)?this.yg(a,g):this.yg(a,this.sn);else{var h=this.pj(b);0==h&&(h=this.pj(this.Pe(e)),this.yg(b,h));d=this.tb(d,this.eg);0!=(d&1)?this.yg(a,h==g?this.sn:
g):this.yg(a,h)}};d.prototype.VS=function(d,e,a,b){var g=b,h=-1,c=-1,m=0;do{if(2==m)return!1;var p=this.tb(g,e);if(-1!=p){if(-1!=h)return!1;h=p}else{if(-1!=c)return!1;c=g}m++;g=this.Wb(this.sa(g))}while(b!=g);if(-1==c||-1==h)return!1;this.Bb(d.da(h),e,-2);d.Vi(h,c);a.add(h);return!0};d.prototype.WS=function(d,e){var a=this.yo(d);if(0!=a){var g=this.yo(e);0<a&&0>g?this.cm(d,e):0>a&&0<g?this.cm(d,e):(a=this.ym(e),-1!=a&&this.cm(d,a))}};d.prototype.RL=function(d,e){this.lp=this.a.re();for(var g=0,b=
e.size;g<b;g++){var h=e.get(g),c=this.a.Ra(h,this.Bl),m=this.a.Vf(this.a.rd(h)),p=this.a.Lb(m);if(a.T.Kc(p)){var f=this.a.X(h);if(-1!=f){var l=this.a.Ra(f,this.Bl);if(c!=l){var q=this.kQ(),n=this.sa(q),z=this.Ig.be();this.Ig.L(z,0,h);this.Ig.L(z,1,-1);this.Ir(q,z);this.FF(q,c);z=this.te(c);-1==z?(this.em(c,q),this.Rk(q,n),this.Qk(n,q)):(c=this.fe(z),this.Rk(z,n),this.Qk(n,z),this.Qk(c,q),this.Rk(q,c));this.FF(n,l);c=this.te(l);-1==c?(this.em(l,n),this.Qk(q,n),this.Rk(n,q)):(l=this.fe(c),this.Rk(c,
q),this.Qk(q,c),this.Qk(l,n),this.Rk(n,l));m=this.ya(m);0==d?(this.Bb(n,this.Md,0),this.Bb(q,this.Md,1736==p?m:0)):5==d?(l=new a.b,this.a.w(h,l),h=new a.b,this.a.w(f,h),c=f=0,0>l.compare(h)?f=1:c=-1,this.Bb(n,this.Md,0),this.Bb(q,this.Md,0),this.Bb(q,this.Kf,f),this.Bb(n,this.Kf,c)):7==d?(this.Bb(n,this.Md,this.sn),this.Bb(q,this.Md,1736==p?m:0)):4==d&&(this.Bb(n,this.Md,0),this.Bb(q,this.Md,0),this.Bb(q,this.eg,1),this.Bb(n,this.eg,1));p=1736==p?this.DK:0;this.Du(q,m|p);this.Du(n,m|p)}}}}};d.prototype.ZP=
function(d,e){var a=this.ql(e);if(-1!=a){var g=this.ql(d);this.Ig.L(a,1,g);this.Ir(d,a);this.Ir(e,-1)}d=this.sa(d);e=this.sa(e);a=this.ql(e);-1!=a&&(g=this.ql(d),this.Ig.L(a,1,g),this.Ir(d,a),this.Ir(e,-1))};d.prototype.AS=function(d){function e(d,e){return b.lL(d,e)}var g=new a.ga(0);g.xb(10);for(var b=this,h=this.Be;-1!=h;h=this.Bf(h)){g.clear(!1);var c=this.te(h);if(-1!=c){var p=c;do g.add(p),p=this.Wb(this.sa(p));while(p!=c);if(1<g.size){p=!0;if(2<g.size)g.xd(0,g.size,e),g.add(g.get(0));else if(0<
this.kL(g.get(0),g.get(1))){var f=g.get(0);g.set(0,g.get(1));g.set(1,f)}else p=!1;for(var l=f=g.get(0),q=this.jf(l),n=this.sa(l),z=-1,k=1,t=g.size;k<t;k++){var v=g.get(k),A=this.sa(v),w=this.qj(A);if(w==q&&v!=l){if(0==d)z=this.zC(l)|this.zC(v),this.Du(l,z),this.Du(n,z),this.Bb(l,this.Md,this.tb(l,this.Md)|this.tb(v,this.Md)),this.Bb(n,this.Md,this.tb(n,this.Md)|this.tb(A,this.Md));else if(-1!=this.Kf)z=this.tb(l,this.Kf)+this.tb(v,this.Kf),A=this.tb(n,this.Kf)+this.tb(A,this.Kf),this.Bb(l,this.Kf,
z),this.Bb(n,this.Kf,A);else{if(7==d){this.ei=new a.wd(5,h,-1);return}-1!=this.eg&&(z=this.tb(l,this.eg)+this.tb(v,this.eg),A=this.tb(n,this.eg)+this.tb(A,this.eg),this.Bb(l,this.eg,z),this.Bb(n,this.eg,A))}this.ZP(l,v);this.Wv(v);z=l;g.set(k,-1);v==f&&(g.set(0,-1),f=-1)}else this.Tu(z,!1),z=-1,l=v,q=w,n=A}this.Tu(z,!1);z=-1;if(p){f=-1;k=0;for(t=g.size;k<t;k++)if(v=g.get(k),-1!=v)if(-1==f)l=f=v,q=this.jf(l),n=this.sa(l);else if(v!=l&&(A=this.sa(v),w=this.qj(A),this.Qk(n,v),this.Rk(v,n),l=v,q=w,n=
A,7==d&&(this.tb(v,this.Md)|this.tb(this.fe(v),this.Md))==(this.sn|1))){this.ei=new a.wd(5,h,-1);return}this.em(h,f)}else{f=-1;k=0;for(t=g.size;k<t;k++)if(v=g.get(k),-1!=v){f=v;break}c!=f&&this.em(h,f)}}}}};d.prototype.AK=function(){for(var d=-1,e=this.Eg(),b=this.Be;-1!=b;b=this.Bf(b)){var h=this.te(b);if(-1!=h){var c=h;do{if(1!=this.tb(c,e)){var p=this.FE();this.Gr(p,c);this.yF(p,d);-1!=d&&this.AF(d,p);var d=p,f=0,l=c;do f|=this.tb(l,this.Md),this.VR(l,p),this.Bb(l,e,1),l=this.Wb(l);while(l!=c);
this.yg(p,f)}c=this.Wb(this.sa(c))}while(c!=h)}}p=this.FE();this.Gr(p,-1);this.yF(p,d);-1!=d&&this.AF(d,p);this.Ek=p;this.Pm=a.qd.Yc(this.je.size,NaN);this.px=a.qd.Yc(this.je.size,NaN);this.xF(this.Ek,Infinity);this.zF(this.Ek,Infinity);this.kh(e)};d.prototype.EN=function(d,e,a){e=-1!=e?e:this.te(d);if(-1==e)return-1;for(d=e;;){if(1!=this.tb(e,a))return e;e=this.Wb(this.sa(e));if(e==d)return-1}};d.prototype.uR=function(){for(var d=this.Eg(),e=this.Be;-1!=e;e=this.Bf(e))for(var a=-1;;){var b=this.EN(e,
a,d);if(-1==b)break;for(var a=this.Wb(this.sa(b)),h=b;;){var c=this.Wb(h),p=this.fe(h),f=this.sa(h);if(p==f){this.bM(h);if(a==h||a==f)a=-1;if(h==b||p==b){b=c;if(h==b||p==b)break;h=c;continue}}else this.Bb(h,d,1);h=c;if(h==b)break}}};d.prototype.Ay=function(d,e,b,h){this.xg();this.ND=h;this.a=d;this.kp=this.a.RB();d=new a.ga(0);d.xb(null!=b?this.a.F(b.get(0)):this.a.pd);var g=0,c=1,m=null!=b?b.get(0):this.a.$c;for(h=1;-1!=m;){this.a.EF(m,this.kp,c);for(var c=c<<1,p=this.a.Vb(m);-1!=p;p=this.a.bc(p))for(var f=
this.a.Cb(p),l=0,q=this.a.Ha(p);l<q;l++)d.add(f),f=this.a.X(f);a.T.Km(this.a.Lb(m))||(g+=this.a.ea(m));null!=b?(m=h<b.size?b.get(h):-1,h++):m=this.a.we(m)}this.sn=c;this.ta=d.size;this.a.Mu(d,this.ta);null==this.Ig&&(this.Ig=new a.Fc(2),this.Td=new a.Fc(8),this.xc=new a.Fc(8),this.je=new a.Fc(8));this.Ig.de(this.ta);this.Td.de(this.ta+10);this.xc.de(2*this.ta+32);this.je.de(Math.max(32,g));this.Bl=this.a.re();b=new a.b;h=0;g=new a.b;b.Eh();for(c=0;c<=this.ta;c++)if(c<this.ta?(f=d.get(c),this.a.w(f,
g)):g.Eh(),!b.ub(g)){if(h<c){f=this.Ul();for(q=l=-1;h<c;h++)q=d.get(h),this.a.lb(q,this.Bl,f),m=this.Ig.be(),this.Ig.L(m,0,q),this.Ig.L(m,1,l),l=m,p=this.a.rd(q),m=this.a.Vf(p),m=this.ya(m),this.PR(f,this.md(f)|m);this.QR(f,l);this.Lp(f,this.a.gb(q));-1!=this.Zq&&this.cS(this.Zq,f);this.fS(f,this.Zq);this.Zq=f;-1==this.Be&&(this.Be=f)}h=c;b.J(g)}this.Md=this.Eg();5==e&&(this.Kf=this.Eg());4==e&&(this.eg=this.Eg());this.RL(e,d);0==this.ei.yh&&(this.AS(e),0==this.ei.yh&&(isNaN(this.qx)||this.ZK()?(this.AK(),
0==this.ei.yh&&(this.kh(this.Md),this.Md=-1,this.ND&&this.GQ(e))):this.tx=!0))};d.prototype.Wv=function(d){var e=this.Wb(d),a=this.fe(d),b=this.sa(d),g=this.Wb(b),h=this.fe(b);e!=b&&(this.Qk(h,e),this.Rk(e,h));a!=b&&(this.Qk(a,g),this.Rk(g,a));a=this.qj(d);this.te(a)==d&&(g!=d?this.em(a,g):this.em(a,-1));g=this.qj(b);this.te(g)==b&&(e!=b?this.em(g,e):this.em(g,-1));this.xc.Jc(d);this.xc.Jc(b)};d.prototype.BC=function(d,e){for(;;)if(e=d.ge(e),-1!=e){var a=d.da(e);if(this.Pe(a)!=this.Pe(this.sa(a)))return a}else return-1};
d.prototype.Mp=function(d,e,a){void 0===a&&(a=!0);this.Ay(d,0,null,a)};d.prototype.tF=function(d,e){var b=new a.ga(0);b.add(e);this.Ay(d,4,b,1736==d.Lb(e))};d.prototype.uF=function(d,e){var b=new a.ga(0);b.add(e);this.Ay(d,5,b,!0)};d.prototype.xg=function(){null!=this.a&&(-1!=this.kp&&(this.a.tR(this.kp),this.kp=-1),-1!=this.Bl&&(this.a.bf(this.Bl),this.Bl=-1),-1!=this.lp&&(this.a.bf(this.lp),this.lp=-1),-1!=this.Md&&(this.kh(this.Md),this.Md=-1),-1!=this.Kf&&(this.kh(this.Kf),this.Kf=-1),-1!=this.eg&&
(this.kh(this.eg),this.eg=-1),this.a=null,this.Td.Nh(!0),this.Ig.Nh(!0),this.Zq=this.Be=-1,null!=this.xc&&this.xc.Nh(!0),null!=this.Yh&&(this.Yh.length=0),null!=this.Vh&&(this.Vh.length=0),null!=this.OD&&(this.OD.length=0),null!=this.je&&this.je.Nh(!0),this.Ek=-1,this.Pm=null)};d.prototype.te=function(d){return this.Td.O(d,2)};d.prototype.w=function(d,e){this.a.SC(this.uN(d),e)};d.prototype.md=function(d){return this.Td.O(d,1)};d.prototype.Bf=function(d){return this.Td.O(d,4)};d.prototype.mw=function(d){return this.Td.O(d,
6)};d.prototype.ol=function(d){return this.Td.O(d,7)};d.prototype.zq=function(d){return this.Ig.O(d,1)};d.prototype.Gi=function(d){return this.Ig.O(d,0)};d.prototype.Sf=function(d,e){e=this.Vh[e];return e.size<=d?-1:e.read(d)};d.prototype.fm=function(d,e,a){e=this.Vh[e];e.size<=d&&e.resize(this.Td.size,-1);e.write(d,a)};d.prototype.uo=function(){null==this.Vh&&(this.Vh=[]);for(var d=a.ga.Yc(this.Td.Xc,-1),e=0,b=this.Vh.length;e<b;e++)if(null==this.Vh[e])return this.Vh[e]=d,e;this.Vh.push(d);return this.Vh.length-
1};d.prototype.vo=function(d){this.Vh[d]=null};d.prototype.qj=function(d){return this.xc.O(d,1)};d.prototype.jf=function(d){return this.qj(this.sa(d))};d.prototype.sa=function(d){return this.xc.O(d,4)};d.prototype.fe=function(d){return this.xc.O(d,5)};d.prototype.Wb=function(d){return this.xc.O(d,6)};d.prototype.Pe=function(d){return this.xc.O(d,2)};d.prototype.Qe=function(d){return this.pj(this.xc.O(d,2))};d.prototype.ql=function(d){return this.xc.O(d,7)};d.prototype.tq=function(d,e){this.w(this.qj(d),
e)};d.prototype.pl=function(d,e){this.w(this.jf(d),e)};d.prototype.Gg=function(d){return this.xc.O(d,3)&this.EK};d.prototype.tb=function(d,e){e=this.Yh[e];return e.size<=d?-1:e.read(d)};d.prototype.Bb=function(d,e,a){e=this.Yh[e];e.size<=d&&e.resize(this.xc.size,-1);e.write(d,a)};d.prototype.Eg=function(){null==this.Yh&&(this.Yh=[]);for(var d=a.ga.Yc(this.xc.Xc,-1),e=0,b=this.Yh.length;e<b;e++)if(null==this.Yh[e])return this.Yh[e]=d,e;this.Yh.push(d);return this.Yh.length-1};d.prototype.kh=function(d){this.Yh[d]=
null};d.prototype.bM=function(d){var e=this.Pe(d),a=this.Wb(d);a==this.sa(d)&&(a=this.Wb(a),a==d&&(a=-1));this.pC(e)==d&&this.Gr(e,a);a=this.Pm.read(e);isNaN(a)||(this.xF(e,NaN),this.zF(e,NaN));this.Tu(d,!0);this.Wv(d)};d.prototype.cM=function(d){for(var e=0,a=d.size;e<a;e++){var b=d.get(e),g=this.Pe(this.sa(b));this.Gr(this.Pe(b),-1);this.Gr(g,-1);this.Tu(b,!0);this.Wv(b)}};d.prototype.pC=function(d){return this.je.O(d,1)};d.prototype.pj=function(d){return this.je.O(d,2)};d.prototype.ym=function(d){return this.je.O(d,
3)};d.prototype.tN=function(d){return this.je.O(d,4)};d.prototype.yo=function(d){var e=this.Pm.read(d);isNaN(e)&&(this.bT(d),e=this.Pm.read(d));return e};d.prototype.ya=function(d){return this.a.yC(d,this.kp)};d.prototype.se=function(d){return this.a.Ra(d,this.Bl)};d.prototype.GN=function(d){return this.a.Ra(d,this.lp)};d.prototype.FN=function(d,e){var a=this.te(d);if(-1==a)return-1;var b=a,g=-1,h=-1;do{if(this.jf(b)==e)return b;if(-1==g){g=this.te(e);if(-1==g)break;h=g}if(this.jf(h)==d)return b=
this.sa(h);b=this.Wb(this.sa(b));h=this.Wb(this.sa(h))}while(b!=a&&h!=g);return-1};d.prototype.iy=function(d,e){e.mq();e=e.get();var b=new a.b;this.tq(d,b);e.ed(b);this.pl(d,b);e.vd(b)};d.prototype.lL=function(d,e){if(d==e)return 0;var b=new a.b;this.pl(d,b);var g=new a.b;this.pl(e,g);if(b.ub(g))return 0;e=new a.b;this.tq(d,e);d=new a.b;d.pc(b,e);b=new a.b;b.pc(g,e);return a.b.cq(d,b)};d.prototype.kL=function(d,e){if(d==e)return 0;var b=new a.b;this.pl(d,b);var g=new a.b;this.pl(e,g);if(b.ub(g))return 0;
e=new a.b;this.tq(d,e);d=new a.b;d.pc(b,e);b=new a.b;b.pc(g,e);return 0<=b.y&&0<d.y?a.b.cq(d,b):0};d.prototype.ZK=function(){for(var d=a.vi.Ty(this.qx),e=new a.b,b=new a.b,h=new a.b,c=new a.b,p=new a.b,f=this.Be;-1!=f;f=this.Bf(f)){var l=this.te(f);if(-1!=l){var q=l;this.tq(q,e);this.pl(q,b);p.pc(b,e);var n=p.Up();do{var z=q,q=this.Wb(this.sa(q));if(q!=z){this.pl(q,h);c.pc(h,e);var z=c.Up(),k=c.Ai(p);if(k*k/(z*n)*Math.min(z,n)<=d)return!1;p.J(c);n=z;b.J(h)}}while(q!=l)}}return!0};return d}();a.gs=
b})(A||(A={}));(function(a){var b=function(){function b(){this.h=null;this.TD=new a.b;this.UD=new a.b;this.Qg=null;this.Gq=!1;this.Ym=-1}b.prototype.Te=function(e){return e<this.Qg.length?this.Qg[e]:!1};b.prototype.xm=function(e,d,b,h){var g=a.T.ve(this.h.a.Lb(b));if(2==a.T.ve(this.h.a.Lb(d))&&1==g)this.WL(e,d,b,h);else throw a.g.wa();};b.prototype.Mp=function(e,d){null==this.h&&(this.h=new a.gs);this.h.Mp(e,d)};b.prototype.Np=function(e,d,b){a.aj.$(e,d,b,!0);for(d=e.$c;-1!=d;d=e.we(d))1736==e.Lb(d)&&
a.mm.$(e,d,-1,this.Gq,b);this.Mp(e,b)};b.prototype.EB=function(e,d,a,b,h){var g=this.h.a;if(1736==g.Lb(e))for(e=g.Vb(e);-1!=e;e=g.bc(e)){var c=g.Cb(e);this.h.se(c);this.h.se(g.X(c));var m=this.h.GN(c);if(-1!=m){var p=this.h.tb(m,a);if(1!=p&&2!=p)if(this.Te(this.h.Qe(m))){this.h.Bb(m,a,1);var p=g.Cf(d,-1),f=m,l=this.h.se(c),q=1;do{var n=this.tl(c,h);g.zi(p,n);-1!=b&&this.h.fm(l,b,1);this.h.Bb(f,a,1);var f=this.h.Wb(f),z;do n=1==q?g.X(c):g.Ua(c),z=-1!=n?this.h.se(n):-1;while(z==l);var k=this.h.qj(f);
if(k!=z){do n=1==q?g.Ua(c):g.X(c),z=-1!=n?this.h.se(n):-1;while(z==l);k!=z?(z=k,n=this.h.Gi(this.h.ol(z))):q=-q}l=z;c=n}while(f!=m);g.Gn(p,!0)}else this.h.Bb(m,a,2)}}};b.prototype.UB=function(){for(var e=this.h.Eg(),d=new a.ga(0),b=this.h.Be;-1!=b;b=this.h.Bf(b)){var h=this.h.te(b),c=h;if(-1!=h){do{if(1!=this.h.tb(c,e)){var p=this.h.sa(c);this.h.Bb(p,e,1);this.h.Bb(c,e,1);this.Te(this.h.Qe(c))&&this.Te(this.h.Qe(p))&&d.add(c)}c=this.h.Wb(this.h.sa(c))}while(c!=h)}}this.h.kh(e);this.h.cM(d)};b.prototype.tl=
function(e,d){return-1==d?e:this.kO(e,d)};b.prototype.kO=function(e,d){var a=this.h.a,b,h,c=this.h.ol(this.h.se(e));do{b=this.h.Gi(c);h=a.Vf(a.rd(b));if(h==d)return b;c=this.h.zq(c)}while(-1!=c);return e};b.prototype.Xp=function(e,d,b){this.UB();var g=this.h.a,h=g.jg(1736),c=this.h.Eg();this.pG(e,d,h,b,c,-1);this.h.kh(c);a.mm.$(g,h,1,this.Gq,null);return h};b.prototype.pG=function(e,d,a,b,h,c){this.EB(e,a,h,c,b);-1!=d&&this.EB(d,a,h,c,b);e=this.h.a;for(d=this.h.Be;-1!=d;d=this.h.Bf(d)){var g=this.h.te(d);
if(-1!=g){var m=g;do{var p=this.h.tb(m,h);if(1!=p&&2!=p)if(this.Te(this.h.Qe(m))){var p=e.Cf(a,-1),f=m;do{var l=this.h.ql(f);-1!=l?l=this.h.Gi(l):(l=this.h.Gi(this.h.ql(this.h.sa(f))),l=this.h.a.X(l));l=this.tl(l,b);e.zi(p,l);this.h.Bb(f,h,1);-1!=c&&(l=this.h.se(l),this.h.fm(l,c,1));f=this.h.Wb(f)}while(f!=m);e.Gn(p,!0)}else this.h.Bb(m,h,2);m=this.h.Wb(this.h.sa(m))}while(m!=g)}}};b.prototype.RS=function(e,d,b){var g=this.h.a,h=g.jg(1736),c=g.jg(1607),p=g.jg(550);this.UB();var f=-1,l=this.h.Eg(),
q=this.h.uo();this.pG(e,d,h,b,l,q);for(e=this.h.Be;-1!=e;e=this.h.Bf(e))if(d=this.h.te(e),-1!=d){var n=d;do{var z=this.h.tb(n,l),k=this.h.tb(this.h.sa(n),l),z=z|k;if(2==z)if(z=this.h.Gg(n),this.Te(z)){var t=g.Cf(c,-1),v=n,z=this.Au(e,g),z=this.tl(z,b);g.zi(t,z);this.h.fm(e,q,1);do{z=this.h.jf(v);k=this.Au(z,g);k=this.tl(k,b);g.zi(t,k);this.h.Bb(v,l,1);this.h.Bb(this.h.sa(v),l,1);this.h.fm(z,q,1);v=this.h.Wb(v);z=this.h.tb(v,l);k=this.h.tb(this.h.sa(v),l);z|=k;if(2!=z)break;z=this.h.Gg(v);if(!this.Te(z)){this.h.Bb(v,
l,1);this.h.Bb(this.h.sa(v),l,1);break}}while(v!=n)}else this.h.Bb(n,l,1),this.h.Bb(this.h.sa(n),l,1);n=this.h.Wb(this.h.sa(n))}while(n!=d)}for(e=this.h.Be;-1!=e;e=this.h.Bf(e))z=this.h.Sf(e,q),1!=z&&(z=this.h.md(e),this.Te(z)&&(-1==f&&(f=g.Cf(p,-1)),d=this.h.ol(e),-1!=d&&(d=this.h.Gi(d),z=this.tl(d,b),g.zi(f,z))));this.h.vo(q);this.h.kh(l);a.mm.$(g,h,1,this.Gq,null);b=[];b[0]=p;b[1]=c;b[2]=h;return b};b.prototype.Au=function(e,d){var a=-1;for(e=this.h.ol(e);-1!=e;e=this.h.zq(e)){var b=this.h.Gi(e);
-1==a&&(a=b);var h=this.h.ya(d.Vf(d.rd(b)));if(this.Te(h)){a=b;break}}return a};b.prototype.fy=function(e,d){for(var b=this.h.qj(d),h=this.h.jf(d),c=0,p=0,f=this.h.ol(b);-1!=f;f=this.h.zq(f)){var l=this.h.Gi(f),q=e.rd(l),n=this.h.ya(e.Vf(q)),z=e.X(l),k=e.Ua(l),q=e.Cb(q);q==l&&(this.Ym=d);-1!=z&&this.h.se(z)==h?(c++,this.Te(n)&&(q==z&&(this.Ym=this.h.Wb(d)),p++)):-1!=k&&this.h.se(k)==h&&(c--,this.Te(n)&&(q==k&&(this.Ym=this.h.Wb(d)),p--))}this.h.w(b,this.TD);this.h.w(h,this.UD);b=a.b.Fb(this.TD,this.UD);
return(0!=p?p:c)*b};b.prototype.Ao=function(e){return this.h.Gg(e)|this.h.Qe(e)|this.h.Qe(this.h.sa(e))};b.prototype.sG=function(e){for(var d=this.h.sa(this.h.fe(e)),a=-1;d!=e;){if(this.Te(this.Ao(d))){if(-1!=a)return-1;a=d}d=this.h.sa(this.h.fe(d))}return-1!=a?this.h.sa(a):-1};b.prototype.tG=function(e){for(var d=this.h.sa(this.h.Wb(e)),a=-1;d!=e;){if(this.Te(this.Ao(d))){if(-1!=a)return-1;a=d}d=this.h.sa(this.h.Wb(d))}return-1!=a?this.h.sa(a):-1};b.prototype.jF=function(e,d,b,h,c){var g=this.h.a,
m=e,p=this.h.sa(m);this.h.Bb(m,b,1);this.h.Bb(p,b,1);var f=this.fy(g,m);this.Ym=-1;for(var l=m,q=-1,n=!1,z=1;;){var k=this.h.fe(m);if(k==p)break;p=this.h.Wb(p);if(this.h.sa(k)!=p)if(m=this.sG(m),-1==m)break;else n=!0,p=this.h.sa(m);else m=k;if(m==e){q=e;break}k=this.Ao(m);if(!this.Te(k))break;this.h.Bb(m,b,1);this.h.Bb(p,b,1);l=m;f+=this.fy(g,m);z++}if(-1==q)for(m=e,p=this.h.sa(m),q=m;;){e=this.h.Wb(m);if(e==p)break;p=this.h.fe(p);if(this.h.sa(e)!=p)if(m=this.tG(m),-1==m){n=!0;break}else p=this.h.sa(m);
else m=e;k=this.Ao(m);if(!this.Te(k))break;this.h.Bb(m,b,1);this.h.Bb(p,b,1);q=m;f+=this.fy(g,m);z++}else if(-1!=this.Ym&&(l=this.Ym,q=this.h.fe(this.Ym),this.h.sa(q)!=this.h.Wb(this.h.sa(l))&&(q=this.sG(l),-1==q)))throw a.g.wa();0<=f||(m=q,q=this.h.sa(l),l=this.h.sa(m));b=g.Cf(d,-1);m=l;l=this.h.qj(l);n=this.h.jf(q)==l&&n;f=this.Au(l,g);f=this.tl(f,c);g.zi(b,f);-1!=h&&this.h.fm(l,h,1);l=0;for(z=n?a.I.truncate((z+1)/2):-1;;){e=this.h.jf(m);f=this.Au(e,g);f=this.tl(f,c);g.zi(b,f);l++;-1!=h&&this.h.fm(e,
h,1);n&&l==z&&(b=g.Cf(d,-1),g.zi(b,f));if(m==q)break;e=this.h.Wb(m);if(this.h.fe(this.h.sa(m))!=this.h.sa(e)){if(m=this.tG(m),-1==m)throw a.g.wa();}else m=e}};b.prototype.Yp=function(e){for(var d=this.h.a.jg(1607),a=this.h.Eg(),b=this.h.Be;-1!=b;b=this.h.Bf(b)){var h=this.h.te(b),c=h;do 1!=this.h.tb(c,a)&&this.Te(this.Ao(c))&&this.jF(c,d,a,-1,e),c=this.h.Wb(this.h.sa(c));while(c!=h)}this.h.kh(a);return d};b.prototype.SS=function(e){for(var d=this.h.a,a=d.jg(1607),b=d.jg(550),h=this.h.Eg(),c=this.h.uo(),
p=-1,f=this.h.Be;-1!=f;f=this.h.Bf(f)){var l=this.h.te(f),q=l;do{var n=this.h.tb(q,h);1!=n&&(n=this.Ao(q),this.Te(n)&&this.jF(q,a,h,c,e));q=this.h.Wb(this.h.sa(q))}while(q!=l)}for(f=this.h.Be;-1!=f;f=this.h.Bf(f))n=this.h.Sf(f,c),1!=n&&(n=this.h.md(f),this.Te(n)&&(-1==p&&(p=d.Cf(b,-1)),l=this.h.ol(f),-1!=l&&(l=this.h.Gi(l),l=this.tl(l,e),d.zi(p,l))));this.h.kh(h);this.h.vo(c);e=[];e[0]=b;e[1]=a;return e};b.prototype.Pn=function(){for(var e=this.h.a,d=e.jg(550),a=e.Cf(d,-1),b=this.h.Be;-1!=b;b=this.h.Bf(b))if(this.Te(this.h.md(b))){for(var h=
-1,c=this.h.ol(b);-1!=c;c=this.h.zq(c)){var p=this.h.Gi(c);-1==h&&(h=p);var f=this.h.ya(e.Vf(e.rd(p)));if(this.Te(f)){h=p;break}}e.zi(a,h)}return d};b.prototype.Im=function(e){this.Qg=[];for(var d=0;d<e;d++)this.Qg[d]=!1};b.qF=function(e,d,b,h){var g=e.Pa(),c=Array(1E3);a.I.Ps(c,null);var m=a.I.Lh(1E3,0),p=e.F(),f=!0,l=2==d.fb();if(1!=d.fb()&&2!=d.fb())throw a.g.wa();for(var q=0;q<p;){var n=a.I.truncate(e.fR(c,q)-q);l?a.gd.nG(d,c,n,b,m):a.gd.oG(d,c,n,b,m);for(var z=0,k=0;k<n;k++){var t=0==m[k];h||
(t=!t);t&&(f&&(f=!1,g.Pd(e,0,q)),z!=k&&g.Pd(e,q+z,q+k),z=k+1)}f||z==n||g.Pd(e,q+z,q+n);q+=n}return f?e:g};b.jD=function(e,d,g){return e instanceof a.pe?b.qF(e,d,g,!0):d instanceof a.Va?e.s()||d.s()?e.Pa():a.aj.HE(g,e,d)?a.aj.gL(e,d):e.Pa():b.mG(e,d,g,!0)};b.mt=function(e,d,g,h){var c=new a.i;e.o(c);var m=new a.i;d.o(m);var p=new a.i;p.K(c);p.Db(m);g=a.Ia.zd(g,p,!0);p=new a.i;p.K(m);m=a.Ia.As(g);p.P(m,m);if(!c.jc(p)){if(e.fb()<=d.fb())return b.Cc(b.ob(e.Pa()),e,"\x26");if(e.fb()>d.fb())return b.Cc(b.ob(d.Pa()),
e,"\x26")}m=new b;c=new a.fd;p=c.Eb(b.ob(e));d=c.Eb(b.ob(d));m.Np(c,g,h);h=m.mt(p,d);e=b.Cc(c.hf(h),e,"\x26");a.T.Kc(e.D())&&(e.hg(2,g),1736==e.D()&&e.hl());return e};b.mG=function(e,d,b,h){if(e.s())return e.Pa();if(d.s())return h?e.Pa():null;var g=[null],c=[0],m=2==d.fb();if(1!=d.fb()&&2!=d.fb())throw a.g.wa();g[0]=e.w();m?a.gd.nG(d,g,1,b,c):a.gd.oG(d,g,1,b,c);d=0==c[0];h||(d=!d);return d?e.Pa():e};b.PT=function(e,d,g){return e instanceof a.pe?b.qF(e,d,g,!1):d instanceof a.Va?e.s()?e.Pa():d.s()?
e:a.aj.HE(g,e,d)?e.Pa():e:b.mG(e,d,g,!1)};b.prototype.ME=function(e,d,b,h,c){if(e.s())return e;var g=new a.fd;e=g.Eb(e);return this.Qj(g,e,d,b,h,c)};b.prototype.EQ=function(e,d,b,h,c,p){if(c&&550!=e.Lb(d)){var g=new a.aA;g.KS(e,b);g.og?(a.aj.$(e,b,p,!0),c=!1):this.h.Mv(b)}else a.aj.$(e,b,p,!0),c=!1;h&&550!=e.Lb(d)?this.h.uF(e,d):this.h.tF(e,d);if(this.h.tx)return this.h.xg(),this.h=null,this.Qj(e,d,b,h,!1,p);this.h.Mv(NaN);p=this.h.ya(d);this.Im(p+1);this.Qg[p]=!0;if(1736==e.Lb(d)||h&&550!=e.Lb(d))return e.Pp(d,
0),d=this.Xp(d,-1,-1),e=e.hf(d),e.Pp(0),c?e.hg(1,0):(e.hg(2,b),e.hl()),e;if(1607==e.Lb(d))return d=this.Yp(-1),e=e.hf(d),c||e.hg(2,b),e;if(550==e.Lb(d))return d=this.Pn(),e=e.hf(d),c||e.hg(2,b),e;throw a.g.wa();};b.prototype.Qj=function(e,d,b,h,c,p){this.h=new a.gs;try{return this.EQ(e,d,b,h,c,p)}finally{this.h.xg()}};b.Qj=function(e,d,a,h,c){return(new b).ME(e,d,a,h,c)};b.prototype.DQ=function(e,d,b){this.Gq=e;this.h=new a.gs;e=d.Cm(b);var g=d.Lb(b);1!=e||550==g?this.h.tF(d,b):this.h.uF(d,b);if(!this.h.tx)if(this.h.Mv(NaN),
g=this.h.ya(b),this.Im(g+1),this.Qg[g]=!0,1736==d.Lb(b)||1==e&&550!=d.Lb(b))d.Pp(b,0),e=this.Xp(b,-1,-1),d.Vy(e,b),d.sy(e);else if(1607==d.Lb(b))e=this.Yp(-1),d.Vy(e,b),d.sy(e);else if(550==d.Lb(b))e=this.Pn(),d.Vy(e,b),d.sy(e);else throw a.g.ra("internal error");};b.Ry=function(e,d,a,h){var g=new b;g.Gq=!0;return g.ME(e,d,!1,a,h)};b.prototype.ll=function(e,d){var b=a.T.ve(this.h.a.Lb(e)),h=a.T.ve(this.h.a.Lb(d));if(b>h)return e;var c=this.h.ya(e),p=this.h.ya(d);this.Im((c|p)+1);this.Qg[this.h.ya(e)]=
!0;if(2==b&&2==h)return this.Xp(e,d,-1);if(1==b&&2==h||1==b&&1==h)return this.Yp(-1);if(0==b)return this.Pn();throw a.g.wa();};b.prototype.TB=function(e,d){var b=a.T.ve(this.h.a.Lb(e)),h=a.T.ve(this.h.a.Lb(d));if(b>h)return e;if(b<h)return d;var c=this.h.ya(e),p=this.h.ya(d);this.Im((c|p)+1);this.Qg[this.h.ya(e)]=!0;this.Qg[this.h.ya(d)]=!0;this.Qg[this.h.ya(e)|this.h.ya(d)]=!0;if(2==b&&2==h)return this.Xp(e,d,-1);if(1==b&&1==h)return this.Yp(-1);if(0==b&&0==h)return this.Pn();throw a.g.wa();};b.prototype.mt=
function(e,d){var b=a.T.ve(this.h.a.Lb(e)),h=a.T.ve(this.h.a.Lb(d)),c=this.h.ya(e),p=this.h.ya(d);this.Im((c|p)+1);this.Qg[this.h.ya(e)|this.h.ya(d)]=!0;c=-1;1<this.h.a.wp.Aa&&(c=e);if(2==b&&2==h)return this.Xp(e,d,c);if(1==b&&0<h||1==h&&0<b)return this.Yp(c);if(0==b||0==h)return this.Pn();throw a.g.wa();};b.prototype.Uw=function(e,d){var b=a.T.ve(this.h.a.Lb(e)),h=a.T.ve(this.h.a.Lb(d)),c=this.h.ya(e),p=this.h.ya(d);this.Im((c|p)+1);this.Qg[this.h.ya(e)|this.h.ya(d)]=!0;c=-1;1<this.h.a.wp.Aa&&(c=
e);if(2==b&&2==h)return this.RS(e,d,c);if(1==b&&0<h||1==h&&0<b)return this.SS(c);if(0==b||0==h)return b=[],b[0]=this.Pn(),b;throw a.g.wa();};b.prototype.On=function(e,d){var b=a.T.ve(this.h.a.Lb(e)),h=a.T.ve(this.h.a.Lb(d)),c=this.h.ya(e),p=this.h.ya(d);this.Im((c|p)+1);this.Qg[this.h.ya(e)]=!0;this.Qg[this.h.ya(d)]=!0;if(2==b&&2==h)return this.Xp(e,d,-1);if(1==b&&1==h)return this.Yp(-1);if(0==b&&0==h)return this.Pn();throw a.g.wa();};b.ob=function(e){var d=e.D();return 197==d?(d=new a.Ka(e.description),
e.s()||d.Wc(e,!1),d):33==d?(d=new a.pe(e.description),e.s()||d.add(e),d):322==d?(d=new a.Xa(e.description),e.s()||d.Bc(e,!0),d):e};b.Cc=function(e,d,b){var g=e.D();return 197==g?(d=new a.Ka(e.description),e.s()||d.Wc(e,!1),d):33!=g||"|"!=b&&"^"!=b?322==g?(d=new a.Xa(e.description),e.s()||d.Bc(e,!0),d):33==g&&"-"==b&&33==d.D()||550==g&&"\x26"==b&&33==d.D()?(d=new a.Va(e.description),e.s()||e.Sd(0,d),d):e:(d=new a.pe(e.description),e.s()||d.add(e),d)};b.ll=function(e,d,g,h){if(e.s()||d.s()||e.fb()>
d.fb())return b.Cc(b.ob(e),e,"-");var c=new a.i;e.o(c);var m=new a.i;d.o(m);if(!c.jc(m))return b.Cc(b.ob(e),e,"-");var p=new a.i;p.K(c);p.Db(m);g=a.Ia.zd(g,p,!0);m=new b;c=new a.fd;p=c.Eb(b.ob(e));d=c.Eb(b.ob(d));m.Np(c,g,h);h=m.ll(p,d);h=c.hf(h);e=b.Cc(h,e,"-");a.T.Kc(e.D())&&(e.hg(2,g),1736==e.D()&&e.hl());return e};b.TB=function(e,d,g,h){if(e.fb()>d.fb())return b.Cc(b.ob(e),e,"|");if(e.fb()<d.fb()||e.s())return b.Cc(b.ob(d),e,"|");if(d.s())return b.Cc(b.ob(e),e,"|");var c=new a.i;e.o(c);var m=
new a.i;d.o(m);var p=new a.i;p.K(c);p.Db(m);g=a.Ia.zd(g,p,!0);if(!c.jc(m.IN(g,g)))switch(e=b.ob(e),d=b.ob(d),e.D()){case 550:return e=a.T.Yj(e),e.Pd(d,0,-1),e;case 1607:return e=a.T.Yj(e),e.add(d,!1),e;case 1736:return e=a.T.Yj(e),e.add(d,!1),e;default:throw a.g.wa();}m=new b;c=new a.fd;p=c.Eb(b.ob(e));d=c.Eb(b.ob(d));m.Np(c,g,h);d=m.TB(p,d);e=b.Cc(c.hf(d),e,"|");a.T.Kc(e.D())&&(e.hg(2,g),1736==e.D()&&e.hl());return e};b.oM=function(e,d,g){if(2>e.length)throw a.g.N("not enough geometries to dissolve");
for(var h=0,c=0,p=e.length;c<p;c++)h=Math.max(e[c].fb(),h);var f=new a.i;f.Ja();for(var l=new a.fd,q=-1,n=0,z=-1,c=0,p=e.length;c<p;c++)if(e[c].fb()==h)if(e[c].s())-1==z&&(z=c);else{z=c;-1==q?q=l.Eb(b.ob(e[c])):l.YJ(q,b.ob(e[c]));var k=new a.i;e[c].dd(k);f.Db(k);n++}if(2>n)return b.ob(e[z]);e=2==h;d=a.Ia.zd(0==h?d:null,f,!0);return(new b).Qj(l,q,d,e,!0,g)};b.Uw=function(e,d,g,h){var c=[null,null,null],m=new a.i;e.o(m);var p=new a.i;d.o(p);var f=new a.i;f.K(m);f.Db(p);g=a.Ia.zd(g,f,!0);f=new a.i;f.K(p);
p=a.Ia.As(g);f.P(p,p);if(!m.jc(f)){if(e.fb()<=d.fb())return e=b.Cc(b.ob(e.Pa()),e,"\x26"),c[e.fb()]=e,c;if(e.fb()>d.fb())return e=b.Cc(b.ob(d.Pa()),e,"\x26"),c[e.fb()]=e,c}p=new b;m=new a.fd;f=m.Eb(b.ob(e));d=m.Eb(b.ob(d));p.Np(m,g,h);h=p.Uw(f,d);for(d=0;d<h.length;d++)p=b.Cc(m.hf(h[d]),e,"\x26"),a.T.Kc(p.D())&&(p.hg(2,g),1736==p.D()&&p.hl()),c[p.fb()]=p;return c};b.On=function(e,d,g,h){if(e.fb()>d.fb())return b.Cc(b.ob(e),e,"^");if(e.fb()<d.fb()||e.s())return b.Cc(b.ob(d),e,"^");if(d.s())return b.Cc(b.ob(e),
e,"^");var c=new a.i;e.o(c);var m=new a.i;d.o(m);var p=new a.i;p.K(c);p.Db(m);g=a.Ia.zd(g,p,!0);m=new b;c=new a.fd;p=c.Eb(b.ob(e));d=c.Eb(b.ob(d));m.Np(c,g,h);h=m.On(p,d);e=b.Cc(c.hf(h),e,"^");a.T.Kc(e.D())&&(e.hg(2,g),1736==e.D()&&e.hl());return e};b.uT=function(e,d,b){d=d.D();b=b.D();return 550==e.D()&&(33==d||33==b)&&1>=e.F()?(b=new a.Va(e.description),e.s()||e.Sd(0,b),b):e};b.prototype.ZM=function(e,d){var a=this.h.a;e=a.Cf(e,-1);for(var b=d.size,h=0;h<b;h++){var c=d.get(h);a.zi(e,c)}a.Gn(e,!0)};
b.prototype.WR=function(e,d){for(var a=this.h.a,b=a.$c;-1!=b;b=a.we(b))if(b==d)for(var h=a.Vb(b);-1!=h;h=a.bc(h)){var c=a.Cb(h);if(-1!=c)for(var p=a.X(c);-1!=p;){var c=this.h.se(c),f=this.h.se(p),c=this.h.FN(c,f);-1!=c&&(f=this.h.sa(c),this.h.Bb(c,e,1),this.h.Bb(f,e,2));c=p;p=a.X(c)}}};b.prototype.XQ=function(e,d,b,h){b=this.h.ya(b);h=this.h.ya(h);var g=new a.ga(0);g.xb(256);for(var c=this.h.a,p=this.h.Eg(),m=this.h.Be;-1!=m;m=this.h.Bf(m)){var f=this.h.te(m);if(-1!=f){var l=f;do{if(1!=this.h.tb(l,
p)){var q=l,n=l,z=!1,k=0;do{this.h.Bb(q,p,1);if(!z){var t=this.h.Gg(q);0!=(t&h)&&0!=(this.h.Qe(q)&b)&&(n=q,z=!0)}z&&(g.add(this.h.Gi(this.h.ol(this.h.qj(q)))),-1!=e&&(t=this.h.Gg(q),0!=(t&h)&&(t=this.h.tb(q,e),k|=t)));q=this.h.Wb(q)}while(q!=n);z&&0<this.h.yo(this.h.Pe(n))&&(q=c.jg(1736),this.ZM(q,g),-1!=d&&c.EF(q,d,k));g.clear(!1)}l=this.h.Wb(this.h.sa(l))}while(l!=f)}}this.h.kh(p)};b.prototype.WL=function(e,d,a,b){this.h.uR();var g=-1;-1!=e&&(g=this.h.Eg(),this.WR(g,a));this.XQ(g,e,d,a);var h=this.h.a;
e=0;for(g=h.$c;-1!=g;g=h.we(g))g!=d&&g!=a&&(b.add(g),e++);b.xd(0,e,function(d,e){d=h.Gw(h.Vb(d));e=h.Gw(h.Vb(e));return d<e?-1:d==e?0:1})};b.prototype.xg=function(){null!=this.h&&(this.h.xg(),this.h=null)};return b}();a.Of=b})(A||(A={}));(function(a){var b=function(){function b(e){void 0!==e?this.Ly(e):this.IF()}b.prototype.Lu=function(){this.Ob=this.Nb=this.sb=this.rb=this.eb=this.mb=0};b.prototype.lc=function(e){return this==e?!0:e instanceof b?this.mb==e.mb&&this.rb==e.rb&&this.Nb==e.Nb&&this.sb==
e.sb&&this.eb==e.eb&&this.Ob==e.Ob:!1};b.prototype.hc=function(){a.I.Rh();a.I.Rh();a.I.Rh();a.I.Rh();a.I.Rh();return a.I.Rh()};b.prototype.Zi=function(e,d){var a=this.sb*e.x+this.eb*e.y+this.Ob;d.x=this.mb*e.x+this.rb*e.y+this.Nb;d.y=a};b.prototype.multiply=function(e){b.multiply(this,e,this)};b.multiply=function(e,d,a){var b,g,c,h,p;b=e.mb*d.mb+e.sb*d.rb;g=e.rb*d.mb+e.eb*d.rb;c=e.Nb*d.mb+e.Ob*d.rb+d.Nb;h=e.mb*d.sb+e.sb*d.eb;p=e.rb*d.sb+e.eb*d.eb;e=e.Nb*d.sb+e.Ob*d.eb+d.Ob;a.mb=b;a.rb=g;a.Nb=c;a.sb=
h;a.eb=p;a.Ob=e};b.prototype.vm=function(){var e=new b;e.mb=this.mb;e.rb=this.rb;e.Nb=this.Nb;e.sb=this.sb;e.eb=this.eb;e.Ob=this.Ob;return e};b.prototype.$y=function(e){if(!e.s()){for(var d=[],b=0;4>b;b++)d[b]=new a.b;e.hy(d);this.US(d,d);e.Ey(d,4)}};b.prototype.US=function(e,d){for(var b=0;b<e.length;b++){var c=new a.b,h=e[b];c.x=this.mb*h.x+this.rb*h.y+this.Nb;c.y=this.sb*h.x+this.eb*h.y+this.Ob;d[b]=c}};b.prototype.wO=function(e,d){e.s()||d.s()||0==e.aa()||0==e.ba()?this.Lu():(this.rb=this.sb=
0,this.mb=d.aa()/e.aa(),this.eb=d.ba()/e.ba(),this.Nb=d.v-e.v*this.mb,this.Ob=d.C-e.C*this.eb)};b.prototype.TS=function(e){var d=new a.b,b=new a.b;d.ma(this.mb,this.sb);b.ma(this.rb,this.eb);d.sub(d);var c=.5*d.Up();d.ma(this.mb,this.sb);b.ma(this.rb,this.eb);d.add(b);d=.5*d.Up();return e*(c>d?Math.sqrt(c):Math.sqrt(d))};b.prototype.IF=function(){this.mb=1;this.sb=this.Nb=this.rb=0;this.eb=1;this.Ob=0};b.prototype.XO=function(){return 1==this.mb&&1==this.eb&&0==this.rb&&0==this.Nb&&0==this.sb&&0==
this.Ob};b.prototype.mg=function(e){return Math.abs(this.mb*this.eb-this.sb*this.rb)<=2*e*(Math.abs(this.mb*this.eb)+Math.abs(this.sb*this.rb))};b.prototype.Nn=function(e,d){this.mb=1;this.rb=0;this.Nb=e;this.sb=0;this.eb=1;this.Ob=d};b.prototype.Ly=function(e,d){void 0!==d?(this.mb=e,this.sb=this.Nb=this.rb=0,this.eb=d,this.Ob=0):this.Ly(e,e)};b.prototype.Oy=function(){this.mb=0;this.rb=1;this.Nb=0;this.sb=1;this.Ob=this.eb=0};b.prototype.jS=function(e){this.kS(Math.cos(e),Math.sin(e))};b.prototype.kS=
function(e,d){this.mb=e;this.rb=-d;this.Nb=0;this.sb=d;this.eb=e;this.Ob=0};b.prototype.shift=function(e,d){this.Nb+=e;this.Ob+=d};b.prototype.scale=function(e,d){this.mb*=e;this.rb*=e;this.Nb*=e;this.sb*=d;this.eb*=d;this.Ob*=d};b.prototype.rotate=function(e){var d=new b;d.jS(e);this.multiply(d)};b.prototype.inverse=function(e){if(void 0!==e){var d=this.mb*this.eb-this.rb*this.sb;0==d?e.Lu():(d=1/d,e.Nb=(this.rb*this.Ob-this.Nb*this.eb)*d,e.Ob=(this.Nb*this.sb-this.mb*this.Ob)*d,e.mb=this.eb*d,e.rb=
-this.rb*d,e.sb=-this.sb*d,e.eb=this.mb*d)}else this.inverse(this)};return b}();a.Bg=b})(A||(A={}));(function(a){var b=function(){function b(){}b.prototype.Lu=function(){this.fh=this.Ob=this.Nb=this.Le=this.Ie=this.He=this.Ke=this.eb=this.rb=this.ef=this.sb=this.mb=0};b.prototype.Ly=function(e,d,a){this.mb=e;this.rb=this.ef=this.sb=0;this.eb=d;this.Ie=this.He=this.Ke=0;this.Le=a;this.fh=this.Ob=this.Nb=0};b.prototype.$y=function(e){if(e.s())return e;for(var d=new a.ee[8],b=0;8>b;b++)d[b]=new a.ee;
e.hy(d);this.transform(d,8,d);e.Ey(d);return e};b.prototype.transform=function(e,d,b){for(var g=0;g<d;g++){var c=new a.ee,h=e[g];c.x=this.mb*h.x+this.rb*h.y+this.He*h.z+this.Nb;c.y=this.sb*h.x+this.eb*h.y+this.Ie*h.z+this.Ob;c.z=this.ef*h.x+this.Ke*h.y+this.Le*h.z+this.fh;b[g]=c}};b.prototype.Qn=function(e){var d=new a.ee;d.x=this.mb*e.x+this.rb*e.y+this.He*e.z+this.Nb;d.y=this.sb*e.x+this.eb*e.y+this.Ie*e.z+this.Ob;d.z=this.ef*e.x+this.Ke*e.y+this.Le*e.z+this.fh;return d};b.prototype.Ap=function(e){b.multiply(this,
e,this)};b.multiply=function(e,d,a){var b,g,c,h,p,f,l,q,n,z,k;b=e.mb*d.mb+e.sb*d.rb+e.ef*d.He;g=e.mb*d.sb+e.sb*d.eb+e.ef*d.Ie;c=e.mb*d.ef+e.sb*d.Ke+e.ef*d.Le;h=e.rb*d.mb+e.eb*d.rb+e.Ke*d.He;p=e.rb*d.sb+e.eb*d.eb+e.Ke*d.Ie;f=e.rb*d.ef+e.eb*d.Ke+e.Ke*d.Le;l=e.He*d.mb+e.Ie*d.rb+e.Le*d.He;q=e.He*d.sb+e.Ie*d.eb+e.Le*d.Ie;n=e.He*d.ef+e.Ie*d.Ke+e.Le*d.Le;z=e.Nb*d.mb+e.Ob*d.rb+e.fh*d.He+d.Nb;k=e.Nb*d.sb+e.Ob*d.eb+e.fh*d.Ie+d.Ob;e=e.Nb*d.ef+e.Ob*d.Ke+e.fh*d.Le+d.fh;a.mb=b;a.sb=g;a.ef=c;a.rb=h;a.eb=p;a.Ke=
f;a.He=l;a.Ie=q;a.Le=n;a.Nb=z;a.Ob=k;a.fh=e};b.inverse=function(e,d){var b=e.mb*(e.eb*e.Le-e.Ke*e.Ie)-e.sb*(e.rb*e.Le-e.Ke*e.He)+e.ef*(e.rb*e.Ie-e.eb*e.He);if(0!=b){var c,h,p,f,l,q,n,z,k,t;z=1/b;b=(e.eb*e.Le-e.Ke*e.Ie)*z;p=-(e.rb*e.Le-e.Ke*e.He)*z;q=(e.rb*e.Ie-e.eb*e.He)*z;c=-(e.sb*e.Le-e.Ie*e.ef)*z;f=(e.mb*e.Le-e.ef*e.He)*z;n=-(e.mb*e.Ie-e.sb*e.He)*z;h=(e.sb*e.Ke-e.ef*e.eb)*z;l=-(e.mb*e.Ke-e.ef*e.rb)*z;z*=e.mb*e.eb-e.sb*e.rb;k=-(e.Nb*b+e.Ob*p+e.fh*q);t=-(e.Nb*c+e.Ob*f+e.fh*n);e=-(e.Nb*h+e.Ob*l+e.fh*
z);d.mb=b;d.sb=c;d.ef=h;d.rb=p;d.eb=f;d.Ke=l;d.He=q;d.Ie=n;d.Le=z;d.Nb=k;d.Ob=t;d.fh=e}else throw a.g.ra("math singularity");};b.prototype.vm=function(){var e=new b;e.mb=this.mb;e.sb=this.sb;e.ef=this.ef;e.rb=this.rb;e.eb=this.eb;e.Ke=this.Ke;e.He=this.He;e.Ie=this.Ie;e.Le=this.Le;e.Nb=this.Nb;e.Ob=this.Ob;e.fh=this.fh;return e};return b}();a.ZT=b})(A||(A={}));(function(a){var b=function(e){function d(d){if(void 0!==d)e.call(this,d.hc(),d);else{e.call(this);this.Jf=[];this.Jf[0]=0;this.Aa=1;this.Wg=
[];for(d=0;10>d;d++)this.Wg[d]=-1;this.Wg[this.Jf[0]]=0}this.To=!0}z(d,e);d.prototype.Ne=function(d){this.hasAttribute(d)||(this.Wg[d]=0,this.xA())};d.prototype.removeAttribute=function(d){if(0==d)throw a.g.N("Position attribue cannot be removed");this.hasAttribute(d)&&(this.Wg[d]=-1,this.xA())};d.prototype.reset=function(){this.Jf[0]=0;this.Aa=1;for(var d=0;d<this.Wg.length;d++)this.Wg[d]=-1;this.Wg[this.Jf[0]]=0;this.To=!0};d.prototype.qw=function(){return c.ww().add(this)};d.Tf=function(){return c.ww().iO()};
d.Zn=function(){return c.ww().jO()};d.prototype.pJ=function(){var d=this.hc();return new a.pa(d,this)};d.prototype.xA=function(){for(var d=this.Aa=0,e=0;10>d;d++)0<=this.Wg[d]&&(this.Jf[e]=d,this.Wg[d]=e,e++,this.Aa++);this.To=!0};d.prototype.hc=function(){this.To&&(this.tk=this.jj(),this.To=!1);return this.tk};d.prototype.lc=function(e){if(null==e)return!1;if(e==this)return!0;if(!(e instanceof d)||e.Aa!=this.Aa)return!1;for(var a=0;a<this.Aa;a++)if(this.Jf[a]!=e.Jf[a])return!1;return this.To!=e.To?
!1:!0};d.prototype.qD=function(d){if(d.Aa!=this.Aa)return!1;for(var e=0;e<this.Aa;e++)if(this.Jf[e]!=d.Jf[e])return!1;return!0};d.iu=function(d,e){for(var a=[],b=0;b<d.Aa;b++)a[b]=-1;for(var b=0,g=d.Aa;b<g;b++)a[b]=e.zf(d.Hd(b));return a};d.PN=function(e,a){e=new d(e);e.Ne(a);return e.qw()};d.QN=function(e,a){for(var b=null,g=0;10>g;g++)!e.hasAttribute(g)&&a.hasAttribute(g)&&(null==b&&(b=new d(e)),b.Ne(g));return null!=b?b.qw():e};d.bo=function(e,a){e=new d(e);e.removeAttribute(a);return e.qw()};
return d}(a.pa);a.Od=b;var c=function(){function e(){this.map=[];var d=new b;this.add(d);d=new b;d.Ne(1);this.add(d)}e.ww=function(){return e.lI};e.prototype.iO=function(){return e.Yn};e.prototype.jO=function(){return e.Zn};e.prototype.add=function(d){var a=d.hc();if(null!=e.Yn&&e.Yn.hc()==a&&d.qD(e.Yn))return e.Yn;if(null!=e.Zn&&e.Zn.hc()==a&&d.qD(e.Zn))return e.Zn;var b=null;void 0!==this.map[a]&&(b=this.map[a]);null==b&&(b=d.pJ(),1==b.Aa?e.Yn=b:2==b.Aa&&1==b.Hd(1)?e.Zn=b:this.map[a]=b);return b};
e.lI=new e;return e}()})(A||(A={}));var P=0==k.version.indexOf("4."),U;(function(a){a[a.Linear=0]="Linear";a[a.Angular=1]="Angular";a[a.Area=2]="Area";a[a.LinearOrAngular=3]="LinearOrAngular"})(U||(U={}));var N={feet:9002,kilometers:9036,meters:9001,miles:9035,"nautical-miles":9030,yards:9096},R={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109413,"square-yards":109442},S={degrees:9102,radians:9101};void 0===a.prototype.getCacheValue&&
q.extend(a,{cache:null,getCacheValue:function(a){if(null===this.cache||void 0===this.cache)this.cache={};return this.cache[a]},setCacheValue:function(a,b){if(null===this.cache||void 0===this.cache)this.cache={};this.cache[a]=b}});var T=A.Nf.create(4326),V=A.Nf.create(102100);return function(){function b(){}b.extendedSpatialReferenceInfo=function(a){if(null===a)return null;a=F(a);var b=a.Se();return{tolerance:a.xq(),unitType:null==b?-1:b.Nc,unitID:null==b?-1:b.Qc(),unitBaseFactor:null==b?0:b.Dj,unitSquareDerivative:null==
b?0:A.Tb.PC(b).Qc()}};b.clip=function(a,b){if(null===a)return null;b=A.Pb.clip(G(a),G(b),p(a));return w(b,a.spatialReference)};b.cut=function(a,b){b=G(b);b=A.Pb.xm(G(a),b,p(a));for(var e=[],d=0;d<b.length;d++)e.push(w(b[d],a.spatialReference));return e};b.contains=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.contains(G(a),G(b),p(a))};b.crosses=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.VL(G(a),G(b),p(a))};
b.distance=function(a,b,e){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.Fb(G(a),G(b),p(a),A.Tb.Qd(B(e,3)))};b.equals=function(a,b){return null===a&&null!==b||null===b&&null!==a?!1:A.Pb.lc(G(a),G(b),p(a))};b.intersects=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.RO(G(a),G(b),p(a))};b.touches=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.touches(G(a),G(b),p(a))};b.within=function(a,
b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.jT(G(a),G(b),p(a))};b.disjoint=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.nM(G(a),G(b),p(a))};b.overlaps=function(a,b){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.tQ(G(a),G(b),p(a))};b.relate=function(a,b,e){if(null===a||null===b)throw Error("Illegal Argument Exception");return A.Pb.py(G(a),G(b),p(a),e)};b.isSimple=function(a){if(null===a)throw Error("Illegal Argument Exception");
return A.Pb.cP(G(a),p(a))};b.simplify=function(a){if(null===a)throw Error("Illegal Argument Exception");var b=A.Pb.Qy(G(a),p(a));return w(b,a.spatialReference)};b.convexHull=function(c,h){void 0===h&&(h=!1);if(null===c)throw Error("Illegal Argument Exception");return c instanceof a?(h=A.Pb.JL(G(c),p(c)),w(h,c.spatialReference)):b.NI(c,h)};b.NI=function(a,b){for(var e=[],d=0;d<a.length;d++)e.push(G(a[d]));e=A.Pb.KL(e,b);for(d=0;d<e.length;d++)e[d]=w(e[d],a[0].spatialReference);return e};b.difference=
function(c,h){if(null===c||null===h)throw Error("Illegal Argument Exception");return c instanceof a?(h=A.Pb.ll(G(c),G(h),p(c)),w(h,c.spatialReference)):b.XL(c,h)};b.XL=function(a,b){for(var e=[],d=0;d<a.length;d++)e.push(G(a[d]));e=A.Pb.kM(e,G(b),p(b));for(d=0;d<e.length;d++)e[d]=w(e[d],b.spatialReference);return e};b.symmetricDifference=function(c,h){if(null===c||null===h)throw Error("Illegal Argument Exception");return c instanceof a?(h=A.Pb.On(G(c),G(h),p(c)),w(h,c.spatialReference)):b.tO(c,h)};
b.tO=function(a,b){for(var e=[],d=0;d<a.length;d++)e.push(G(a[d]));e=A.Pb.MS(e,G(b),p(b));for(d=0;d<e.length;d++)e[d]=w(e[d],b.spatialReference);return e};b.intersect=function(c,h){if(null===c||null===h)throw Error("Illegal Argument Exception");return c instanceof a?(h=A.Pb.Ga(G(c),G(h),p(c)),w(h,c.spatialReference)):b.EM(c,h)};b.EM=function(a,b){for(var e=[],d=0;d<a.length;d++)e.push(G(a[d]));e=A.Pb.QO(e,G(b),p(b));for(d=0;d<e.length;d++)e[d]=w(e[d],b.spatialReference);return e};b.union=function(b,
c){void 0===c&&(c=null);if(null===b)return null;b instanceof a&&(b=[b],null!==c&&b.push(c));if(0===b.length)return null;c=[];for(var e=0;e<b.length;e++)c.push(G(b[e]));return w(A.Pb.aT(c,p(b[0])),b[0].spatialReference)};b.offset=function(c,h,e,d,g,m){var f=0;if(null!=d&&void 0!=d)switch(d){case "round":f=0;break;case "bevel":f=1;break;case "miter":f=2;break;case "square":f=3}return c instanceof a?(h=A.Pb.offset(G(c),p(c),h,f,g,m,A.Tb.Qd(B(e,3))),w(h,c.spatialReference)):b.qO(c,h,e,f,g,m)};b.qO=function(a,
b,e,d,g,c){if(null===a)return null;if(0===a.length)return[];for(var h=[],m=0;m<a.length;m++)h.push(G(a[m]));b=A.Pb.sQ(h,p(a[0]),b,d,g,c,A.Tb.Qd(B(e,3)));for(m=0;m<b.length;m++)b[m]=w(b[m],a[0].spatialReference);return b};b.buffer=function(c,h,e,d){void 0===d&&(d=!1);if(c instanceof a)return h=A.Pb.buffer(G(c),p(c),h,A.Tb.Qd(B(e,3)),!1,0,NaN),w(h,c.spatialReference);if("[object Array]"!==Object.prototype.toString.call(h)){for(var g=[],m=0;m<c.length;m++)g.push(h);h=g}if(h.length!=c.length){if(0==h.length)throw Error("Illegal Argument Exception");
for(var g=[],f=0,m=0;m<c.length;m++)void 0===h[m]?g.push(f):(g.push(h[m]),f=h[m]);h=g}return b.vG(c,h,e,!1,d,"geodesic",NaN)};b.geodesicBuffer=function(c,h,e,d,g,m){if(c instanceof a)return void 0===g&&(g=NaN),h=A.Pb.buffer(G(c),p(c),h,A.Tb.Qd(B(e,0)),!0,v(d),g),w(h,c.spatialReference);if("[object Array]"!==Object.prototype.toString.call(h)){for(var f=[],l=0;l<c.length;l++)f.push(h);h=f}if(h.length!=c.length){if(0==h.length)throw Error("Illegal Argument Exception");for(var f=[],q=0,l=0;l<c.length;l++)void 0===
h[l]?f.push(q):(f.push(h[l]),q=h[l]);h=f}return b.vG(c,h,e,!0,d,g,m)};b.vG=function(a,b,e,d,g,c,h){if(null===a)return null;if(0===a.length)return[];void 0===h&&(h=NaN);for(var m=[],f=0;f<a.length;f++)m.push(G(a[f]));b=A.Pb.rK(m,p(a[0]),b,A.Tb.Qd(B(e,0)),d,g,v(c),h);for(f=0;f<b.length;f++)b[f]=w(b[f],a[0].spatialReference);return b};b.nearestCoordinate=function(a,b,e){void 0===e&&(e=!0);b=A.Pb.zw(G(a),G(b),e);return{coordinate:w(b.pw(),a.spatialReference),distance:b.sw(),isRightSide:b.Xw(),vertexIndex:b.gb(),
isEmpty:b.s()}};b.nearestVertex=function(a,b){b=A.Pb.Aw(G(a),G(b));return{coordinate:w(b.pw(),a.spatialReference),distance:b.sw(),isRightSide:b.Xw(),vertexIndex:b.gb(),isEmpty:b.s()}};b.nearestVertices=function(a,b,e,d){b=G(b);e=A.Pb.Bw(G(a),b,e,d);d=[];for(b=0;b<e.length;b++)!1===e[b].s()&&d.push({coordinate:w(e[b].pw(),a.spatialReference),distance:e[b].sw(),isRightSide:e[b].Xw(),vertexIndex:e[b].gb(),isEmpty:e[b].s()});return d};b.generalize=function(a,b,e,d){b=A.Pb.fN(G(a),p(a),b,e,A.Tb.Qd(B(d,
3)));return w(b,a.spatialReference)};b.densify=function(a,b,e){b=A.Pb.oq(G(a),p(a),b,A.Tb.Qd(B(e,3)));return w(b,a.spatialReference)};b.geodesicDensify=function(a,b,e,d){void 0===d&&(d=0);b=A.Pb.fw(G(a),p(a),b,A.Tb.Qd(B(e,3)),d);return w(b,a.spatialReference)};b.rotate=function(a,b,e){if(void 0===e||null===e)switch(a.type){case "point":e=a;break;case "extent":e=P?a.get("center"):a.getCenter();break;default:e=P?a.get("extent").get("center"):a.getExtent().getCenter()}b=P?A.Wn.rotate(a.toJSON(),b,e.toJSON()):
A.Wn.rotate(a.toJson(),b,e.toJson());P?(b=y(b),b.set("spatialReference",a.spatialReference)):(b=l(b),b.setSpatialReference(a.spatialReference));return b};b.flipHorizontal=function(a,b){if(void 0===b||null===b)switch(a.type){case "point":b=a;break;case "extent":b=P?a.get("center"):a.getCenter();break;default:b=P?a.get("extent").get("center"):a.getExtent().getCenter()}b=P?A.Wn.eC(a.toJSON(),b.toJSON()):A.Wn.eC(a.toJson(),b.toJson());P?(b=y(b),b.set("spatialReference",a.spatialReference)):(b=l(b),b.setSpatialReference(a.spatialReference));
return b};b.flipVertical=function(a,b){if(void 0===b||null===b)switch(a.type){case "point":b=a;break;case "extent":b=P?a.get("center"):a.getCenter();break;default:b=P?a.get("extent").get("center"):a.getExtent().getCenter()}b=P?A.Wn.fC(a.toJSON(),b.toJSON()):A.Wn.fC(a.toJson(),b.toJson());P?(b=y(b),b.set("spatialReference",a.spatialReference)):(b=l(b),b.setSpatialReference(a.spatialReference));return b};b.planarArea=function(a,b){if(null===a)throw Error("Illegal Argument Exception");return A.Pb.BQ(G(a),
p(a),A.Tb.Qd(B(b,2)))};b.planarLength=function(a,b){if(null===a)throw Error("Illegal Argument Exception");return A.Pb.CQ(G(a),p(a),A.Tb.Qd(B(b,3)))};b.geodesicArea=function(a,b,e){if(null===a)throw Error("Illegal Argument Exception");return A.Pb.jN(G(a),p(a),A.Tb.Qd(B(b,2)),v(e))};b.geodesicLength=function(a,b,e){if(null===a)throw Error("Illegal Argument Exception");return A.Pb.nN(G(a),p(a),A.Tb.Qd(B(b,0)),v(e))};return b}()})},"esri/widgets/support/AnchorElementViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/watchUtils ../../core/Accessor ../../core/Evented ../../core/HandleRegistry ../../core/watchUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){return function(l){function n(){var a=l.call(this)||this;a._anchorHandles=new f;a.location=null;a.screenLocation=null;a.screenLocationEnabled=!1;a.view=null;a._anchorHandles.add([q.watch(a,"screenLocationEnabled,location,view.size",function(){return a._updateScreenPointAndHandle()}),q.watch(a,"view, view.ready",function(){return a._wireUpView()})]);return a}k(n,l);n.prototype.destroy=function(){this.view=null;this._anchorHandles&&this._anchorHandles.destroy();this._viewpointHandle=
this._anchorHandles=null};n.prototype._wireUpView=function(){var a=this;this._anchorHandles.remove("view");this._viewpointHandle=null;if(this.get("view.ready")){this._setScreenLocation();var b=this.view,b=c.pausable(b,"3d"===b.type?"camera":"viewpoint",function(){return a._viewpointChange()});this._anchorHandles.add(b,"view");this._viewpointHandle=b;this._toggleWatchingViewpoint()}};n.prototype._viewpointChange=function(){this._setScreenLocation();this.emit("view-change")};n.prototype._updateScreenPointAndHandle=
function(){this._setScreenLocation();this._toggleWatchingViewpoint()};n.prototype._toggleWatchingViewpoint=function(){var a=this._viewpointHandle,b=this.screenLocationEnabled;a&&(this.location&&b?a.resume():a.pause())};n.prototype._setScreenLocation=function(){var a=this.location,b=this.view,c=this.screenLocationEnabled,f=this.get("view.ready"),a=c&&a&&f?b.toScreen(a):null;this._set("screenLocation",a)};a([b.property()],n.prototype,"location",void 0);a([b.property({readOnly:!0})],n.prototype,"screenLocation",
void 0);a([b.property()],n.prototype,"screenLocationEnabled",void 0);a([b.property()],n.prototype,"view",void 0);return n=a([b.subclass("esri.widgets.support.AnchorElementViewModel")],n)}(b.declared(t,n))})},"esri/widgets/Spinner":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ./support/widget ../core/accessorSupport/decorators ./Widget ../core/promiseUtils ../core/watchUtils ./support/AnchorElementViewModel".split(" "),function(x,r,k,a,
b,c,t,n,f,q){return function(l){function t(a){a=l.call(this)||this;a._animationDelay=500;a._animationPromise=null;a.location=null;a.view=null;a.visible=!1;a.viewModel=new q;return a}k(t,l);t.prototype.postInitialize=function(){var a=this;this.own([f.watch(this,"visible",function(b){return a._visibleChange(b)})])};t.prototype.destroy=function(){this._cancelAnimationPromise()};t.prototype.show=function(a){var b=this,c=a.location;a=a.promise;c&&(this.viewModel.location=c);this.visible=!0;a&&a.always(function(){return b.hide()})};
t.prototype.hide=function(){this.visible=!1};t.prototype.render=function(){var a=this.visible,c=!!this.viewModel.screenLocation,a=(f={},f["esri-spinner--start"]=a&&c,f["esri-spinner--finish"]=!a&&c,f),f=this._getPositionStyles();return b.tsx("div",{class:"esri-spinner",classes:a,styles:f});var f};t.prototype._cancelAnimationPromise=function(){this._animationPromise&&(this._animationPromise.cancel(),this._animationPromise=null)};t.prototype._visibleChange=function(a){var b=this;a?this.viewModel.screenLocationEnabled=
!0:(this._cancelAnimationPromise(),this._animationPromise=n.after(this._animationDelay).then(function(){b.viewModel.screenLocationEnabled=!1;b._animationPromise=null}))};t.prototype._getPositionStyles=function(){var a=this.viewModel.screenLocation;return a?{left:a.x+"px",top:a.y+"px"}:{}};a([c.aliasOf("viewModel.location")],t.prototype,"location",void 0);a([c.aliasOf("viewModel.view")],t.prototype,"view",void 0);a([c.property(),b.renderable()],t.prototype,"visible",void 0);a([c.property({type:q}),
b.renderable(["viewModel.screenLocation","viewModel.screenLocationEnabled"])],t.prototype,"viewModel",void 0);return t=a([c.subclass("esri.widgets.Spinner")],t)}(c.declared(t))})},"esri/views/overlay/ViewOverlay":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper dojo/dom ../../core/Accessor ../../core/accessorSupport/decorators ../../core/Collection ../../widgets/libs/maquette/maquette".split(" "),function(x,r,k,a,b,c,t,n,f){return function(c){function l(){var a=
null!==c&&c.apply(this,arguments)||this;a.items=new n;a._callbacks=new Map;a._projector=f.createProjector();return a}k(l,c);Object.defineProperty(l.prototype,"needsRender",{get:function(){return 0<this.items.length},enumerable:!0,configurable:!0});l.prototype.initialize=function(){var a=this,c=document.createElement("div");c.className="esri-overlay-surface";b.setSelectable(c,!1);this._set("surface",c);this._itemsChangeHandle=this.items.on("change",function(b){b.added.map(function(b){var c=function(){return b.render()};
a._callbacks.set(b,c);a._projector.append(a.surface,c)});b.removed.map(function(b){var c=a._projector.detach(a._callbacks.get(b));a.surface.removeChild(c.domNode);a._callbacks.delete(b)})})};l.prototype.addItem=function(a){this.items.add(a)};l.prototype.removeItem=function(a){this.items.remove(a)};l.prototype.destroy=function(){this.items.removeAll();this._itemsChangeHandle.remove();this._projector=this._callbacks=null};l.prototype.render=function(){this._projector.renderNow()};a([t.property({type:HTMLDivElement})],
l.prototype,"surface",void 0);a([t.property({type:n})],l.prototype,"items",void 0);a([t.property({readOnly:!0,dependsOn:["items.length"]})],l.prototype,"needsRender",null);return l=a([t.subclass("esri.views.overlay.ViewOverlay")],l)}(t.declared(c))})},"esri/views/ui/DefaultUI":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/watchUtils ./UI ./Component ../../widgets/Attribution ../../widgets/Compass ../../widgets/Zoom ../../widgets/NavigationToggle dojo/dom-geometry".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){return function(t){function v(a){a=t.call(this)||this;a._defaultPositionLookup=null;a.components=[];return a}k(v,t);v.prototype.initialize=function(){this._handles.add([c.init(this,"components",this._componentsWatcher.bind(this)),c.init(this,"view",this._updateViewAwareWidgets.bind(this))])};v.prototype._findComponentPosition=function(a){if(!this._defaultPositionLookup){var b=B.isBodyLtr();this._defaultPositionLookup={attribution:"manual",compass:b?"top-left":"top-right",
"navigation-toggle":b?"top-left":"top-right",zoom:b?"top-left":"top-right"}}return this._defaultPositionLookup[a]};v.prototype._removeComponents=function(a){var b=this;a.forEach(function(a){if(a=b.find(a))b.remove(a),a.destroy()})};v.prototype._updateViewAwareWidgets=function(a){var b=this;this.components.forEach(function(c){(c=(c=b.find(c))&&c.widget)&&void 0!==c.view&&c.set("view",a)})};v.prototype._componentsWatcher=function(a,b){this._removeComponents(b);this._addComponents(a)};v.prototype._addComponents=
function(a){var b=this;this.initialized&&a.forEach(function(a){return b.add(b._createComponent(a),b._findComponentPosition(a))})};v.prototype._createComponent=function(a){var b=this._createWidget(a);if(b)return new n({id:a,node:b})};v.prototype._createWidget=function(a){if("attribution"===a)return this._createAttribution();if("compass"===a)return this._createCompass();if("navigation-toggle"===a)return this._createNavigationToggle();if("zoom"===a)return this._createZoom()};v.prototype._createAttribution=
function(){return new f({view:this.view})};v.prototype._createCompass=function(){return new q({view:this.view})};v.prototype._createNavigationToggle=function(){return new y({view:this.view})};v.prototype._createZoom=function(){return new l({view:this.view})};a([b.property()],v.prototype,"components",void 0);return v=a([b.subclass("esri.views.ui.DefaultUI")],v)}(b.declared(t))})},"esri/views/ui/UI":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ./Component ../../core/Accessor ../../core/Evented ../../core/HandleRegistry ../../core/watchUtils dojo/_base/lang dojo/dom-class dojo/dom-construct dojo/dom-style".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){function w(a){return"object"!==typeof a||a&&a.isInstanceOf&&a.isInstanceOf(c)||!("component"in a||"index"in a||"position"in a)?null:a}var D={left:0,top:0,bottom:0,right:0},F={bottom:30,top:15,right:15,left:15};return function(n){function p(){var a=n.call(this)||this;a._cornerNameToContainerLookup={};a._positionNameToContainerLookup={};a._components=[];a._handles=new f;a.padding=F;a.view=null;a._initContainers();return a}k(p,n);p.prototype.initialize=function(){this._handles.add([q.init(this,
"view.padding, container",this._applyViewPadding.bind(this)),q.init(this,"padding",this._applyUIPadding.bind(this))])};p.prototype.destroy=function(){this.container=null;this._components.forEach(function(a){a.destroy()});this._components.length=0;this._handles.destroy()};Object.defineProperty(p.prototype,"container",{set:function(a){var b=this._get("container");a!==b&&(a&&(y.add(a,"esri-ui"),this._attachContainers(a)),b&&(y.remove(b,"esri-ui"),v.set(b,{top:"",bottom:"",left:"",right:""}),B.empty(b)),
this._set("container",a))},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"height",{get:function(){var a=this.get("view.height")||0;if(0===a)return a;var b=this._getViewPadding();return Math.max(a-(b.top+b.bottom),0)},enumerable:!0,configurable:!0});p.prototype.castPadding=function(a){return"number"===typeof a?{bottom:a,top:a,right:a,left:a}:l.mixin({},F,a)};Object.defineProperty(p.prototype,"width",{get:function(){var a=this.get("view.width")||0;if(0===a)return a;var b=this._getViewPadding();
return Math.max(a-(b.left+b.right),0)},enumerable:!0,configurable:!0});p.prototype.add=function(a,b){var p=this,f;if(Array.isArray(a))a.forEach(function(a){return p.add(a,b)});else{var l=w(a);l&&(f=l.index,b=l.position,a=l.component);b&&"object"===typeof b&&(f=b.index,b=b.position);!a||b&&!this._isValidPosition(b)||(a&&a.isInstanceOf&&a.isInstanceOf(c)||(a=new c({node:a})),this._place({component:a,position:b,index:f}),this._components.push(a))}};p.prototype.remove=function(a){if(a){if(Array.isArray(a))return a.map(this.remove,
this);if(a=this.find(a)){var b=this._components.indexOf(a);a.node.parentNode&&a.node.parentNode.removeChild(a.node);return this._components.splice(b,1)[0]}}};p.prototype.empty=function(a){var b=this;if(Array.isArray(a))return a.map(function(a){return b.empty(a)}).reduce(function(a,b){return a.concat(b)});a=a||"manual";if("manual"===a)return Array.prototype.slice.call(this._manualContainer.children).filter(function(a){return!y.contains(a,"esri-ui-corner")}).map(function(a){return b.remove(a)});if(this._isValidPosition(a))return Array.prototype.slice.call(this._cornerNameToContainerLookup[a].children).map(this.remove,
this)};p.prototype.move=function(a,b){var c=this;Array.isArray(a)&&a.forEach(function(a){return c.move(a,b)});if(a){var p,f=w(a)||w(b);f&&(p=f.index,b=f.position,a=f.component||a);(!b||this._isValidPosition(b))&&(a=this.remove(a))&&this.add(a,{position:b,index:p})}};p.prototype.find=function(a){return a?a&&a.isInstanceOf&&a.isInstanceOf(c)?this._findByComponent(a):"string"===typeof a?this._findById(a):this._findByNode(a.domNode||a):null};p.prototype._getViewPadding=function(){return this.get("view.padding")||
D};p.prototype._attachContainers=function(a){B.place(this._manualContainer,a);B.place(this._innerContainer,a)};p.prototype._initContainers=function(){var a=B.create("div",{className:"esri-ui-inner-container esri-ui-corner-container"}),b=B.create("div",{className:"esri-ui-inner-container esri-ui-manual-container"}),c=B.create("div",{className:"esri-ui-top-left esri-ui-corner"},a),p=B.create("div",{className:"esri-ui-top-right esri-ui-corner"},a),f=B.create("div",{className:"esri-ui-bottom-left esri-ui-corner"},
a),q=B.create("div",{className:"esri-ui-bottom-right esri-ui-corner"},a);this._innerContainer=a;this._manualContainer=b;this._cornerNameToContainerLookup={"top-left":c,"top-right":p,"bottom-left":f,"bottom-right":q};this._positionNameToContainerLookup=l.mixin({manual:b},this._cornerNameToContainerLookup)};p.prototype._isValidPosition=function(a){return!!this._positionNameToContainerLookup[a]};p.prototype._place=function(a){var b=a.component,c=a.index;a=this._positionNameToContainerLookup[a.position||
"manual"];var p;-1<c?(p=Array.prototype.slice.call(a.children),0===c?this._placeComponent(b,a,"first"):c>=p.length?this._placeComponent(b,a,"last"):this._placeComponent(b,p[c],"before")):this._placeComponent(b,a,"last")};p.prototype._placeComponent=function(a,b,c){var p=a.widget;p&&!p._started&&"function"===typeof p.postMixInProperties&&"function"===typeof p.buildRendering&&"function"===typeof p.postCreate&&"function"===typeof p.startup&&a.widget.startup();B.place(a.node,b,c)};p.prototype._applyViewPadding=
function(){var a=this.container;a&&v.set(a,this._toPxPosition(this._getViewPadding()))};p.prototype._applyUIPadding=function(){this._innerContainer&&v.set(this._innerContainer,this._toPxPosition(this.padding))};p.prototype._toPxPosition=function(a){return{top:this._toPxUnit(a.top),left:this._toPxUnit(a.left),right:this._toPxUnit(a.right),bottom:this._toPxUnit(a.bottom)}};p.prototype._toPxUnit=function(a){return 0===a?0:a+"px"};p.prototype._findByComponent=function(a){var b=null,c;this._components.some(function(p){(c=
p===a)&&(b=p);return c});return b};p.prototype._findById=function(a){var b=null,c;this._components.some(function(p){(c=p.id===a)&&(b=p);return c});return b};p.prototype._findByNode=function(a){var b=null,c;this._components.some(function(p){(c=p.node===a)&&(b=p);return c});return b};a([b.property()],p.prototype,"container",null);a([b.property({dependsOn:["view.height"]})],p.prototype,"height",null);a([b.property()],p.prototype,"padding",void 0);a([b.cast("padding")],p.prototype,"castPadding",null);
a([b.property()],p.prototype,"view",void 0);a([b.property({dependsOn:["view.width"]})],p.prototype,"width",null);return p=a([b.subclass("esri.views.ui.UI")],p)}(b.declared(t,n))})},"esri/views/ui/Component":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor dojo/dom dojo/dom-class".split(" "),function(x,r,k,a,b,c,t,n){return function(c){function f(){var a=null!==c&&c.apply(this,
arguments)||this;a.widget=null;return a}k(f,c);f.prototype.destroy=function(){this.widget&&this.widget.destroy();this.node=null};Object.defineProperty(f.prototype,"id",{get:function(){return this._get("id")||this.get("node.id")},set:function(a){this._set("id",a)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"node",{set:function(a){var b=this._get("node");a!==b&&(a&&n.add(a,"esri-component"),b&&n.remove(b,"esri-component"),this._set("node",a))},enumerable:!0,configurable:!0});
f.prototype.castNode=function(a){if(!a)return this._set("widget",null),null;if("string"===typeof a||a&&"nodeType"in a)return this._set("widget",null),t.byId(a);a&&"function"===typeof a.render&&!a.domNode&&(a.domNode=document.createElement("div"));this._set("widget",a);return a.domNode};a([b.property()],f.prototype,"id",null);a([b.property()],f.prototype,"node",null);a([b.cast("node")],f.prototype,"castNode",null);a([b.property({readOnly:!0})],f.prototype,"widget",void 0);return f=a([b.subclass("esri.views.ui.Component")],
f)}(b.declared(c))})},"esri/widgets/Attribution":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./support/widget ./Widget ./Attribution/AttributionViewModel ../core/watchUtils".split(" "),function(x,r,k,a,b,c,t,n,f){return function(q){function l(a){a=q.call(this)||this;a._isOpen=!1;a._attributionTextOverflowed=!1;a._prevSourceNodeHeight=0;a.itemDelimiter=" | ";a.view=null;a.viewModel=new n;return a}k(l,
q);l.prototype.postInitialize=function(){var a=this;this.own(f.on(this,"viewModel.items","change",function(){return a.scheduleRender()}))};Object.defineProperty(l.prototype,"attributionText",{get:function(){return this.viewModel.items.map(function(a){return a.text}).join(this.itemDelimiter)},enumerable:!0,configurable:!0});l.prototype.render=function(){var a=(b={},b["esri-attribution--open"]=this._isOpen,b);return c.tsx("div",{bind:this,class:"esri-attribution esri-widget",classes:a,onclick:this._toggleState,
onkeydown:this._toggleState},this._renderSourcesNode(),c.tsx("div",{class:"esri-attribution__powered-by"},"Powered by ",c.tsx("a",{target:"_blank",href:"http://www.esri.com/",class:"esri-attribution__link"},"Esri")));var b};l.prototype._renderSourcesNode=function(){var a=this._isOpen,b=this._isInteractive(),f=this.attributionText,a=(l={},l["esri-attribution__sources--open"]=a,l["esri-interactive"]=b,l);return c.tsx("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,
bind:this,class:"esri-attribution__sources",classes:a,innerHTML:f,role:b?"button":void 0,tabIndex:b?0:-1});var l};l.prototype._afterSourcesNodeCreate=function(a){this._prevSourceNodeHeight=a.clientWidth};l.prototype._afterSourcesNodeUpdate=function(a){var b=!1,c=a.clientHeight;a=a.scrollWidth>=a.clientWidth;var f=this._attributionTextOverflowed!==a;this._attributionTextOverflowed=a;f&&(b=!0);this._isOpen&&(a=c<this._prevSourceNodeHeight,this._prevSourceNodeHeight=c,a&&(this._isOpen=!1,b=!0));b&&this.scheduleRender()};
l.prototype._toggleState=function(){this._isInteractive()&&(this._isOpen=!this._isOpen)};l.prototype._isInteractive=function(){return this._isOpen||this._attributionTextOverflowed};a([b.property({dependsOn:["viewModel.items.length","itemDelimiter"],readOnly:!0}),c.renderable()],l.prototype,"attributionText",null);a([b.property(),c.renderable()],l.prototype,"itemDelimiter",void 0);a([b.aliasOf("viewModel.view")],l.prototype,"view",void 0);a([b.property({type:n}),c.renderable(["state","view.size"])],
l.prototype,"viewModel",void 0);a([c.accessibleHandler()],l.prototype,"_toggleState",null);return l=a([b.subclass("esri.widgets.Attribution")],l)}(b.declared(t))})},"esri/widgets/Attribution/AttributionViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../geometry/support/webMercatorUtils ../../core/HandleRegistry ../../core/Accessor ../../core/lang ../../core/watchUtils ../../core/Collection ../../geometry/Extent".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){return function(n){function v(a){a=n.call(this,a)||this;a._handles=new t;a._pendingAttributionItemsByLayerId={};a._attributionDataByLayerId={};a.items=new l;a.view=null;a._updateAttributionItems=a._updateAttributionItems.bind(a);return a}k(v,n);v.prototype.initialize=function(){this._handles.add(q.init(this,"view",this._viewWatcher))};v.prototype.destroy=function(){this._handles.destroy();this.view=this._handles=null};Object.defineProperty(v.prototype,"state",{get:function(){return this.get("view.ready")?
"ready":"disabled"},enumerable:!0,configurable:!0});v.prototype._viewWatcher=function(a){var b=this,c=this._handles;c&&c.remove();a&&(c.add([a.allLayerViews.on("change",function(a){b._addLayerViews(a.added);0<a.removed.length&&(a.removed.forEach(function(a){c.remove(a.uid)}),b._updateAttributionItems())}),q.init(a,"stationary",this._updateAttributionItems)]),this._addLayerViews(a.allLayerViews))};v.prototype._addLayerViews=function(a){var b=this;a.forEach(function(a){b._handles.has(a.uid)||b._handles.add(q.init(a,
"suspended",b._updateAttributionItems),a.uid)})};v.prototype._updateAttributionItems=function(){var a=this,b=[];this._getActiveLayerViews().forEach(function(c){var f=c.layer;if(!f.hasAttributionData){var p=f.get("copyright");p&&((c=a._findItem(b,p))?a._updateItemSource(c,f):b.push({text:p,layers:[f]}))}else if(f&&f.tileInfo){var l=a._attributionDataByLayerId;if(l[f.uid]){if(p=a._getDynamicAttribution(l[f.uid],a.view,f))(c=a._findItem(b,p))?a._updateItemSource(c,f):b.push({text:p,layers:[f]})}else{var q=
a._pendingAttributionItemsByLayerId;a._inProgress(q[f.uid])||(q[f.uid]=f.fetchAttributionData().then(function(b){b=a._createContributionIndex(b,a._isBingLayer(f));delete q[f.uid];l[f.uid]=b;a._updateAttributionItems()}))}}});this._itemsChanged(this.items,b)&&(this.items.removeAll(),this.items.addMany(b))};v.prototype._itemsChanged=function(a,b){return a.length!==b.length||a.some(function(a,c){return a.text!==b[c].text})};v.prototype._inProgress=function(a){return a&&!a.isFulfilled()};v.prototype._getActiveLayerViews=
function(){return this.get("view.allLayerViews").filter(function(a){return!a.suspended&&a.get("layer.attributionVisible")})};v.prototype._findItem=function(a,b){var c;a.some(function(a){var p=a.text===b;p&&(c=a);return p});return c};v.prototype._updateItemSource=function(a,b){-1===a.layers.indexOf(b)&&a.layers.push(b)};v.prototype._isBingLayer=function(a){return-1!==a.declaredClass.toLowerCase().indexOf("vetiledlayer")};v.prototype._createContributionIndex=function(a,b){a=a.contributors;var l={};
if(!a)return l;a.forEach(function(a,p){var q=a.coverageAreas;q&&q.forEach(function(q){var n=q.bbox,k=q.zoomMin-(b&&q.zoomMin?1:0),z=q.zoomMax-(b&&q.zoomMax?1:0);a={extent:c.geographicToWebMercator(new y({xmin:n[1],ymin:n[0],xmax:n[3],ymax:n[2]})),attribution:a.attribution||"",score:f.isDefined(q.score)?q.score:100,id:p};for(q=k;q<=z;q++)l[q]=l[q]||[],l[q].push(a)})});l.maxKey=Math.max.apply(null,Object.keys(l));return l};v.prototype._getDynamicAttribution=function(a,b,c){var l=b.extent;b=c.tileInfo.scaleToZoom(b.scale);
b=Math.min(a.maxKey,Math.round(b));if(!l||!f.isDefined(b)||-1>=b)return"";a=a[b];var p=l.center.clone().normalize(),q={};return a.filter(function(a){var b=!q[a.id]&&a.extent.contains(p);b&&(q[a.id]=!0);return b}).sort(function(a,b){return b.score-a.score||a.objectId-b.objectId}).map(function(a){return a.attribution}).join(", ")};a([b.property({readOnly:!0,type:l})],v.prototype,"items",void 0);a([b.property({dependsOn:["view.ready"],readOnly:!0})],v.prototype,"state",null);a([b.property()],v.prototype,
"view",void 0);return v=a([b.subclass("esri.widgets.Attribution.AttributionViewModel")],v)}(b.declared(n))})},"esri/widgets/Compass":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./support/widget ./Widget ./Compass/CompassViewModel dojo/i18n!./Compass/nls/Compass".split(" "),function(x,r,k,a,b,c,t,n,f){return function(q){function l(a){a=q.call(this)||this;a.activeMode=null;a.modes=null;a.view=null;a.viewModel=
new n;return a}k(l,q);l.prototype.reset=function(){};l.prototype.render=function(){var a=this.viewModel.orientation,b=this.viewModel.state,l="disabled"===b,q="compass"===("rotation"===b?"rotation":"compass"),b=(n={},n["esri-disabled"]=l,n["esri-compass--active"]="device-orientation"===this.viewModel.activeMode,n["esri-interactive"]=!l,n),n=(k={},k["esri-icon-compass"]=q,k["esri-icon-dial"]=!q,k);return c.tsx("div",{bind:this,class:"esri-compass esri-widget-button esri-widget",classes:b,onclick:this._start,
onkeydown:this._start,role:"button",tabIndex:l?-1:0,"aria-label":f.reset,title:f.reset},c.tsx("span",{"aria-hidden":"true",class:"esri-compass__icon",classes:n,styles:this._toRotationTransform(a)}),c.tsx("span",{class:"esri-icon-font-fallback-text"},f.reset));var n,k};l.prototype._start=function(){var a=this.viewModel;a.nextMode();a.startMode()};l.prototype._toRotationTransform=function(a){return{transform:"rotateZ("+a.z+"deg)"}};a([b.aliasOf("viewModel.activeMode")],l.prototype,"activeMode",void 0);
a([b.aliasOf("viewModel.modes")],l.prototype,"modes",void 0);a([b.aliasOf("viewModel.view")],l.prototype,"view",void 0);a([b.property({type:n}),c.renderable(["viewModel.orientation","viewModel.state"])],l.prototype,"viewModel",void 0);a([b.aliasOf("viewModel.reset")],l.prototype,"reset",null);a([c.accessibleHandler()],l.prototype,"_start",null);return l=a([b.subclass("esri.widgets.Compass")],l)}(b.declared(t))})},"esri/widgets/Compass/CompassViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor ../../core/HandleRegistry ../../core/Logger ../../core/promiseUtils ../../core/watchUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){var l=n.getLogger("esri.widgets.CompassViewModel");return function(c){function n(a){a=c.call(this,a)||this;a._handles=new t;a.canUseHeading=!1;a.orientation={x:0,y:0,z:0};a.view=null;a._updateForCamera=a._updateForCamera.bind(a);a._updateForRotation=a._updateForRotation.bind(a);a._updateRotationWatcher=a._updateRotationWatcher.bind(a);a._updateViewHeading=a._updateViewHeading.bind(a);a._checkHeadingSupport=a._checkHeadingSupport.bind(a);a._canUseHeading();return a}k(n,
c);n.prototype.initialize=function(){this._handles.add(q.init(this,"view",this._updateRotationWatcher))};n.prototype.destroy=function(){this._removeCheckHeadingListener();this._removeOrientationListener();this._handles.destroy();this.view=this._handles=null};Object.defineProperty(n.prototype,"activeMode",{get:function(){var a=this._get("activeMode");return a?a:(a=this.modes)?a[0]:"none"},set:function(a){this.stopMode();this._set("activeMode",a);void 0===a&&this._clearOverride("activeMode")},enumerable:!0,
configurable:!0});Object.defineProperty(n.prototype,"canShowNorth",{get:function(){var a=this.get("view.spatialReference");return a&&(a.isWebMercator||a.isWGS84)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"modes",{get:function(){return this._get("modes")||["reset"]},set:function(a){this._set("modes",a);void 0===a&&this._clearOverride("modes")},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"state",{get:function(){return this.get("view.ready")?this.canShowNorth?
"compass":"rotation":"disabled"},enumerable:!0,configurable:!0});n.prototype.previousMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a-1))};n.prototype.nextMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a+1))};n.prototype.startMode=function(){var a=this.activeMode;"reset"===a&&this.reset();"device-orientation"===a&&(this._removeOrientationListener(),this._addOrientationListener())};n.prototype.stopMode=function(){"device-orientation"===
this.activeMode&&this._removeOrientationListener()};n.prototype.reset=function(){if(this.get("view.ready")){var a={};"2d"===this.view.type?a.rotation=0:a.heading=0;this.view.goTo(a)}};n.prototype._supportsDeviceOrientation=function(){return"DeviceOrientationEvent"in window};n.prototype._paginateMode=function(a){var b=this.modes;this.activeMode=b[(a+b.length)%b.length]};n.prototype._getHeading=function(a){return a.webkitCompassHeading};n.prototype._removeCheckHeadingListener=function(){this._supportsDeviceOrientation()&&
window.removeEventListener("deviceorientation",this._checkHeadingSupport)};n.prototype._checkHeadingSupport=function(a){"number"===typeof this._getHeading(a)&&this._set("canUseHeading",!0);this._removeCheckHeadingListener()};n.prototype._canUseHeading=function(){var a=this;this._supportsDeviceOrientation()&&(window.addEventListener("deviceorientation",this._checkHeadingSupport),f.after(500).then(function(){a._removeCheckHeadingListener()}))};n.prototype._updateViewHeading=function(a){var b=this.view;
a=this._getHeading(a);"number"!==typeof a||0>a||360<a||!b||("3d"===b.type&&b.goTo({heading:a}),"2d"===b.type&&(b.rotation=a))};n.prototype._removeOrientationListener=function(){this.canUseHeading&&window.removeEventListener("deviceorientation",this._updateViewHeading)};n.prototype._addOrientationListener=function(){var a=this.canShowNorth;this.canUseHeading?a?window.addEventListener("deviceorientation",this._updateViewHeading):l.warn("device-orientation mode requires 'canShowNorth' to be true"):l.warn("The deviceorientation event is not supported in this browser")};
n.prototype._updateForRotation=function(a){void 0!==a&&null!==a&&(this.orientation={z:a})};n.prototype._updateForCamera=function(a){a&&(this.orientation={x:0,y:0,z:-a.heading})};n.prototype._updateRotationWatcher=function(a){this._handles.removeAll();a&&("2d"===a.type?this._handles.add(q.init(this,"view.rotation",this._updateForRotation)):this._handles.add(q.init(this,"view.camera",this._updateForCamera)))};a([b.property({dependsOn:["modes"]})],n.prototype,"activeMode",null);a([b.property({dependsOn:["view.spatialReference.isWebMercator",
"view.spatialReference.wkid"],readOnly:!0})],n.prototype,"canShowNorth",null);a([b.property({readOnly:!0})],n.prototype,"canUseHeading",void 0);a([b.property({dependsOn:["canUseHeading"]})],n.prototype,"modes",null);a([b.property()],n.prototype,"orientation",void 0);a([b.property({dependsOn:["view.ready","canShowNorth"],readOnly:!0})],n.prototype,"state",null);a([b.property()],n.prototype,"view",void 0);a([b.property()],n.prototype,"previousMode",null);a([b.property()],n.prototype,"nextMode",null);
a([b.property()],n.prototype,"startMode",null);a([b.property()],n.prototype,"stopMode",null);a([b.property()],n.prototype,"reset",null);return n=a([b.subclass("esri.widgets.CompassViewModel")],n)}(b.declared(c))})},"esri/widgets/Zoom":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./support/widget ./Widget ./Zoom/IconButton ./Zoom/ZoomViewModel dojo/i18n!./Zoom/nls/Zoom".split(" "),function(x,r,k,a,b,c,
t,n,f,q){return function(l){function t(a){a=l.call(this)||this;a.view=null;a.viewModel=new f;return a}k(t,l);t.prototype.postInitialize=function(){this._zoomInButton=new n({action:this.zoomIn,iconClass:"esri-icon-plus",title:q.zoomIn});this._zoomOutButton=new n({action:this.zoomOut,iconClass:"esri-icon-minus",title:q.zoomOut})};Object.defineProperty(t.prototype,"layout",{set:function(a){"horizontal"!==a&&(a="vertical");this._set("layout",a)},enumerable:!0,configurable:!0});t.prototype.render=function(){var a=
this.viewModel,b=(f={},f["esri-zoom--horizontal"]="horizontal"===this.layout,f);this._zoomInButton.enabled="ready"===a.state&&a.canZoomIn;this._zoomOutButton.enabled="ready"===a.state&&a.canZoomOut;return c.tsx("div",{class:"esri-zoom esri-widget",classes:b},this._zoomInButton.render(),this._zoomOutButton.render());var f};t.prototype.zoomIn=function(){};t.prototype.zoomOut=function(){};a([b.property({value:"vertical"}),c.renderable()],t.prototype,"layout",null);a([b.aliasOf("viewModel.view"),c.renderable()],
t.prototype,"view",void 0);a([b.property({type:f}),c.renderable(["viewModel.canZoomIn","viewModel.canZoomOut","viewModel.state"])],t.prototype,"viewModel",void 0);a([b.aliasOf("viewModel.zoomIn")],t.prototype,"zoomIn",null);a([b.aliasOf("viewModel.zoomOut")],t.prototype,"zoomOut",null);return t=a([b.subclass("esri.widgets.Zoom")],t)}(b.declared(t))})},"esri/widgets/Zoom/IconButton":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../support/widget ../Widget".split(" "),
function(x,r,k,a,b,c,t){return function(n){function f(){var a=null!==n&&n.apply(this,arguments)||this;a.enabled=!0;a.iconClass="";a.title="";return a}k(f,n);f.prototype.render=function(){var a=this.enabled?0:-1,b=(f={},f["esri-disabled"]=!this.enabled,f["esri-interactive"]=this.enabled,f),f=(n={},n[this.iconClass]=!!this.iconClass,n);return c.tsx("div",{bind:this,class:"esri-widget-button esri-widget",classes:b,onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:a,title:this.title},
c.tsx("span",{"aria-hidden":"true",role:"presentation",class:"esri-icon",classes:f}),c.tsx("span",{class:"esri-icon-font-fallback-text"},this.title));var f,n};f.prototype._triggerAction=function(){this.action.call(this)};a([b.property()],f.prototype,"action",void 0);a([b.property(),c.renderable()],f.prototype,"enabled",void 0);a([b.property(),c.renderable()],f.prototype,"iconClass",void 0);a([b.property(),c.renderable()],f.prototype,"title",void 0);a([c.accessibleHandler()],f.prototype,"_triggerAction",
null);return f=a([b.subclass("esri.widgets.IconButton")],f)}(b.declared(t))})},"esri/widgets/Zoom/ZoomViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ./ZoomConditions3D ./ZoomConditions2D ../../core/Accessor".split(" "),function(x,r,k,a,b,c,t,n){return function(f){function q(a){a=f.call(this,a)||this;a.canZoomIn=null;a.canZoomOut=null;a.zoomIn=a.zoomIn.bind(a);a.zoomOut=a.zoomOut.bind(a);
return a}k(q,f);q.prototype.destroy=function(){this.view=null};Object.defineProperty(q.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"view",{set:function(a){a?"2d"===a.type?this._zoomConditions=new t({view:a}):"3d"===a.type&&(this._zoomConditions=new c):this._zoomConditions=null;this._set("view",a)},enumerable:!0,configurable:!0});q.prototype.zoomIn=function(){this.canZoomIn&&this._zoomToFactor(.5)};
q.prototype.zoomOut=function(){this.canZoomOut&&this._zoomToFactor(2)};q.prototype._zoomToFactor=function(a){if("ready"===this.state){var b=this.view;"3d"===this.view.type?b.goTo({zoomFactor:1/a}):b.goTo({scale:this.get("view.scale")*a})}};a([b.property()],q.prototype,"_zoomConditions",void 0);a([b.property({aliasOf:"_zoomConditions.canZoomIn",readOnly:!0})],q.prototype,"canZoomIn",void 0);a([b.property({aliasOf:"_zoomConditions.canZoomOut",readOnly:!0})],q.prototype,"canZoomOut",void 0);a([b.property({dependsOn:["view.ready"],
readOnly:!0})],q.prototype,"state",null);a([b.property()],q.prototype,"view",null);a([b.property()],q.prototype,"zoomIn",null);a([b.property()],q.prototype,"zoomOut",null);return q=a([b.subclass("esri.widgets.Zoom.ZoomViewModel")],q)}(b.declared(n))})},"esri/widgets/Zoom/ZoomConditions3D":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor".split(" "),function(x,r,k,a,b,c){return function(c){function n(){var a=
null!==c&&c.apply(this,arguments)||this;a.canZoomIn=!0;a.canZoomOut=!0;return a}k(n,c);a([b.property({readOnly:!0})],n.prototype,"canZoomIn",void 0);a([b.property({readOnly:!0})],n.prototype,"canZoomOut",void 0);return n=a([b.subclass("esri.widgets.Zoom.ZoomConditions3D")],n)}(b.declared(c))})},"esri/widgets/Zoom/ZoomConditions2D":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor".split(" "),
function(x,r,k,a,b,c){return function(c){function n(){return null!==c&&c.apply(this,arguments)||this}k(n,c);Object.defineProperty(n.prototype,"canZoomIn",{get:function(){var a=this.get("view.scale"),b=this.get("view.constraints.effectiveMaxScale");return 0===b||a>b},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"canZoomOut",{get:function(){var a=this.get("view.scale"),b=this.get("view.constraints.effectiveMinScale");return 0===b||a<b},enumerable:!0,configurable:!0});a([b.property({dependsOn:["view.ready",
"view.scale"],readOnly:!0})],n.prototype,"canZoomIn",null);a([b.property({dependsOn:["view.ready","view.scale"],readOnly:!0})],n.prototype,"canZoomOut",null);a([b.property()],n.prototype,"view",void 0);return n=a([b.subclass("esri.widgets.Zoom.ZoomConditions2D")],n)}(b.declared(c))})},"esri/widgets/NavigationToggle":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./support/widget ./Widget ./NavigationToggle/NavigationToggleViewModel dojo/i18n!./NavigationToggle/nls/NavigationToggle".split(" "),
function(x,r,k,a,b,c,t,n,f){return function(q){function l(a){a=q.call(this)||this;a.view=null;a.viewModel=new n;return a}k(l,q);Object.defineProperty(l.prototype,"layout",{set:function(a){"horizontal"!==a&&(a="vertical");this._set("layout",a)},enumerable:!0,configurable:!0});l.prototype.toggle=function(){};l.prototype.render=function(){var a="disabled"===this.get("viewModel.state"),b="pan"===this.get("viewModel.navigationMode"),l=(q={},q["esri-disabled"]=a,q["esri-navigation-toggle--horizontal"]=
"horizontal"===this.layout,q),q=(n={},n["esri-navigation-toggle__button--active"]=b,n),b=(k={},k["esri-navigation-toggle__button--active"]=!b,k);return c.tsx("div",{bind:this,class:"esri-navigation-toggle esri-widget",classes:l,onclick:this._toggle,onkeydown:this._toggle,tabIndex:a?-1:0,"aria-label":f.toggle,title:f.toggle},c.tsx("div",{class:c.join("esri-navigation-toggle__button esri-widget-button","esri-navigation-toggle__button--pan"),classes:q},c.tsx("span",{class:"esri-icon-pan"})),c.tsx("div",
{class:c.join("esri-navigation-toggle__button esri-widget-button","esri-navigation-toggle__button--rotate"),classes:b},c.tsx("span",{class:"esri-icon-rotate"})));var q,n,k};l.prototype._toggle=function(){this.toggle()};a([b.property({value:"vertical"}),c.renderable()],l.prototype,"layout",null);a([b.aliasOf("viewModel.view"),c.renderable()],l.prototype,"view",void 0);a([b.property({type:n}),c.renderable(["viewModel.state","viewModel.navigationMode"])],l.prototype,"viewModel",void 0);a([b.aliasOf("viewModel.toggle")],
l.prototype,"toggle",null);a([c.accessibleHandler()],l.prototype,"_toggle",null);return l=a([b.subclass("esri.widgets.NavigationToggle")],l)}(b.declared(t))})},"esri/widgets/NavigationToggle/NavigationToggleViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/watchUtils ../../core/Accessor ../../core/HandleRegistry".split(" "),function(x,r,k,a,b,c,t,n){return function(f){function q(a){a=
f.call(this,a)||this;a._handles=new n;a.navigationMode="pan";a.view=null;a.toggle=a.toggle.bind(a);return a}k(q,f);q.prototype.initialize=function(){this._handles.add(c.when(this,"view.inputManager",this._setNavigationMode.bind(this)))};q.prototype.destroy=function(){this._handles.destroy();this.view=this._handles=null};Object.defineProperty(q.prototype,"state",{get:function(){return this.get("view.ready")&&"3d"===this.view.type?"ready":"disabled"},enumerable:!0,configurable:!0});q.prototype.toggle=
function(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate",this._setNavigationMode())};q.prototype._setNavigationMode=function(){this.get("view.inputManager").primaryDragAction="pan"===this.navigationMode?"pan":"rotate"};a([b.property({dependsOn:["view.ready"],readOnly:!0})],q.prototype,"state",null);a([b.property()],q.prototype,"navigationMode",void 0);a([b.property()],q.prototype,"view",void 0);a([b.property()],q.prototype,"toggle",null);return q=a([b.subclass("esri.widgets.NavigationToggleViewModel")],
q)}(b.declared(t))})},"esri/webscene/Environment":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators ./Lighting".split(" "),function(x,r,k,a,b,c,t){return function(b){function f(a){a=b.call(this,a)||this;a.lighting=new t;return a}k(f,b);q=f;f.prototype.clone=function(){return new q({lighting:t.prototype.clone.call(this.lighting)})};f.sanitizeJSON=function(a){return{lighting:a.lighting?t.sanitizeJSON(a.lighting):
(new t).toJSON()}};a([c.property({type:t,json:{write:!0}})],f.prototype,"lighting",void 0);return f=q=a([c.subclass("esri.webscene.Environment")],f);var q}(c.declared(b))})},"esri/webscene/Lighting":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators".split(" "),function(x,r,k,a,b,c){return function(b){function n(a){a=b.call(this,a)||this;a.date=null;a.directShadowsEnabled=!1;a.displayUTCOffset=
null;return a}k(n,b);f=n;n.prototype.readDate=function(a,b){return null!=b.datetime&&new Date(b.datetime)||null};n.prototype.writeDate=function(a,b,c){b[c]=a.getTime()};n.prototype.readDirectShadowsEnabled=function(a,b){return!!b.directShadows};n.prototype.writedirectShadowsEnabled=function(a,b,c){a&&(b[c]=a)};n.prototype.writeDisplayUTCOffset=function(a,b){null!=a&&(b.displayUTCOffset=a)};n.prototype.clone=function(){return new f({date:null!=this.date?new Date(this.date.getTime()):null,directShadowsEnabled:this.directShadowsEnabled,
displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null})};n.sanitizeJSON=function(a){var b={datetime:a.datetime};void 0!==a.directShadows&&(b.directShadows=!!a.directShadows);void 0!==a.displayUTCOffset&&(b.displayUTCOffset=a.displayUTCOffset);return b};a([c.property({type:Date,json:{type:Number,write:{target:"datetime"}}})],n.prototype,"date",void 0);a([c.reader("date",["datetime"])],n.prototype,"readDate",null);a([c.writer("date")],n.prototype,"writeDate",null);a([c.property({type:Boolean,
json:{write:{target:"directShadows"}}})],n.prototype,"directShadowsEnabled",void 0);a([c.reader("directShadowsEnabled",["directShadows"])],n.prototype,"readDirectShadowsEnabled",null);a([c.writer("directShadowsEnabled")],n.prototype,"writedirectShadowsEnabled",null);a([c.property({type:Number,json:{write:!0}})],n.prototype,"displayUTCOffset",void 0);a([c.writer("displayUTCOffset")],n.prototype,"writeDisplayUTCOffset",null);return n=f=a([c.subclass("esri.webscene.Lighting")],n);var f}(c.declared(b))})},
"esri/views/support/screenshotUtils":function(){define(["require","exports","dojo/_base/lang"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.adjustScreenshotSettings=function(a,b){a=k.mixin({format:"png",quality:100},a||{});var c,t;a.includePadding?(c=b.width,t=b.height):(c=b.width-b.padding.left-b.padding.right,t=b.height-b.padding.top-b.padding.bottom);var n=c/t;void 0!==a.width&&void 0===a.height?a.height=a.width/n:void 0!==a.height&&void 0===a.width&&(a.width=n*a.height);
void 0!==a.height&&(a.height=Math.floor(a.height));void 0!==a.width&&(a.width=Math.floor(a.width));a.area||a.includePadding||(a.area={x:b.padding.left,y:b.padding.top,width:c,height:t});return a};r.resampleHermite=function(a,b,c,k,n,f,q){void 0===q&&(q=!0);var l=b/n;c/=f;for(var t=Math.ceil(l/2),B=Math.ceil(c/2),v=0;v<f;v++)for(var w=0;w<n;w++){for(var D=4*(w+(q?f-v-1:v)*n),F=0,G=0,p=0,z=0,A=0,J=0,I=0,r=(v+.5)*c,L=Math.floor(v*c);L<(v+1)*c;L++)for(var O=Math.abs(r-(L+.5))/B,P=(w+.5)*l,O=O*O,U=Math.floor(w*
l);U<(w+1)*l;U++){var N=Math.abs(P-(U+.5))/t,F=Math.sqrt(O+N*N);-1<=F&&1>=F&&(F=2*F*F*F-3*F*F+1,0<F&&(N=4*(U+L*b),I+=F*a[N+3],p+=F,255>a[N+3]&&(F=F*a[N+3]/250),z+=F*a[N],A+=F*a[N+1],J+=F*a[N+2],G+=F))}k[D]=z/G;k[D+1]=A/G;k[D+2]=J/G;k[D+3]=I/p}}})},"esri/views/support/WebGLRequirements":function(){define(["require","exports","../../core/Error","../../core/sniff"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.check=function(){var b=null;a("esri-webgl")?a("esri-webgl-major-performance-caveat")?
b=new k("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check if your GPU is blacklisted."):a("esri-webgl-high-precision-fragment")?a("esri-webgl-vertex-shader-samplers")?a("esri-webgl-element-index-uint")||(b=new k("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.")):b=new k("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):
b=new k("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):b=new k("webgl:required","WebGL is required but not supported.");return b}})},"esri/views/3d/state/ViewState":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../views/ViewAnimation ../support/PropertiesPool ../support/Evented ../support/earthUtils ./Constraints ../webgl-engine/lib/Camera ../lib/glMatrix ./controllers/CameraController ./controllers/AnimationController".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function p(a){a=c.call(this,a)||this;a.propertiesPool=new n.default({camera:y},a);a.events=new f.Evented;a.updateQueue=new G;a.processingUpdates=!1;return a}k(p,c);p.prototype.destroy=function(){this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)};p.prototype.normalizeCtorArgs=function(a){return{camera:this.createInitialCamera(a.viewingMode),mode:a.viewingMode,spatialReference:a.spatialReference,
constraints:new l.default({mode:a.viewingMode})}};Object.defineProperty(p.prototype,"animation",{get:function(){return this.cameraController instanceof w.AnimationController?this.cameraController.viewAnimation:null},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"camera",{get:function(){return this._get("camera")},set:function(a){a!==D&&D.copyFrom(a);D.markViewDirty();D.computeUp(this.mode);F.camera=D;this.events.emit("before-camera-change",F);(a=this._get("camera"))&&a.equivalent(D)||
this._set("camera",this.propertiesPool.get("camera").copyFrom(D))},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"isGlobal",{get:function(){return!this.isLocal},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"isLocal",{get:function(){return"local"===this.mode},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"interacting",{get:function(){return!!this.cameraController&&this.cameraController.isInteractive},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,
"cameraController",{get:function(){return this._get("cameraController")},set:function(a){var b=this;this.stopActiveCameraController()?(a&&(a.watch("state",function(c){if(c===v.State.Finished||c===v.State.Stopped)b.updateCamera(function(b){a.onControllerEnd(b)}),b._set("cameraController",null)},!0),a.onControllerStart(this.camera)),this._set("cameraController",a)):a&&(a.state=v.State.Rejected)},enumerable:!0,configurable:!0});p.prototype.switchCameraController=function(a){this.cameraController=a;return a.state!==
v.State.Rejected};p.prototype.stopActiveCameraController=function(){return this.cameraController&&!this.cameraController.stopController()?!1:!0};p.prototype.cameraChanged=function(){this.updateCamera(function(){})};p.prototype.updateCamera=function(a){this.updateQueue.enqueue(a);this.processingUpdates||this.processUpdateQueue()};p.prototype.processUpdateQueue=function(){if(0!==this.updateQueue.length&&!this.processingUpdates){this.processingUpdates=!0;var a=this.updateQueue.dequeue();D.copyFrom(this._get("camera"));
a(D);this.camera=D;this.processingUpdates=!1;this.processUpdateQueue()}};p.prototype.createInitialCamera=function(a){return"global"===a?new y(B.vec3d.createFrom(4*q.earthRadius,0,0),B.vec3d.createFrom(q.earthRadius,0,0),B.vec3d.createFrom(0,0,1)):new y(B.vec3d.createFrom(0,0,100),B.vec3d.createFrom(0,0,0),B.vec3d.createFrom(0,1,0))};a([b.property({readOnly:!0,type:t,dependsOn:["cameraController"]})],p.prototype,"animation",null);a([b.property({type:y})],p.prototype,"camera",null);a([b.property({constructOnly:!0})],
p.prototype,"constraints",void 0);a([b.property({readOnly:!0})],p.prototype,"events",void 0);a([b.property({readOnly:!0,dependsOn:["isLocal"]})],p.prototype,"isGlobal",null);a([b.property({readOnly:!0,dependsOn:["mode"]})],p.prototype,"isLocal",null);a([b.property({constructOnly:!0})],p.prototype,"mode",void 0);a([b.property({constructOnly:!0})],p.prototype,"spatialReference",void 0);a([b.property({readOnly:!0,dependsOn:["cameraController"]})],p.prototype,"interacting",null);a([b.property()],p.prototype,
"cameraController",null);return p=a([b.subclass()],p)}(b.declared(c));r.ViewState=x;var D=new y,F={camera:null},G=function(){function a(){this.data=[];this.length=this.ptr=0}a.prototype.enqueue=function(a){this.data.push(a);this.length++};a.prototype.dequeue=function(){if(0===this.length)return null;var a=this.data[this.ptr++];this.length--;0===this.length&&(this.ptr=this.data.length=0);return a};return a}();r.default=x})},"esri/views/3d/support/PropertiesPool":function(){define(["require","exports",
"../../../core/ObjectPool","../../../core/accessorSupport/watch"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function b(b,t){var c=this;this.owner=t;this.properties={};this.afterDispatchHandle=null;for(var f in b)t=new k(b[f],null,null,2,2),this.properties[f]={pool:t,acquired:[]};this.afterDispatchHandle=a.afterDispatch(function(){return c.release()})}b.prototype.destroy=function(){this.afterDispatchHandle&&(this.afterDispatchHandle.remove(),this.afterDispatchHandle=
null);this.owner=null};b.prototype.get=function(a){var b=this.owner._get(a);a=this.properties[a];var c=a.pool.acquire();for(a.acquired.push(c);c===b;)a.acquired.push(c),c=a.pool.acquire();return c};b.prototype.release=function(){for(var b in this.properties){for(var k=this.properties[b],n=0,f=0,q=k.acquired;f<q.length;f++){var l=q[f];a.isValueInUse(l)?k.acquired[n++]=l:k.pool.release(l)}k.acquired.length=n}};return b}();r.PropertiesPool=x;r.default=x})},"esri/views/3d/support/Evented":function(){define(["require",
"exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(){this._listeners={}}k.prototype.hasEventListener=function(a){return null!=this._listeners[a]&&0<this._listeners[a].size};k.prototype.on=function(a,b){var c=this;null==this._listeners[a]&&(this._listeners[a]=new Map);var k={};this._listeners[a].set(k,b);return{remove:function(){return c._listeners[a].delete(k)}}};k.prototype.emit=function(a,b){null!=this._listeners[a]&&this._listeners[a].forEach(function(a){return a(b)})};
return k}();r.Evented=x})},"esri/views/3d/support/earthUtils":function(){define("require exports ./mathUtils ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils".split(" "),function(x,r,k,a,b,c){function t(b,c,f,l){var q,n;b instanceof a&&c instanceof a&&(f=c.longitude,l=c.latitude,n=b.latitude,q=b.longitude);b=k.deg2rad(n);l=k.deg2rad(l);q=k.deg2rad(q);c=k.deg2rad(f);f=Math.sin((b-l)/2);q=Math.sin((q-c)/2);f=2*k.asin(Math.sqrt(f*f+Math.cos(b)*Math.cos(l)*
q*q))*r.earthRadius;return Math.round(1E4*f)/1E4}function n(a,b,c){a=c/r.earthRadius;b=k.deg2rad(b);a=Math.sin(a/2);b=Math.cos(b);b=2*k.asin(Math.sqrt(a*a/(b*b)));return k.rad2deg(b)}function f(a,b,c){return k.rad2deg(c/r.earthRadius)}function q(a,b){a/=15;b||(a=Math.round(a));return a}Object.defineProperty(r,"__esModule",{value:!0});r.wgs84Radius=6378137;r.wgs84InverseFlattening=298.257223563;r.wgs84Flattening=1/r.wgs84InverseFlattening;r.wgs84PolarRadius=r.wgs84Radius*(1-r.wgs84Flattening);r.wgs84Eccentricity=
.0818191908426215;r.earthRadius=r.wgs84Radius;r.halfEarthCircumference=Math.PI*r.earthRadius;r.earthCircumference=2*r.halfEarthCircumference;r.metersPerDegree=r.halfEarthCircumference/180;var l=new a(0,0,b.WGS84);r.getGreatCircleDistance=t;r.getGreatCircleSpanAt=function(b,c,f){var l=c.spatialReference,q=new a(c.x,b.y,l),n=new a(f.x,b.y,l);c=new a(b.x,c.y,l);b=new a(b.x,f.y,l);return{lon:t(q,n),lat:t(c,b)}};r.getLonDeltaForDistance=n;r.getLatDeltaForDistance=f;r.getLatLonDeltaForDistance=function(a,
b,c){return{lat:f(a,b,c),lon:n(a,b,c)}};r.getMaxCameraAltitude=function(a){a=k.deg2rad(a/2);return(1-Math.sin(a))*r.earthRadius/Math.sin(a)};r.getViewExtentDistance=function(a,b){b=k.deg2rad(b/2);return 2*k.acos((Math.pow(a+r.earthRadius,2)+Math.pow(r.earthRadius,2)-Math.pow((a+r.earthRadius)*Math.cos(b)-Math.sqrt(Math.pow(Math.cos(b)*(a+r.earthRadius),2)-a*a-2*a*r.earthRadius),2))/(2*(a+r.earthRadius)*r.earthRadius))*r.earthRadius};r.computeCarthesianDistance=function(a,b){function c(a){var b=k.deg2rad(a.latitude),
c=k.deg2rad(a.longitude),f=Math.cos(b);a=r.earthRadius+(a.z||0);return[Math.cos(c)*f*a,Math.sin(b)*a,-Math.sin(c)*f*a]}a=c(a);b=c(b);b=[b[0]-a[0],b[1]-a[1],b[2]-a[2]];return Math.sqrt(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])};r.longitudeToTimezone=q;r.positionToTimezone=function(a,f){a.spatialReference.wkid!==b.WGS84.wkid?c.webMercatorToGeographic(a,!1,l):(l.x=a.x,l.y=a.y);l.z=a.z;f||(f={hours:0,minutes:0,seconds:0});f.hours=q(l.x,!0);a=f.hours%1;f.hours-=a;f.minutes=60*a;a=f.minutes%1;f.minutes-=a;f.seconds=
Math.round(60*a);return f}})},"esri/views/3d/state/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/Logger ../support/earthUtils ../support/mathUtils".split(" "),function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,"__esModule",{value:!0});var q=t.getLogger("esri.views.3d.state.Constraints");x=function(c){function n(a){a=c.call(this)||this;
a.collision=new y;a.distance=Infinity;a.minimumPoiDistance=4;return a}k(n,c);Object.defineProperty(n.prototype,"altitude",{get:function(){return"local"===this.mode?null:this._get("altitude")||null},set:function(a){"local"===this.mode?q.warn("Altitude constraint is ignored in local scenes"):this._set("altitude",a)},enumerable:!0,configurable:!0});n.prototype.clampAltitude=function(a){return this.altitude?f.clamp(a,this.altitude.min,this.altitude.max):a};n.prototype.clampTilt=function(a,b){if(!this.tilt)return b;
a=this.tilt(a);return f.clamp(b,a.min,a.max)};n.prototype.clampDistance=function(a){return Math.min(a,this.distance)};n.prototype.createDefaultTilt=function(){return"local"===this.mode?this.createDefaultTiltLocal():this.createDefaultTiltGlobal()};n.prototype.createConstantMaxTilt=function(a){return function(b,c){void 0===c&&(c=l);c.min=r.TiltDefault.min;c.max=a;return c}};n.prototype.createDefaultTiltLocal=function(){var a=f.makePiecewiseLinearFunction([[4E3,r.TiltDefault.max],[1E4,f.deg2rad(88)],
[6E6,f.deg2rad(88)]]);return function(b,c){void 0===c&&(c=l);c.min=r.TiltDefault.min;c.max=a(b);return c}};n.prototype.createDefaultTiltGlobal=function(){var a=f.makePiecewiseLinearFunction([[4E3,r.TiltDefault.max],[5E4,f.deg2rad(88)],[6E6,f.deg2rad(88)],[2E7,r.TiltDefault.min]]);return function(b,c){void 0===c&&(c=l);c.min=r.TiltDefault.min;c.max=a(b);return c}};a([b.property()],n.prototype,"altitude",null);a([b.property({readOnly:!0})],n.prototype,"collision",void 0);a([b.property()],n.prototype,
"distance",void 0);a([b.property({readOnly:!0})],n.prototype,"minimumPoiDistance",void 0);a([b.property()],n.prototype,"tilt",void 0);a([b.property({constructOnly:!0})],n.prototype,"mode",void 0);return n=a([b.subclass("esri.views.3d.state.Constraints")],n)}(b.declared(c));r.Constraints=x;r.AltitudeDefault={min:-n.earthRadius,max:4*n.earthRadius};r.TiltDefault={min:f.deg2rad(.5),max:f.deg2rad(179.5)};var l={min:0,max:0},y=function(c){function f(){var a=null!==c&&c.apply(this,arguments)||this;a.enabled=
!0;a.elevationMargin=5;return a}k(f,c);a([b.property({type:Boolean})],f.prototype,"enabled",void 0);a([b.property({type:Number})],f.prototype,"elevationMargin",void 0);return f=a([b.subclass("esri.views.3d.state.Constraints.CollisionConstraint")],f)}(b.declared(c));r.default=x})},"esri/views/3d/webgl-engine/lib/Camera":function(){define(["require","exports","./Util","./gl-matrix"],function(x,r,k,a){function b(a,b){var c=b[0]-a[0],f=b[1]-a[1],p=b[2]-a[2];a=b[3]-a[3];return c*c+f*f+p*p+a*a}function c(a,
b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]}function t(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]}var n=a.vec3d,f=a.vec4d,q=a.mat4d;x=function(){function a(a,b,c){this._viewUp=n.create();this._viewForward=n.create();this._viewRight=n.create();this._viewport=f.create();this._padding=f.create();this._fov=55/180*Math.PI;this._near=0;this._far=1E3;this._viewDirty=!0;this._viewMatrix=q.create();this._projectionDirty=!0;this._projectionMatrix=q.create();this._viewInverseTransposeMatrixDirty=
!0;this._viewInverseTransposeMatrix=q.create();this._frustumPlanesDirty=!0;this._frustumPlanes=[f.create(),f.create(),f.create(),f.create(),f.create(),f.create()];this._fullViewport=null;this.aboveGround=!0;this._eye=n.create(a);this._center=n.create(b);this._up=void 0!==c?n.create(c):n.create([0,0,1]);this._padding=f.create()}Object.defineProperty(a.prototype,"eye",{get:function(){return this._eye},set:function(a){this._compareAndSetView(a,this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"center",{get:function(){return this._center},set:function(a){this._compareAndSetView(a,this._center)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"up",{get:function(){return this._up},set:function(a){this._compareAndSetView(a,this._up)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewMatrix",{get:function(){this._ensureViewClean();return this._viewMatrix},set:function(a){q.set(a,this._viewMatrix);this._viewDirty=!1;this._frustumPlanesDirty=this._viewInverseTransposeMatrixDirty=
!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewForward",{get:function(){this._ensureViewClean();return this._viewForward},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewUp",{get:function(){this._ensureViewClean();return this._viewUp},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewRight",{get:function(){this._ensureViewClean();return this._viewRight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"near",
{get:function(){return this._near},set:function(a){this._near!==a&&(this._near=a,this._frustumPlanesDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"far",{get:function(){return this._far},set:function(a){this._far!==a&&(this._far=a,this._frustumPlanesDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewport",{get:function(){return this._viewport},set:function(a){this.x=a[0];this.y=a[1];this.width=
a[2];this.height=a[3]},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"x",{get:function(){return this._viewport[0]},set:function(a){a+=this._padding[3];this._viewport[0]!==a&&(this._viewport[0]=a,this._frustumPlanesDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"y",{get:function(){return this._viewport[1]},set:function(a){a+=this._padding[2];this._viewport[1]!==a&&(this._viewport[1]=a,this._frustumPlanesDirty=this._projectionDirty=
!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._viewport[2]},set:function(a){this._viewport[2]!==a&&(this._viewport[2]=a,this._frustumPlanesDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._viewport[3]},set:function(a){this._viewport[3]!==a&&(this._viewport[3]=a,this._frustumPlanesDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"fullWidth",{get:function(){return this._viewport[2]+this._padding[1]+this._padding[3]},set:function(a){this.width=a-(this._padding[1]+this._padding[3])},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fullHeight",{get:function(){return this._viewport[3]+this._padding[0]+this._padding[2]},set:function(a){this.height=a-(this._padding[0]+this._padding[2])},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fullViewport",{get:function(){this._fullViewport||(this._fullViewport=
f.create());this._fullViewport[0]=this._viewport[0]-this._padding[3];this._fullViewport[1]=this._viewport[1]-this._padding[2];this._fullViewport[2]=this.fullWidth;this._fullViewport[3]=this.fullHeight;return this._fullViewport},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"padding",{get:function(){return this._padding},set:function(a){if(this._padding[0]!==
a[0]||this._padding[1]!==a[1]||this._padding[2]!==a[2]||this._padding[3]!==a[3])this._viewport[0]+=a[3]-this._padding[3],this._viewport[1]+=a[2]-this._padding[2],this._viewport[2]-=a[1]+a[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=a[0]+a[2]-(this._padding[0]+this._padding[2]),f.set(a,this._padding),this._frustumPlanesDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"projectionMatrix",{get:function(){if(this._projectionDirty){var a=this.width,
b=this.height,c=this.near*Math.tan(this.fovY/2),p=c*this.aspect;q.frustum(-p*(1+2*this._padding[3]/a),p*(1+2*this._padding[1]/a),-c*(1+2*this._padding[2]/b),c*(1+2*this._padding[0]/b),this.near,this.far,this._projectionMatrix);this._projectionDirty=!1}return this._projectionMatrix},set:function(a){q.set(a,this._projectionMatrix);this._projectionDirty=!1;this._frustumPlanesDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fov",{get:function(){return this._fov},set:function(a){this._fov=
a;this._frustumPlanesDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fovX",{get:function(){return k.fovd2fovx(this._fov,this.width,this.height)},set:function(a){this._fov=k.fovx2fovd(a,this.width,this.height);this._frustumPlanesDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fovY",{get:function(){return k.fovd2fovy(this._fov,this.width,this.height)},set:function(a){this._fov=k.fovy2fovd(a,this.width,
this.height);this._frustumPlanesDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"distance",{get:function(){return n.dist(this._center,this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"frustumPoints",{get:function(){return this.computeFrustumPoints()},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"frustumPlanes",{get:function(){this._frustumPlanesDirty&&(this._frustumPlanes=this._computeFrustumPlanes(this._frustumPlanes),
this._frustumPlanesDirty=!1);return this._frustumPlanes},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewInverseTransposeMatrix",{get:function(){if(this._viewInverseTransposeMatrixDirty||this._viewDirty)this._viewInverseTransposeMatrix||(this._viewInverseTransposeMatrix=q.create()),q.inverse(this.viewMatrix,this._viewInverseTransposeMatrix),q.transpose(this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1;return this._viewInverseTransposeMatrix},enumerable:!0,
configurable:!0});Object.defineProperty(a.prototype,"perPixelRatio",{get:function(){return Math.tan(this.fovX/2)/this.width},enumerable:!0,configurable:!0});a.prototype.copyFrom=function(a){n.set(a._eye,this._eye);n.set(a._center,this._center);n.set(a._up,this._up);f.set(a._viewport,this._viewport);f.set(a._padding,this._padding);this._near=a._near;this._far=a._far;this._fov=a._fov;this.aboveGround=a.aboveGround;a._viewDirty?this._viewDirty=!0:(q.set(a._viewMatrix,this._viewMatrix),n.set(a._viewRight,
this._viewRight),n.set(a._viewUp,this._viewUp),n.set(a._viewForward,this._viewForward),this._viewDirty=!1);a._projectionDirty?this._projectionDirty=!0:(q.set(a._projectionMatrix,this._projectionMatrix),this._projectionDirty=!1);a._frustumPlanesDirty?this._frustumPlanesDirty=!0:(a.copyFrustumPlanes(this._frustumPlanes),this._frustumPlanesDirty=!1);a._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(this._viewInverseTransposeMatrix?q.set(a._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix):
this._viewInverseTransposeMatrix=q.create(a._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1);a._fullViewport?this._fullViewport?f.set(a._fullViewport,this._fullViewport):this._fullViewport=f.create(a._fullViewport):this._fullViewport=null;return this};a.prototype.copyViewFrom=function(a){this.eye=a.eye;this.center=a.center;this.up=a.up};a.prototype.copy=function(){var b=new a;b.copyFrom(this);return b};a.prototype.equivalent=function(a){return c(this._eye,a._eye)&&c(this._center,
a._center)&&c(this._up,a._up)&&t(this._viewport,a._viewport)&&t(this._padding,a._padding)&&this._near===a._near&&this._far===a._far&&this._fov===a._fov};a.prototype.almostEquals=function(a,c,f){void 0===f&&(f=!1);c=n.dist(this._eye,this._center)*(c||5E-4);c*=c;f?(n.direction(a._center,a._eye,B),n.direction(this._center,this._eye,v),f=1E-10):(n.set(a._center,B),n.set(this._center,v),f=c);return n.dist2(a._eye,this._eye)<c&&n.dist2(B,v)<f&&.001>Math.abs(a._fov-this._fov)&&.5>b(a._padding,this._padding)&&
.5>b(a._viewport,this._viewport)};a.prototype.markViewDirty=function(){this._frustumPlanesDirty=this._viewDirty=!0};a.prototype.computePixelSizeAt=function(a){return this.computePixelSizeAtDist(n.dist(a,this._eye))};a.prototype.computePixelSizeAtDist=function(a){return 2*a*Math.tan(this.fovX/2)/this.width};a.prototype.computeDistanceFromRadius=function(a,b){return a/Math.tan(Math.min(this.fovX,this.fovY)/(2*(b||1)))};a.prototype.copyFrustumPlanes=function(a){if(!a){a=Array(6);for(var b=0;6>b;++b)a[b]=
f.create()}for(var c=this.frustumPlanes,b=0;6>b;b++)f.set(c[b],a[b]);return a};a.prototype.computeFrustumPoints=function(a){if(!a){a=Array(8);for(var b=0;8>b;++b)a[b]=n.create()}k.matrix2frustum(this.viewMatrix,this.projectionMatrix,a);return a};a.prototype.setGLViewport=function(a){var b=this.viewport,c=this.padding;a.setViewport(b[0]-c[3],b[1]-c[2],b[2]+c[1]+c[3],b[3]+c[0]+c[2])};a.prototype.applyProjection=function(a,b,c){void 0===c&&(c=!1);a!==l&&n.set(a,l);l[3]=1;c&&(b[2]=-l[2]);q.multiplyVec4(this.projectionMatrix,
l);n.scale(l,1/Math.abs(l[3]));a=this.fullViewport;b[0]=k.lerp(0,a[0]+a[2],.5+.5*l[0]);b[1]=k.lerp(0,a[1]+a[3],.5+.5*l[1]);c||(b[2]=.5*(l[2]+1));return b};a.prototype.projectPoint=function(a,b,c){void 0===c&&(c=!1);q.multiplyVec3(this.viewMatrix,a,l);return this.applyProjection(l,b,c)};a.prototype.unprojectPoint=function(a,b,c){void 0===c&&(c=!1);if(c)return console.error("Camera.unprojectPoint() not yet implemented for linear Z"),null;q.multiply(this.projectionMatrix,this.viewMatrix,y);if(!q.inverse(y))return null;
c=this.fullViewport;l[0]=2*(a[0]-c[0])/c[2]-1;l[1]=2*(a[1]-c[1])/c[3]-1;l[2]=2*a[2]-1;l[3]=1;q.multiplyVec4(y,l);if(0===l[3])return null;b[0]=l[0]/l[3];b[1]=l[1]/l[3];b[2]=l[2]/l[3];return b};a.prototype.computeUp=function(a){"global"===a?this.computeUpGlobal():this.computeUpLocal()};a.prototype.computeUpGlobal=function(){n.subtract(this.center,this.eye,B);var a=n.length(this.center);1>a?(n.set3(0,0,1,this.up),this.markViewDirty()):Math.abs(n.dot(B,this.center))>.9999*n.length(B)*a||(n.cross(B,this.center,
this.up),n.cross(this.up,B,this.up),n.normalize(this.up),this.markViewDirty())};a.prototype.computeUpLocal=function(){n.direction(this.center,this.eye,B);.9999>=Math.abs(B[2])&&(n.scale(B,B[2]),n.set3(-B[0],-B[1],1-B[2],this.up),n.normalize(this.up),this.markViewDirty())};a.prototype._compareAndSetView=function(a,b){c(a,b)||(n.set(a,b),this._frustumPlanesDirty=this._viewDirty=!0)};a.prototype._computeFrustumPlanes=function(a){if(!a){a=Array(6);for(var b=0;6>b;++b)a[b]=f.create()}k.matrix2frustumPlanes(this.viewMatrix,
this.projectionMatrix,a);return a};a.prototype._ensureViewClean=function(){this._viewDirty&&(q.lookAt(this._eye,this._center,this._up,this._viewMatrix),n.set3(-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10],this._viewForward),n.set3(this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9],this._viewUp),n.set3(this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8],this._viewRight),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)};return a}();var l=f.create(),y=q.create(),
B=n.create(),v=n.create();return x})},"esri/views/3d/webgl-engine/lib/Util":function(){define(["require","exports","./gl-matrix"],function(x,r,k){function a(a,b){if(!a)throw a=Error("dummy"),a.stack&&console.log(a.stack),new T(b);}function b(a,b,c){return a<b?b:a>c?c:a}function c(a){return a/180*Math.PI}function t(a){return 180*a/Math.PI}function n(a,b,c){k.mat4d.multiply(b,a,B);k.mat4d.inverse(B);for(a=0;8>a;++a)k.mat4d.multiplyVec4(B,v[a],w),k.vec3d.set3(w[0]/w[3],w[1]/w[3],w[2]/w[3],c[a])}function f(a,
b,c,p){k.vec3d.subtract(a,b,F);k.vec3d.subtract(c,b,G);k.vec3d.cross(G,F,p);k.vec3d.normalize(p);p[3]=-k.vec3d.dot(p,a)}function q(a,b,c,p){var e=6378137/Math.sqrt(1-r.ECCENTRICITY_SQUARED*Math.pow(Math.sin(a),2)),d=Math.cos(a);p[0]=(e+c)*Math.cos(b)*d;p[1]=(e*(1-r.ECCENTRICITY_SQUARED)+c)*Math.sin(a);p[2]=-(e+c)*Math.sin(b)*d}function l(a){for(var b in a)return b}function y(a,b){a[12]=b[0];a[13]=b[1];a[14]=b[2]}Object.defineProperty(r,"__esModule",{value:!0});var B=k.mat4d.create(),v=[k.vec4d.createFrom(-1,
-1,-1,1),k.vec4d.createFrom(1,-1,-1,1),k.vec4d.createFrom(1,1,-1,1),k.vec4d.createFrom(-1,1,-1,1),k.vec4d.createFrom(-1,-1,1,1),k.vec4d.createFrom(1,-1,1,1),k.vec4d.createFrom(1,1,1,1),k.vec4d.createFrom(-1,1,1,1)],w=k.vec4d.create(),D=[k.vec3d.create(),k.vec3d.create(),k.vec3d.create(),k.vec3d.create(),k.vec3d.create(),k.vec3d.create(),k.vec3d.create(),k.vec3d.create()],F=k.vec3d.create(),G=k.vec3d.create(),p=k.vec3d.create(),z=k.vec3d.create(),A=k.vec3d.create(),J=k.vec3d.create(),I=k.vec3d.create(),
K=k.vec3d.create(),L=k.vec3d.create(),O=k.vec3d.create(),P=k.vec3d.create(),U=k.vec3d.create(),N=k.vec3d.create(),R=k.vec3d.create(),S=k.vec3d.createFrom(0,0,0),T=function(){function a(a){this.message=a}a.prototype.toString=function(){return"AssertException: "+this.message};return a}();r.AssertException=T;r.EARTH_RADIUS=6378137;r.METER2FEET=3.28084;r.ECCENTRICITY_SQUARED=.0066943799901414;r.VertexAttrConstants={POSITION:"position",NORMAL:"normal",UV0:"uv0",AUXPOS1:"auxpos1",AUXPOS2:"auxpos2",COLOR:"color",
SYMBOLCOLOR:"symbolColor",SIZE:"size",REGION:"region"};r.assert=a;r.verify=function(a,b){a||(console.log("Verify failed: "+b),console.log(Error("dummy").stack))};r.createQuadVertexUvBuffer=function(a){void 0===a&&(a=Float32Array);a=new a(20);a[0]=-1;a[1]=-1;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=-1;a[7]=0;a[8]=1;a[9]=0;a[10]=-1;a[11]=1;a[12]=0;a[13]=0;a[14]=1;a[15]=1;a[16]=1;a[17]=0;a[18]=1;a[19]=1;return a};r.isPowerOfTwo=function(a){return 0===(a&a-1)};r.lerp=function(a,b,c){return a+(b-a)*c};r.clamp=
b;r.fallbackIfUndefined=function(a,b){return void 0===a?b:a};r.hex2rgb=function(a){a=Math.floor(a);return[(a>>16&255)/255,(a>>8&255)/255,(a&255)/255]};r.rgb2hex=function(a){var c=b(Math.round(255*a[0]),0,255),p=b(Math.round(255*a[1]),0,255);a=b(Math.round(255*a[2]),0,255);return"0x"+((c<<16)+(p<<8)+a).toString(16)};r.dec2hex=function(a){a=a.toString(16);return"00000000".substr(0,8-a.length)+a};r.deg2rad=c;r.rad2deg=t;r.azimuthElevationAngle2Direction=function(a,b){a=1.5*Math.PI-a;b=.5*Math.PI-b;return[Math.cos(a)*
Math.sin(b),Math.cos(b),Math.sin(a)*Math.sin(b)]};r.rayPlane=function(a,b,c,p){var e=k.vec3d.dot(c,b);if(0===e)return!1;c=-(k.vec3d.dot(c,a)+c[3])/e;k.vec3d.add(a,k.vec3d.scale(b,c,p),p);return!0};r.raySphere=function(a,b,c,p,e){c=c||S;var d=k.vec3d.subtract(a,c,F);c=k.vec3d.dot(b,b);var g=2*k.vec3d.dot(b,d);p=k.vec3d.dot(d,d)-p*p;p=g*g-4*c*p;if(0>p)return!1;d=Math.sqrt(p);p=(-g-d)/(2*c);c=(-g+d)/(2*c);if(0>p||c<p&&0<c)p=c;return 0<p?(k.vec3d.add(a,k.vec3d.scale(b,p,R),e),!0):!1};r.rayTriangle3D=
function(a,b,c,p,e,d,g,m,f){void 0===f&&(f=k.vec3d.create());var h=p[g]-c[d],l=p[g+1]-c[d+1],q=p[g+2]-c[d+2];p=e[m]-c[d];g=e[m+1]-c[d+1];e=e[m+2]-c[d+2];var n=b[1]*e-g*b[2],z=b[2]*p-e*b[0],t=b[0]*g-p*b[1];m=h*n+l*z+q*t;if(-1E-5<m&&1E-5>m)return!1;m=1/m;var v=a[0]-c[d],A=a[1]-c[d+1];a=a[2]-c[d+2];f[1]=m*(v*n+A*z+a*t);if(0>f[1]||1<f[1])return!1;c=A*q-l*a;a=a*h-q*v;h=v*l-h*A;f[2]=m*(b[0]*c+b[1]*a+b[2]*h);if(0>f[2]||1<f[1]+f[2])return!1;f[0]=m*(p*c+g*a+e*h);return!0};r.rayBoxTest=function(a,b,c,p){var e,
d=(c[0]-a[0])/b[0],g=(p[0]-a[0])/b[0];d>g&&(e=d,d=g,g=e);var h=(c[1]-a[1])/b[1],f=(p[1]-a[1])/b[1];h>f&&(e=h,h=f,f=e);if(d>f||h>g)return!1;h>d&&(d=h);f<g&&(g=f);c=(c[2]-a[2])/b[2];a=(p[2]-a[2])/b[2];c>a&&(e=c,c=a,a=e);if(d>a||c>g)return!1;a<g&&(g=a);return 0>g?!1:!0};r.rayRay2D=function(a,b,c,p,e,d){void 0===d&&(d=k.vec2d.create());var g=(p[e]-c[e])*(b[0]-a[0])-(p[0]-c[0])*(b[e]-a[e]);if(0===g)return!1;c=((p[0]-c[0])*(a[e]-c[e])-(p[e]-c[e])*(a[0]-c[0]))/g;d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[e]+c*(b[e]-
a[e]);return!0};r.matrix2frustum=n;r.matrix2frustumPlanes=function(a,b,c,p){void 0===p&&(p=c,c=D);n(a,b,c);f(c[4],c[0],c[3],p[0]);f(c[1],c[5],c[6],p[1]);f(c[4],c[5],c[1],p[2]);f(c[3],c[2],c[6],p[3]);f(c[0],c[1],c[2],p[4]);f(c[5],c[4],c[7],p[5])};r.point2plane=f;r.project=function(b,c,p,f,e){e||(e=b);w[0]=b[0];w[1]=b[1];w[2]=b[2];w[3]=1;k.mat4d.multiplyVec4(c,w);2<e.length&&(e[2]=-w[2]);k.mat4d.multiplyVec4(p,w);a(0!==w[3]);e[0]=w[0]/w[3];e[1]=w[1]/w[3];e[2]=w[2]/w[3];e[0]=(.5*e[0]+.5)*f[2]+f[0];e[1]=
(.5*e[1]+.5)*f[3]+f[1]};r.geodeticToGeocentricLatidude=function(a){return Math.atan((1-r.ECCENTRICITY_SQUARED)*Math.tan(a))};r.latLon2positionWGS84Ellipsoid=q;r.pos2latLon=function(a,c){var h=k.vec3d.length(a);c[0]=Math.asin(b(a[1]/h,-1,1));c[1]=(0>a[2]?1:-1)*Math.acos(b(a[0]/(Math.cos(c[0])*h),-1,1));c[0]=t(c[0]);c[1]=t(c[1]);c[2]=h};r.pos2latLonWGS84Ellipsoid=function(a,b){var c=a[0],h=-a[2],e=a[1],d=Math.sqrt(Math.pow(6378137,2)*(1-r.ECCENTRICITY_SQUARED));a=Math.sqrt(Math.pow(c,2)+Math.pow(h,
2));var g=Math.atan2(6378137*e,d*a),c=Math.atan2(h,c),h=Math.atan2(e+Math.pow(Math.sqrt((Math.pow(6378137,2)-Math.pow(d,2))/Math.pow(d,2)),2)*d*Math.pow(Math.sin(g),3),a-6378137*r.ECCENTRICITY_SQUARED*Math.pow(Math.cos(g),3));a=a/Math.cos(h)-6378137/Math.sqrt(1-r.ECCENTRICITY_SQUARED*Math.pow(Math.sin(h),2))+r.EARTH_RADIUS;b[0]=h;b[1]=c;b[2]=a};r.computeGlobeTransformation=function(a,b,f){var h=c(a[0]);a=c(a[1]);q(h,a,b,p);k.mat4d.translate(f,p);k.mat4d.rotateY(f,.5*Math.PI+a);k.mat4d.rotateX(f,.5*
Math.PI-h);return f};r.readUInt16=function(a,b){return a[b]+(a[b+1]<<8)};r.readUInt32=function(a,b){return a[b]+(a[b+1]<<8)+(a[b+2]<<16)+(a[b+3]<<24)};r.setIfDefined=function(a,b,c){void 0!==b[a]&&(c[a]=b[a])};r.array2object=function(a,b){var c={};if(void 0!==b)for(var h=0;h<a.length;h++){var e=a[h];c[b(e)]=e}else for(b=0;b<a.length;b++)e=a[b],c[e]=e;return c};r.object2array=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};r.mergeObjects=function(a,b,c){void 0===c&&(c={});if(c!==a)for(var h in a)c[h]=
a[h];if(c!==b)for(var e in b)c[e]=b[e];return c};r.subtractObjects=function(a,b){var c={},h;for(h in a)void 0===b[h]&&(c[h]=a[h]);return c};r.intersectObjects=function(a,b){var c={},h;for(h in a)void 0!==b[h]&&(c[h]=a[h]);return c};r.getFirstObjectKey=l;r.getFirstObjectValue=function(a){return a[l(a)]};r.objectEmpty=function(a){for(var b in a)return!1;return!0};r.arraysEqual=function(a,b){if(a.length!==b.length)return!1;for(var c=0,h=a.length;c<h;++c)if(a[c]!==b[c])return!1;return!0};r.arrayRemove=
function(a,b){var c=a.indexOf(b);return-1!==c?(a[c]=a[a.length-1],a.pop(),b):null};r.byteBuffer2base64image=function(b,c,p,f,e){var d=4*c;a(b.length===d*p,"buffer length must match image resolution");var g=document.createElement("canvas");g.width=c;g.height=p;var h=g.getContext("2d");c=h.getImageData(0,0,c,p);for(var l=c.data,q=0;q<p;++q)for(var n=q*d,k=(p-1-q)*d,z=0;z<d;++z)l[n++]=b[k++];h.putImageData(c,0,0);return g.toDataURL(f,e)};r.cround=function(a){return Math.round(100*a)/100};r.logWithBase=
function(a,b){return Math.log(a)/Math.log(b)};r.setMatrixTranslation=y;r.setMatrixTranslation3=function(a,b,c,p){a[12]=b;a[13]=c;a[14]=p};r.getMatrixTranslation=function(a,b){void 0===b&&(b=k.vec3d.create());b[0]=a[12];b[1]=a[13];b[2]=a[14];return b};r.createTranslationMatrix=function(a,b){a=k.mat4d.identity(a);y(a,b);return a};r.fovx2fovy=function(a,b,c){return 2*Math.atan(c*Math.tan(.5*a)/b)};r.fovy2fovx=function(a,b,c){return 2*Math.atan(b*Math.tan(.5*a)/c)};r.fovx2fovd=function(a,b,c){return 2*
Math.atan(Math.sqrt(b*b+c*c)*Math.tan(.5*a)/b)};r.fovy2fovd=function(a,b,c){return 2*Math.atan(Math.sqrt(b*b+c*c)*Math.tan(.5*a)/c)};r.fovd2fovx=function(a,b,c){return 2*Math.atan(b*Math.tan(.5*a)/Math.sqrt(b*b+c*c))};r.fovd2fovy=function(a,b,c){return 2*Math.atan(c*Math.tan(.5*a)/Math.sqrt(b*b+c*c))};r.nextHighestPowerOfTwo=function(a){--a;for(var b=1;32>b;b<<=1)a|=a>>b;return a+1};r.nextHighestPowerOfTen=function(a){return Math.pow(10,Math.ceil(Math.LOG10E*Math.log(a)))};r.lineSegmentLineSegmentDistance3D=
function(a,c,p,f){var e,d,g;z[0]=a[0]-p[0];z[1]=a[1]-p[1];z[2]=a[2]-p[2];A[0]=f[0]-p[0];A[1]=f[1]-p[1];A[2]=f[2]-p[2];if(1E-4>Math.abs(A[0])&&1E-4>Math.abs(A[1])&&1E-4>Math.abs(A[2]))return[!1];J[0]=c[0]-a[0];J[1]=c[1]-a[1];J[2]=c[2]-a[2];if(1E-4>Math.abs(J[0])&&1E-4>Math.abs(J[1])&&1E-4>Math.abs(J[2]))return[!1];c=z[0]*A[0]+z[1]*A[1]+z[2]*A[2];f=A[0]*J[0]+A[1]*J[1]+A[2]*J[2];e=z[0]*J[0]+z[1]*J[1]+z[2]*J[2];d=A[0]*A[0]+A[1]*A[1]+A[2]*A[2];g=(J[0]*J[0]+J[1]*J[1]+J[2]*J[2])*d-f*f;if(1E-4>Math.abs(g))return[!1];
e=b((c*f-e*d)/g,0,1);c=b((c+f*e)/d,0,1);I[0]=a[0]+e*J[0];I[1]=a[1]+e*J[1];I[2]=a[2]+e*J[2];K[0]=p[0]+c*A[0];K[1]=p[1]+c*A[1];K[2]=p[2]+c*A[2];return[!0,k.vec3d.dist(I,K),I,K]};r.pointLineSegmentDistance2D=function(a,c,p){U[0]=c[0]-a[0];U[1]=c[1]-a[1];U[2]=0;N[0]=p[0]-a[0];N[1]=p[1]-a[1];N[2]=0;R[0]=p[0];R[1]=p[1];R[2]=0;c=k.vec3d.dot(N,U);p=k.vec3d.length(U);c=b(c/(p*p),0,1);P[0]=U[0]*c;P[1]=U[1]*c;L[0]=a[0]+P[0];L[1]=a[1]+P[1];k.vec3d.subtract(R,L,O);a=k.vec3d.length(O);c=k.vec3d.length(N);p=k.vec3d.length(U);
var h=k.vec3d.length(P);if(h>c||h>p)a=Number.MAX_VALUE;return a};x=function(){var a=window.performance||{};if(a.now)return function(){return a.now()};if(a.webkitNow)return function(){return a.webkitNow()};if(a.mozNow)return function(){return a.mozNow()};if(a.msNow)return function(){return a.msNow()};if(a.oNow)return function(){return a.oNow()};var b;b=a.timing&&a.timing.navigationStart?a.timing.navigationStart:Date.now();return function(){return Date.now()-b}}();r.performance={now:x}})},"esri/views/3d/webgl-engine/lib/gl-matrix":function(){define([],
function(){var x={};(function(r,k){k(r,!0);k(r,!1)})(x,function(r,k){var a={};(function(){if("undefined"!=typeof Float32Array){var b=new Float32Array(1),c=new Int32Array(b.buffer);a.invsqrt=function(a){b[0]=a;c[0]=1597463007-(c[0]>>1);var p=b[0];return p*(1.5-.5*a*p*p)}}else a.invsqrt=function(a){return 1/Math.sqrt(a)}})();var b=Array;"undefined"!=typeof Float32Array&&(b=k?Float32Array:Array);var c={create:function(a){var c=new b(3);a?(c[0]=a[0],c[1]=a[1],c[2]=a[2]):c[0]=c[1]=c[2]=0;return c},createFrom:function(a,
c,f){var p=new b(3);p[0]=a;p[1]=c;p[2]=f;return p},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},set3:function(a,b,c,f){f[0]=a;f[1]=b;f[2]=c;return f},add:function(a,b,c){if(!c||a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c},subtract:function(a,b,c){if(!c||a===c)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c},multiply:function(a,b,c){if(!c||a===c)return a[0]*=b[0],a[1]*=b[1],a[2]*=
b[2],a;c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c},max:function(a,b,c){c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);return c},min:function(a,b,c){c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c},normalize:function(a,b){b||(b=a);var c=a[0],
p=a[1];a=a[2];var f=Math.sqrt(c*c+p*p+a*a);if(!f)return b[0]=0,b[1]=0,b[2]=0,b;if(1===f)return b[0]=c,b[1]=p,b[2]=a,b;f=1/f;b[0]=c*f;b[1]=p*f;b[2]=a*f;return b},cross:function(a,b,c){c||(c=a);var p=a[0],f=a[1];a=a[2];var l=b[0],q=b[1];b=b[2];c[0]=f*b-a*q;c[1]=a*l-p*b;c[2]=p*q-f*l;return c},length:function(a){var b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)},length2:function(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,
b,c){c||(c=a);var p=a[0]-b[0],f=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(p*p+f*f+a*a);if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/b;c[0]=p*b;c[1]=f*b;c[2]=a*b;return c},lerp:function(a,b,c,f){f||(f=a);f[0]=a[0]+c*(b[0]-a[0]);f[1]=a[1]+c*(b[1]-a[1]);f[2]=a[2]+c*(b[2]-a[2]);return f},dist:function(a,b){var c=b[0]-a[0],p=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(c*c+p*p+a*a)},dist2:function(a,b){var c=b[0]-a[0],p=b[1]-a[1];a=b[2]-a[2];return c*c+p*p+a*a}},t=null,n=new b(4);c.unproject=function(a,b,c,f,l){l||(l=a);
t||(t=w.create());var p=t;n[0]=2*(a[0]-f[0])/f[2]-1;n[1]=2*(a[1]-f[1])/f[3]-1;n[2]=2*a[2]-1;n[3]=1;w.multiply(c,b,p);if(!w.inverse(p))return null;w.multiplyVec4(p,n);if(0===n[3])return null;l[0]=n[0]/n[3];l[1]=n[1]/n[3];l[2]=n[2]/n[3];return l};var f=c.createFrom(1,0,0),q=c.createFrom(0,1,0),l=c.createFrom(0,0,1);c.rotationTo=function(a,b,n){n||(n=D.create());var p=c.dot(a,b),k=c.create();if(1<=p)D.set(F,n);else if(-.999999>p)c.cross(f,a,k),1E-6>k.length&&c.cross(q,a,k),1E-6>k.length&&c.cross(l,a,
k),c.normalize(k),D.fromAxisAngle(k,Math.PI,n);else{var p=Math.sqrt(2*(1+p)),t=1/p;c.cross(a,b,k);n[0]=k[0]*t;n[1]=k[1]*t;n[2]=k[2]*t;n[3]=.5*p;D.normalize(n)}1<n[3]?n[3]=1:-1>n[3]&&(n[3]=-1);return n};var y=c.create(),B=c.create();c.project=function(a,b,f,l){l||(l=a);c.direction(b,f,y);c.subtract(a,b,B);a=c.dot(y,B);c.scale(y,a,l);c.add(l,b,l)};c.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var v={create:function(a){var c=new b(9);a?(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=
a[5],c[6]=a[6],c[7]=a[7],c[8]=a[8]):c[0]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=0;return c},createFrom:function(a,c,f,l,q,n,k,t,v){var p=new b(9);p[0]=a;p[1]=c;p[2]=f;p[3]=l;p[4]=q;p[5]=n;p[6]=k;p[7]=t;p[8]=v;return p},determinant:function(a){var b=a[3],c=a[4],p=a[5],f=a[6],l=a[7],q=a[8];return a[0]*(q*c-p*l)+a[1]*(-q*b+p*f)+a[2]*(l*b-c*f)},inverse:function(a,b){var c=a[0],p=a[1],f=a[2],l=a[3],q=a[4],n=a[5],k=a[6],t=a[7];a=a[8];var z=a*q-n*t,w=-a*l+n*k,y=t*l-q*k,D=c*z+p*w+f*y;if(!D)return null;D=
1/D;b||(b=v.create());b[0]=z*D;b[1]=(-a*p+f*t)*D;b[2]=(n*p-f*q)*D;b[3]=w*D;b[4]=(a*c-f*k)*D;b[5]=(-n*c+f*l)*D;b[6]=y*D;b[7]=(-t*c+p*k)*D;b[8]=(q*c-p*l)*D;return b},multiply:function(a,b,c){c||(c=a);var p=a[0],f=a[1],l=a[2],q=a[3],n=a[4],k=a[5],t=a[6],z=a[7];a=a[8];var v=b[0],A=b[1],w=b[2],y=b[3],h=b[4],D=b[5],B=b[6],e=b[7];b=b[8];c[0]=v*p+A*q+w*t;c[1]=v*f+A*n+w*z;c[2]=v*l+A*k+w*a;c[3]=y*p+h*q+D*t;c[4]=y*f+h*n+D*z;c[5]=y*l+h*k+D*a;c[6]=B*p+e*q+b*t;c[7]=B*f+e*n+b*z;c[8]=B*l+e*k+b*a;return c},multiplyVec2:function(a,
b,c){c||(c=b);var p=b[0];b=b[1];c[0]=p*a[0]+b*a[3]+a[6];c[1]=p*a[1]+b*a[4]+a[7];return c},multiplyVec3:function(a,b,c){c||(c=b);var p=b[0],f=b[1];b=b[2];c[0]=p*a[0]+f*a[3]+b*a[6];c[1]=p*a[1]+f*a[4]+b*a[7];c[2]=p*a[2]+f*a[5]+b*a[8];return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},identity:function(a){a||(a=v.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,b){if(!b||
a===b){b=a[1];var c=a[2],p=a[5];a[1]=a[3];a[2]=a[6];a[3]=b;a[5]=a[7];a[6]=c;a[7]=p;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=w.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+"]"}},
w={create:function(a){var c=new b(16);4===arguments.length?(c[0]=arguments[0],c[1]=arguments[1],c[2]=arguments[2],c[3]=arguments[3],c[4]=arguments[4],c[5]=arguments[5],c[6]=arguments[6],c[7]=arguments[7],c[8]=arguments[8],c[9]=arguments[9],c[10]=arguments[10],c[11]=arguments[11],c[12]=arguments[12],c[13]=arguments[13],c[14]=arguments[14],c[15]=arguments[15]):a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],
c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},createFrom:function(a,c,f,l,q,n,k,t,v,w,y,D,B,F,G,h){var p=new b(16);p[0]=a;p[1]=c;p[2]=f;p[3]=l;p[4]=q;p[5]=n;p[6]=k;p[7]=t;p[8]=v;p[9]=w;p[10]=y;p[11]=D;p[12]=B;p[13]=F;p[14]=G;p[15]=h;return p},createFromMatrixRowMajor:function(a){var c=new b(16);c[0]=a[0];c[4]=a[1];c[8]=a[2];c[12]=a[3];c[1]=a[4];c[5]=a[5];c[9]=a[6];c[13]=a[7];c[2]=a[8];c[6]=a[9];c[10]=a[10];c[14]=a[11];c[3]=a[12];c[7]=a[13];c[11]=a[14];c[15]=a[15];return c},createFromMatrix:function(a){var c=
new b(16);c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];c[9]=a[9];c[10]=a[10];c[11]=a[11];c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},setRowMajor:function(a,b){b[0]=a[0];b[4]=a[1];b[8]=a[2];b[12]=a[3];b[1]=a[4];b[5]=a[5];b[9]=a[6];b[13]=a[7];b[2]=
a[8];b[6]=a[9];b[10]=a[10];b[14]=a[11];b[3]=a[12];b[7]=a[13];b[11]=a[14];b[15]=a[15];return b},identity:function(a){a||(a=w.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){b=a[1];var c=a[2],p=a[3],f=a[6],l=a[7],q=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=b;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=f;a[11]=a[14];a[12]=p;a[13]=l;a[14]=q;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12];
b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],c=a[1],p=a[2],f=a[3],l=a[4],q=a[5],n=a[6],k=a[7],t=a[8],v=a[9],w=a[10],y=a[11],D=a[12],B=a[13],h=a[14];a=a[15];return D*v*n*f-t*B*n*f-D*q*w*f+l*B*w*f+t*q*h*f-l*v*h*f-D*v*p*k+t*B*p*k+D*c*w*k-b*B*w*k-t*c*h*k+b*v*h*k+D*q*p*y-l*B*p*y-D*c*n*y+b*B*n*y+l*c*h*y-b*q*h*y-t*q*p*a+l*v*p*a+t*c*n*a-b*v*n*a-l*c*w*a+b*q*w*a},inverse:function(a,
b){b||(b=a);var c=a[0],p=a[1],f=a[2],l=a[3],q=a[4],n=a[5],k=a[6],t=a[7],v=a[8],z=a[9],w=a[10],y=a[11],D=a[12],h=a[13],B=a[14];a=a[15];var F=c*n-p*q,e=c*k-f*q,d=c*t-l*q,g=p*k-f*n,m=p*t-l*n,u=f*t-l*k,G=v*h-z*D,r=v*B-w*D,x=v*a-y*D,W=z*B-w*h,da=z*a-y*h,fa=w*a-y*B,aa=F*fa-e*da+d*W+g*x-m*r+u*G;if(!aa)return null;aa=1/aa;b[0]=(n*fa-k*da+t*W)*aa;b[1]=(-p*fa+f*da-l*W)*aa;b[2]=(h*u-B*m+a*g)*aa;b[3]=(-z*u+w*m-y*g)*aa;b[4]=(-q*fa+k*x-t*r)*aa;b[5]=(c*fa-f*x+l*r)*aa;b[6]=(-D*u+B*d-a*e)*aa;b[7]=(v*u-w*d+y*e)*aa;
b[8]=(q*da-n*x+t*G)*aa;b[9]=(-c*da+p*x-l*G)*aa;b[10]=(D*m-h*d+a*F)*aa;b[11]=(-v*m+z*d-y*F)*aa;b[12]=(-q*W+n*r-k*G)*aa;b[13]=(c*W-p*r+f*G)*aa;b[14]=(-D*g+h*e-B*F)*aa;b[15]=(v*g-z*e+w*F)*aa;return b},toRotationMat:function(a,b){b||(b=w.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=v.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=
a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10];return b},toInverseMat3:function(a,b){var c=a[0],p=a[1],f=a[2],l=a[4],q=a[5],n=a[6],k=a[8],t=a[9];a=a[10];var z=a*q-n*t,w=-a*l+n*k,y=t*l-q*k,D=c*z+p*w+f*y;if(!D)return null;D=1/D;b||(b=v.create());b[0]=z*D;b[1]=(-a*p+f*t)*D;b[2]=(n*p-f*q)*D;b[3]=w*D;b[4]=(a*c-f*k)*D;b[5]=(-n*c+f*l)*D;b[6]=y*D;b[7]=(-t*c+p*k)*D;b[8]=(q*c-p*l)*D;return b},multiply:function(a,b,c){c||(c=a);var p=a[0],f=a[1],l=a[2],q=a[3],n=a[4],k=a[5],t=a[6],v=a[7],z=a[8],A=a[9],w=a[10],y=a[11],h=
a[12],D=a[13],B=a[14];a=a[15];var e=b[0],d=b[1],g=b[2],m=b[3],F=b[4],G=b[5],r=b[6],x=b[7],W=b[8],da=b[9],fa=b[10],aa=b[11],ea=b[12],ja=b[13],ga=b[14];b=b[15];c[0]=e*p+d*n+g*z+m*h;c[1]=e*f+d*k+g*A+m*D;c[2]=e*l+d*t+g*w+m*B;c[3]=e*q+d*v+g*y+m*a;c[4]=F*p+G*n+r*z+x*h;c[5]=F*f+G*k+r*A+x*D;c[6]=F*l+G*t+r*w+x*B;c[7]=F*q+G*v+r*y+x*a;c[8]=W*p+da*n+fa*z+aa*h;c[9]=W*f+da*k+fa*A+aa*D;c[10]=W*l+da*t+fa*w+aa*B;c[11]=W*q+da*v+fa*y+aa*a;c[12]=ea*p+ja*n+ga*z+b*h;c[13]=ea*f+ja*k+ga*A+b*D;c[14]=ea*l+ja*t+ga*w+b*B;c[15]=
ea*q+ja*v+ga*y+b*a;return c},multiplyVec3:function(a,b,c){c||(c=b);var f=b[0],p=b[1];b=b[2];c[0]=a[0]*f+a[4]*p+a[8]*b+a[12];c[1]=a[1]*f+a[5]*p+a[9]*b+a[13];c[2]=a[2]*f+a[6]*p+a[10]*b+a[14];return c},multiplyVec4:function(a,b,c){c||(c=b);var f=b[0],p=b[1],l=b[2];b=b[3];c[0]=a[0]*f+a[4]*p+a[8]*l+a[12]*b;c[1]=a[1]*f+a[5]*p+a[9]*l+a[13]*b;c[2]=a[2]*f+a[6]*p+a[10]*l+a[14]*b;c[3]=a[3]*f+a[7]*p+a[11]*l+a[15]*b;return c},translate:function(a,b,c){var f=b[0],p=b[1];b=b[2];var l,q,n,k,t,v,z,w,A,y,h,D;if(!c||
a===c)return a[12]=a[0]*f+a[4]*p+a[8]*b+a[12],a[13]=a[1]*f+a[5]*p+a[9]*b+a[13],a[14]=a[2]*f+a[6]*p+a[10]*b+a[14],a[15]=a[3]*f+a[7]*p+a[11]*b+a[15],a;l=a[0];q=a[1];n=a[2];k=a[3];t=a[4];v=a[5];z=a[6];w=a[7];A=a[8];y=a[9];h=a[10];D=a[11];c[0]=l;c[1]=q;c[2]=n;c[3]=k;c[4]=t;c[5]=v;c[6]=z;c[7]=w;c[8]=A;c[9]=y;c[10]=h;c[11]=D;c[12]=l*f+t*p+A*b+a[12];c[13]=q*f+v*p+y*b+a[13];c[14]=n*f+z*p+h*b+a[14];c[15]=k*f+w*p+D*b+a[15];return c},scale:function(a,b,c){var f=b[0],p=b[1];b=b[2];if(!c||a===c)return a[0]*=f,
a[1]*=f,a[2]*=f,a[3]*=f,a[4]*=p,a[5]*=p,a[6]*=p,a[7]*=p,a[8]*=b,a[9]*=b,a[10]*=b,a[11]*=b,a;c[0]=a[0]*f;c[1]=a[1]*f;c[2]=a[2]*f;c[3]=a[3]*f;c[4]=a[4]*p;c[5]=a[5]*p;c[6]=a[6]*p;c[7]=a[7]*p;c[8]=a[8]*b;c[9]=a[9]*b;c[10]=a[10]*b;c[11]=a[11]*b;c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c},maxScale:function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))},rotate:function(a,b,c,f){var p=
c[0],l=c[1];c=c[2];var q=Math.sqrt(p*p+l*l+c*c),n,k,t,v,z,w,y,A,h,D,B,e,d,g,m,F,J,G,r,W;if(!q)return null;1!==q&&(q=1/q,p*=q,l*=q,c*=q);n=Math.sin(b);k=Math.cos(b);t=1-k;b=a[0];q=a[1];v=a[2];z=a[3];w=a[4];y=a[5];A=a[6];h=a[7];D=a[8];B=a[9];e=a[10];d=a[11];g=p*p*t+k;m=l*p*t+c*n;F=c*p*t-l*n;J=p*l*t-c*n;G=l*l*t+k;r=c*l*t+p*n;W=p*c*t+l*n;p=l*c*t-p*n;l=c*c*t+k;f?a!==f&&(f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]):f=a;f[0]=b*g+w*m+D*F;f[1]=q*g+y*m+B*F;f[2]=v*g+A*m+e*F;f[3]=z*g+h*m+d*F;f[4]=b*J+w*G+
D*r;f[5]=q*J+y*G+B*r;f[6]=v*J+A*G+e*r;f[7]=z*J+h*G+d*r;f[8]=b*W+w*p+D*l;f[9]=q*W+y*p+B*l;f[10]=v*W+A*p+e*l;f[11]=z*W+h*p+d*l;return f},rotateX:function(a,b,c){var f=Math.sin(b);b=Math.cos(b);var p=a[4],l=a[5],q=a[6],n=a[7],k=a[8],t=a[9],v=a[10],z=a[11];c?a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[4]=p*b+k*f;c[5]=l*b+t*f;c[6]=q*b+v*f;c[7]=n*b+z*f;c[8]=p*-f+k*b;c[9]=l*-f+t*b;c[10]=q*-f+v*b;c[11]=n*-f+z*b;return c},rotateY:function(a,b,c){var f=
Math.sin(b);b=Math.cos(b);var p=a[0],l=a[1],q=a[2],n=a[3],k=a[8],t=a[9],v=a[10],z=a[11];c?a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=p*b+k*-f;c[1]=l*b+t*-f;c[2]=q*b+v*-f;c[3]=n*b+z*-f;c[8]=p*f+k*b;c[9]=l*f+t*b;c[10]=q*f+v*b;c[11]=n*f+z*b;return c},rotateZ:function(a,b,c){var f=Math.sin(b);b=Math.cos(b);var p=a[0],l=a[1],q=a[2],n=a[3],k=a[4],t=a[5],v=a[6],z=a[7];c?a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],
c[14]=a[14],c[15]=a[15]):c=a;c[0]=p*b+k*f;c[1]=l*b+t*f;c[2]=q*b+v*f;c[3]=n*b+z*f;c[4]=p*-f+k*b;c[5]=l*-f+t*b;c[6]=q*-f+v*b;c[7]=n*-f+z*b;return c},frustum:function(a,b,c,f,l,q,n){n||(n=w.create());var p=b-a,k=f-c,t=q-l;n[0]=2*l/p;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2*l/k;n[6]=0;n[7]=0;n[8]=(b+a)/p;n[9]=(f+c)/k;n[10]=-(q+l)/t;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(q*l*2)/t;n[15]=0;return n},perspective:function(a,b,c,f,l){a=c*Math.tan(a*Math.PI/360);b*=a;return w.frustum(-b,b,-a,a,c,f,l)},ortho:function(a,
b,c,f,l,q,n){n||(n=w.create());var p=b-a,k=f-c,t=q-l;n[0]=2/p;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/k;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/t;n[11]=0;n[12]=-(a+b)/p;n[13]=-(f+c)/k;n[14]=-(q+l)/t;n[15]=1;return n},lookAt:function(a,b,c,f){f||(f=w.create());var p,l,q,n,k,t,v,z,y=a[0],A=a[1];a=a[2];q=c[0];n=c[1];l=c[2];v=b[0];c=b[1];p=b[2];if(y===v&&A===c&&a===p)return w.identity(f);b=y-v;c=A-c;v=a-p;z=1/Math.sqrt(b*b+c*c+v*v);b*=z;c*=z;v*=z;p=n*v-l*c;l=l*b-q*v;q=q*c-n*b;(z=Math.sqrt(p*p+l*l+q*q))?(z=1/
z,p*=z,l*=z,q*=z):q=l=p=0;n=c*q-v*l;k=v*p-b*q;t=b*l-c*p;(z=Math.sqrt(n*n+k*k+t*t))?(z=1/z,n*=z,k*=z,t*=z):t=k=n=0;f[0]=p;f[1]=n;f[2]=b;f[3]=0;f[4]=l;f[5]=k;f[6]=c;f[7]=0;f[8]=q;f[9]=t;f[10]=v;f[11]=0;f[12]=-(p*y+l*A+q*a);f[13]=-(n*y+k*A+t*a);f[14]=-(b*y+c*A+v*a);f[15]=1;return f},fromRotationTranslation:function(a,b,c){c||(c=w.create());var f=a[0],p=a[1],l=a[2],q=a[3],n=f+f,k=p+p,t=l+l;a=f*n;var v=f*k,f=f*t,z=p*k,p=p*t,l=l*t,n=q*n,k=q*k,q=q*t;c[0]=1-(z+l);c[1]=v+q;c[2]=f-k;c[3]=0;c[4]=v-q;c[5]=1-
(a+l);c[6]=p+n;c[7]=0;c[8]=f+k;c[9]=p-n;c[10]=1-(a+z);c[11]=0;c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},D={create:function(a){var c=new b(4);a?(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]):c[0]=c[1]=c[2]=c[3]=0;return c},createFrom:function(a,c,f,l){var p=new b(4);p[0]=a;p[1]=c;p[2]=f;p[3]=l;return p},
set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},identity:function(a){a||(a=D.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},F=D.identity();D.calculateW=function(a,b){var c=a[0],f=a[1],p=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-c*c-f*f-p*p)),a;b[0]=c;b[1]=f;b[2]=p;b[3]=-Math.sqrt(Math.abs(1-c*c-f*f-p*p));return b};D.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};D.inverse=function(a,b){var c=a[0],f=a[1],p=a[2],l=a[3],c=(c=c*c+f*f+p*p+l*l)?1/c:0;if(!b||
a===b)return a[0]*=-c,a[1]*=-c,a[2]*=-c,a[3]*=c,a;b[0]=-a[0]*c;b[1]=-a[1]*c;b[2]=-a[2]*c;b[3]=a[3]*c;return b};D.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};D.length=function(a){var b=a[0],c=a[1],f=a[2];a=a[3];return Math.sqrt(b*b+c*c+f*f+a*a)};D.normalize=function(a,b){b||(b=a);var c=a[0],f=a[1],p=a[2];a=a[3];var l=Math.sqrt(c*c+f*f+p*p+a*a);if(0===l)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;l=1/l;b[0]=c*l;b[1]=f*l;b[2]=
p*l;b[3]=a*l;return b};D.add=function(a,b,c){if(!c||a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+=b[3],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c};D.multiply=function(a,b,c){c||(c=a);var f=a[0],p=a[1],l=a[2];a=a[3];var q=b[0],n=b[1],k=b[2];b=b[3];c[0]=f*b+a*q+p*k-l*n;c[1]=p*b+a*n+l*q-f*k;c[2]=l*b+a*k+f*n-p*q;c[3]=a*b-f*q-p*n-l*k;return c};D.multiplyVec3=function(a,b,c){c||(c=b);var f=b[0],p=b[1],l=b[2];b=a[0];var q=a[1],n=a[2];a=a[3];var k=a*f+q*l-n*p,t=a*p+n*f-b*
l,v=a*l+b*p-q*f,f=-b*f-q*p-n*l;c[0]=k*a+f*-b+t*-n-v*-q;c[1]=t*a+f*-q+v*-b-k*-n;c[2]=v*a+f*-n+k*-q-t*-b;return c};D.scale=function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};D.toMat3=function(a,b){b||(b=v.create());var c=a[0],f=a[1],p=a[2],l=a[3],q=c+c,n=f+f,k=p+p;a=c*q;var t=c*n,c=c*k,w=f*n,f=f*k,p=p*k,q=l*q,n=l*n,l=l*k;b[0]=1-(w+p);b[1]=t+l;b[2]=c-n;b[3]=t-l;b[4]=1-(a+p);b[5]=f+q;b[6]=c+n;b[7]=f-q;b[8]=1-(a+w);return b};
D.toMat4=function(a,b){b||(b=w.create());var c=a[0],f=a[1],p=a[2],l=a[3],q=c+c,n=f+f,k=p+p;a=c*q;var t=c*n,c=c*k,v=f*n,f=f*k,p=p*k,q=l*q,n=l*n,l=l*k;b[0]=1-(v+p);b[1]=t+l;b[2]=c-n;b[3]=0;b[4]=t-l;b[5]=1-(a+p);b[6]=f+q;b[7]=0;b[8]=c+n;b[9]=f-q;b[10]=1-(a+v);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};D.slerp=function(a,b,c,f){f||(f=a);var p=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],l,q;if(1<=Math.abs(p))return f!==a&&(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3]),f;l=Math.acos(p);q=Math.sqrt(1-p*p);
if(.001>Math.abs(q))return f[0]=.5*a[0]+.5*b[0],f[1]=.5*a[1]+.5*b[1],f[2]=.5*a[2]+.5*b[2],f[3]=.5*a[3]+.5*b[3],f;p=Math.sin((1-c)*l)/q;c=Math.sin(c*l)/q;f[0]=a[0]*p+b[0]*c;f[1]=a[1]*p+b[1]*c;f[2]=a[2]*p+b[2]*c;f[3]=a[3]*p+b[3]*c;return f};D.fromRotationMatrix=function(a,b){b||(b=D.create());var c=a[0]+a[4]+a[8],f;if(0<c)f=Math.sqrt(c+1),b[3]=.5*f,f=.5/f,b[0]=(a[7]-a[5])*f,b[1]=(a[2]-a[6])*f,b[2]=(a[3]-a[1])*f;else{f=D.fromRotationMatrix.s_iNext=D.fromRotationMatrix.s_iNext||[1,2,0];c=0;a[4]>a[0]&&
(c=1);a[8]>a[3*c+c]&&(c=2);var p=f[c],l=f[p];f=Math.sqrt(a[3*c+c]-a[3*p+p]-a[3*l+l]+1);b[c]=.5*f;f=.5/f;b[3]=(a[3*l+p]-a[3*p+l])*f;b[p]=(a[3*p+c]+a[3*c+p])*f;b[l]=(a[3*l+c]+a[3*c+l])*f}return b};v.toQuat4=D.fromRotationMatrix;(function(){var a=v.create();D.fromAxes=function(b,c,f,p){a[0]=c[0];a[3]=c[1];a[6]=c[2];a[1]=f[0];a[4]=f[1];a[7]=f[2];a[2]=b[0];a[5]=b[1];a[8]=b[2];return D.fromRotationMatrix(a,p)}})();D.identity=function(a){a||(a=D.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};D.fromAngleAxis=
function(a,b,c){c||(c=D.create());a*=.5;var f=Math.sin(a);c[3]=Math.cos(a);c[0]=f*b[0];c[1]=f*b[1];c[2]=f*b[2];return c};D.toAngleAxis=function(b,c){c||(c=b);var f=b[0]*b[0]+b[1]*b[1]+b[2]*b[2];0<f?(c[3]=2*Math.acos(b[3]),f=a.invsqrt(f),c[0]=b[0]*f,c[1]=b[1]*f,c[2]=b[2]*f):(c[3]=0,c[0]=1,c[1]=0,c[2]=0);return c};D.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var G={create:function(a){var c=new b(4);a?(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]):c[0]=c[1]=c[2]=c[3]=0;return c},createFrom:function(a,
c,f,l){var p=new b(4);p[0]=a;p[1]=c;p[2]=f;p[3]=l;return p},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},identity:function(a){a||(a=G.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b)return b=a[1],a[1]=a[2],a[2]=b,a;b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],f=a[1],p=a[2];a=a[3];var l=c*a-p*f;if(!l)return null;l=1/l;b[0]=a*l;b[1]=-f*l;b[2]=
-p*l;b[3]=c*l;return b},multiply:function(a,b,c){c||(c=a);var f=a[0],p=a[1],l=a[2];a=a[3];c[0]=f*b[0]+p*b[2];c[1]=f*b[1]+p*b[3];c[2]=l*b[0]+a*b[2];c[3]=l*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var f=a[0],p=a[1],l=a[2];a=a[3];var q=Math.sin(b);b=Math.cos(b);c[0]=f*b+p*q;c[1]=f*-q+p*b;c[2]=l*b+a*q;c[3]=l*-q+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var f=b[0];b=b[1];c[0]=f*a[0]+b*a[1];c[1]=f*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var f=a[1],p=a[2],l=a[3],q=b[0];
b=b[1];c[0]=a[0]*q;c[1]=f*b;c[2]=p*q;c[3]=l*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};k=k?"":"d";r["glMath"+k]=a;r["vec2"+k]={create:function(a){var c=new b(2);a?(c[0]=a[0],c[1]=a[1]):(c[0]=0,c[1]=0);return c},createFrom:function(a,c){var f=new b(2);f[0]=a;f[1]=c;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];
c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0];a=b[1]-a[1];return Math.sqrt(c*c+a*a)},dist2:function(a,b){var c=b[0]-a[0];a=b[1]-a[1];return c*c+a*a},set:function(a,b){b[0]=a[0];b[1]=a[1];return b},set2:function(a,b,c){c[0]=a;c[1]=b;return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+
a[1]*a[1];0<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var f=a[0]-b[0];a=a[1]-b[1];b=f*f+a*a;if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=f*b;c[1]=a*b;return c},lerp:function(a,b,c,f){f||(f=a);f[0]=a[0]+c*(b[0]-a[0]);f[1]=a[1]+c*(b[1]-
a[1]);return f},str:function(a){return"["+a[0]+", "+a[1]+"]"}};r["vec3"+k]=c;r["vec4"+k]={create:function(a){var c=new b(4);a?(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]):(c[0]=0,c[1]=0,c[2]=0,c[3]=0);return c},createFrom:function(a,c,f,l){var p=new b(4);p[0]=a;p[1]=c;p[2]=f;p[3]=l;return p},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a,
b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},set4:function(a,b,c,f,l){l[0]=a;l[1]=b;l[2]=c;l[3]=f;return l},negate:function(a,b){b||(b=a);
b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},lerp:function(a,b,c,f){f||(f=a);f[0]=a[0]+c*(b[0]-a[0]);f[1]=a[1]+c*(b[1]-a[1]);f[2]=a[2]+c*(b[2]-a[2]);f[3]=a[3]+c*(b[3]-a[3]);return f},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};r["mat2"+k]=G;r["mat3"+k]=v;r["mat4"+k]=w;r["quat4"+k]=D});return x})},"esri/views/3d/state/controllers/CameraController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/accessorSupport/decorators ../../../../core/Accessor".split(" "),
function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});var t;(function(a){a.Ready="ready";a.Rejected="rejected";a.Running="running";a.Stopped="stopped";a.Finished="finished"})(t=r.State||(r.State={}));x=function(c){function f(){var a=null!==c&&c.apply(this,arguments)||this;a.state=t.Ready;return a}k(f,c);Object.defineProperty(f.prototype,"active",{get:function(){return this.state===t.Running},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"isInteractive",{get:function(){return!1},
enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"canStop",{get:function(){return!1},enumerable:!0,configurable:!0});f.prototype.stopController=function(){return this.canStop?(this.state=t.Stopped,!0):!1};f.prototype.finishController=function(){this.state=t.Finished};f.prototype.onControllerStart=function(a){this.state=t.Running};f.prototype.onControllerEnd=function(a){};f.prototype.stepController=function(a,b){};Object.defineProperty(f.prototype,"steppingFinished",{get:function(){return!1},
enumerable:!0,configurable:!0});a([b.property({readOnly:!0,dependsOn:["state"]})],f.prototype,"active",null);a([b.property()],f.prototype,"state",void 0);return f=a([b.subclass()],f)}(b.declared(c));r.CameraController=x})},"esri/views/3d/state/controllers/AnimationController":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../ViewAnimation","./CameraController"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function t(b){void 0===
b&&(b=new a);var f=c.call(this)||this;f.viewAnimation=b;return f}k(t,c);Object.defineProperty(t.prototype,"canStop",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"asyncResult",{get:function(){return this._asyncResult},set:function(a){this._asyncResult&&this._asyncResult.reject();this._asyncResult=a;if(this.state===b.State.Finished||this.state===b.State.Stopped)this._asyncResult=null,this.state===b.State.Finished?a.resolve():a.reject()},enumerable:!0,configurable:!0});
t.prototype.onControllerStart=function(a){var f=this;c.prototype.onControllerStart.call(this,a);this.viewAnimation&&this.viewAnimation.when(function(){f.state!==b.State.Ready&&f.state!==b.State.Running||f.finish()},function(){if(f.state===b.State.Ready||f.state===b.State.Running)f.state=b.State.Stopped})};t.prototype.onControllerEnd=function(a){this.viewAnimation&&(this.viewAnimation.done||(this.state===b.State.Finished?this.viewAnimation.finish():this.state===b.State.Stopped&&this.viewAnimation.stop()));
this._asyncResult&&(this.state===b.State.Finished?this._asyncResult.resolve():this._asyncResult.reject());c.prototype.onControllerEnd.call(this,a)};t.prototype.finish=function(){this.finishController()};return t}(b.CameraController);r.AnimationController=x})},"esri/views/3d/state/ViewStateManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators dojo/_base/lang ../../../Camera ../../../Viewpoint ../../../core/Accessor ../../../core/Logger ../../../core/HandleRegistry ../../../core/watchUtils ../../../core/Error ../../../core/promiseUtils ../../../geometry/Point ../../../geometry/Extent ../../../geometry/ScreenPoint ../../../geometry/support/webMercatorUtils ../../animation/easing ./controllers/PointToPointAnimationController ../support/PropertiesPool ../support/cameraUtils ../support/viewpointUtils ../camera/intersectionUtils ../camera/constraintUtils ./Frustum ./ConstraintsManager ./controllers/SurfaceCollisionCorrectionController ../lib/glMatrix ../webgl-engine/lib/Camera ./helpers/PickingHelper".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S){Object.defineProperty(r,"__esModule",{value:!0});var T=q.getLogger("esri.views.3d.state.ViewStateManager");x=function(f){function m(a){a=f.call(this)||this;a.propertiesPool=new A.default({frustum:O.default},a);a.handles=new l;a.cameraSetByUser=!1;a.internalSetOrder=[];a.immediateGoToPromise=null;a.animatedGoToPromise=null;a.ready=!1;return a}k(m,f);Object.defineProperty(m.prototype,"camera",{get:function(){return this.ready?J.internalToExternal(this.view,
this.view.state.camera):this._get("camera")},set:function(a){this.updatePropertyBeforeReady("camera",a)||this.setStateCamera(J.externalToInternal(this.view,a),{applyConstraints:!1})||T.error("#camera\x3d","Invalid camera",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"center",{get:function(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")},set:function(a){this.updatePropertyBeforeReady("center",a)||(a?this.isCompatible(a)?this.setStateCamera(this.centerToCamera(a),
{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.forceUpdate():T.error("#center\x3d","Invalid center",a):T.error("#center\x3d","Center has an incompatible spatial reference (center: "+(a.spatialReference?a.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",a):T.error("#center\x3d","Center may not be null or undefined"))},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"extent",{get:function(){return this.ready?J.toExtent(this.view,null,
null,null,Q):this._get("extent")},set:function(a){this.updatePropertyBeforeReady("extent",a)||(a?this.isCompatible(a)?this.setStateCamera(this.extentToCamera(a),{applyConstraints:!0})||T.error("#extent\x3d","Invalid extent",a):T.error("#extent\x3d","Extent has an incompatible spatial reference (extent: "+(a.spatialReference?a.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",a):T.error("#extent\x3d","Extent may not be null or undefined"))},enumerable:!0,configurable:!0});
Object.defineProperty(m.prototype,"frustum",{get:function(){var a=this.propertiesPool.get("frustum");a.update(this.view.state.camera);return a},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"hasInitialView",{get:function(){return!!this.view.get("map.initialViewProperties.viewpoint")},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"scale",{get:function(){if(!this.ready)return this._get("scale");var a=this.view.pointsOfInterest.centerOnContent;return J.distanceToScale(this.view,
a.distance,a.location.latitude)},set:function(a){this.updatePropertyBeforeReady("scale",a)||this.setStateCamera(this.scaleToCamera(a),{applyConstraints:!0})||T.error("#scale\x3d","Invalid scale",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"padding",{get:function(){if(!this.ready)return this._get("padding");var a=this.view.state.camera.padding;return{top:a[0],right:a[1],bottom:a[2],left:a[3]}},set:function(a){this.updatePropertyBeforeReady("padding",a)||(a?N.vec4d.set4(a.top||
0,a.right||0,a.bottom||0,a.left||0,d):N.vec4d.set4(0,0,0,0,d),this.view.state.updateCamera(function(a){a.padding=d}))},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"screenCenter",{get:function(){var a=this.padding;return new F((this.view.width-(a.left+a.right))/2+a.left,(this.view.height-(a.top+a.bottom))/2+a.top)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"viewpoint",{get:function(){return this.ready?I.fromCamera(this.view,this.camera):this._get("viewpoint")},
set:function(a){if(!this.updatePropertyBeforeReady("viewpoint",a))if(a)if(this.isCompatible(a))this.setStateCamera(this.viewpointToCamera(a),{applyConstraints:!a.camera})||T.error("#viewpoint\x3d","Invalid viewpoint",a);else{var d=a.camera?a.camera.position:a.targetGeometry,d=d&&d.spatialReference;T.error("#viewpoint\x3d","Viewpoint has an incompatible spatial reference (viewpoint: "+(d?d.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",a)}else T.error("#viewpoint\x3d","Viewpoint may not be null or undefined")},
enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"zoom",{get:function(){return this.ready?J.scaleToZoom(this.view,this.scale):this._get("zoom")},set:function(a){this.updatePropertyBeforeReady("zoom",a)||this.setStateCamera(this.zoomToCamera(a),{applyConstraints:!0})||T.error("#zoom\x3d","Invalid zoom",a)},enumerable:!0,configurable:!0});m.prototype.initialize=function(){var a=this;this.pickingHelper=new S.PickingHelper(this.view);this.handles.add(this.view.watch("state.camera",function(d){return a.cameraChangedSync(d)},
!0),y.on(this.view,"state.events","before-camera-change",function(d){return a.beforeCameraChangeHandle(d.camera)}));this.handles.add(this.view.on("resize",function(d){return a.handleResize(d.width,d.height)}));this.handles.add(this.view.watch("state.cameraController",function(){a.cameraSetByUser=!0;a.handles.remove(g);a.cancelImmediateGoTo()}));this.handles.add(y.on(this.view,"pointsOfInterest.events","camera-parameters-changed",function(){return a.notifyChange("scale")}))};m.prototype.destroy=function(){this.handles&&
(this.handles.destroy(),this.handles=null);this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)};m.prototype.init=function(){var a=this;this.constraintsManager=new P.default({view:this.view});this.handleResize(this.view.width,this.view.height);var d=this.getInitialProperties();this.cameraSetByUser=!1;this._set("ready",!0);for(var e=0;e<d.length;e++){var b=d[e];this.set(b.name,b.value)}this.cameraSetByUser||((d=this.view.get("map.initialViewProperties.viewpoint")||this.view.initialExtent)&&
this.isCompatible(d)?this.setInitialView(d):"local"===this.view.state.mode&&this.handles.add(y.whenOnce(this.view.basemapTerrain,"ready",function(){a.handles.remove(g);a.setInitialView(a.view.groundExtent)}),g))};m.prototype.deinit=function(){this.ready&&(this._override("padding",this.padding),this.cancelImmediateGoTo(),this.cancelAnimatedGoTo(),this._set("ready",!1),this._clearOverride("hasInitialView"),this.internalSetOrder.length=0,this.cameraSetByUser=!1,this.handles.remove(g),this.constraintsManager&&
(this.constraintsManager.destroy(),this.constraintsManager=null))};m.prototype.goTo=function(a,d){d=c.mixin({animate:!0},d);return d.animate?this.goToAnimated(a,d):this.goToImmediate(a,d)};m.prototype.debugSetCameraOnContent=function(){this.setStateCamera(K.cameraOnContentAlongViewDirection(this.view),{applyConstraints:!1})};m.prototype.step=function(a){var d=this.view.state,e=d&&this.view.state.cameraController;e&&(d.updateCamera(function(d){e.stepController(a,d)}),e.steppingFinished&&e.finishController())};
m.prototype.cancelImmediateGoTo=function(){var a=this.immediateGoToPromise;a&&(this.immediateGoToPromise=null,a.cancel())};m.prototype.cancelAnimatedGoTo=function(){var a=this.animatedGoToPromise;a&&(this.animatedGoToPromise=null,a.cancel())};m.prototype.getInitialProperties=function(){for(var a=this,d=new Set,e=[],b=0,c=h;b<c.length;b++){var g=c[b],m=g.propertyName,g=g.overrides,f=d.has(m),p=this._isOverridden(m);!f&&p&&e.push({name:m,value:this._get(m)});this._clearOverride(m);(f||p)&&g.forEach(function(a){return d.add(a)})}return e.sort(function(d,
e){d=a.internalSetOrder.indexOf(d.name);e=a.internalSetOrder.indexOf(e.name);return d<e?-1:d>e?1:0})};m.prototype.setInitialView=function(a){if(a&&!this.cameraSetByUser){var d={applyConstraints:!0};a instanceof t?d.applyConstraints=!1:a instanceof n?a.targetGeometry instanceof D?a=J.fromExtent(this.view,a.targetGeometry,0,.5,{noReset:!0}):(a.camera&&(d.applyConstraints=!1),a=I.toCamera(this.view,a)):a=J.fromExtent(this.view,a,0,.5,{noReset:!0});this.setStateCamera(J.externalToInternal(this.view,a),
d)}};m.prototype.updatePropertyBeforeReady=function(a,d){if(this.ready)return!1;this._override(a,d);var e=this.internalSetOrder.indexOf(a);-1!==e&&(this.internalSetOrder=this.internalSetOrder.splice(e,1));d&&(this.internalSetOrder.push(a),-1!==V.indexOf(a)&&this._override("hasInitialView",!0));return!0};m.prototype.isCompatible=function(a){return a?a instanceof n?a.camera?this.isCompatible(a.camera):this.isCompatible(a.targetGeometry):a instanceof t?this.isCompatible(a.position):a.spatialReference&&
G.canProject(a.spatialReference,this.view.spatialReference):!1};m.prototype.getPreservingHeadingTilt=function(a){void 0===a&&(a=ca);this.cameraSetByUser?(a.heading=this.camera.heading,a.tilt=this.camera.tilt):(a.heading=0,a.tilt=.5);return a};m.prototype.centerPointAtDistanceToCamera=function(a,d,b){void 0===b&&(b=e);var c=this.getPreservingHeadingTilt();return(a=J.eyeHeadingTiltForCenterPointAtDistance(this.view,c.heading,c.tilt,a,d))?(b.copyFrom(this.view.state.camera),b.eye=a.eye,b.center=a.center,
b.up=a.up,b):null};m.prototype.centerToCamera=function(a){var d=this.view.pointsOfInterest.centerOnContent;d.forceUpdate();return this.centerPointAtDistanceToCamera(a,d.distance)};m.prototype.extentToCamera=function(a){var d=this.getPreservingHeadingTilt();if(a=J.fromExtent(this.view,a,d.heading,d.tilt,Q))return J.externalToInternal(this.view,a)};m.prototype.scaleToCamera=function(a){var d=this.view.pointsOfInterest.centerOnContent;d.forceUpdate();var e=d.renderLocation;a=J.scaleToDistance(this.view,
a,d.location.latitude);return this.centerPointAtDistanceToCamera(e,a)};m.prototype.zoomToCamera=function(a){return this.scaleToCamera(J.zoomToScale(this.view,a))};m.prototype.viewpointToCamera=function(a){return(a=I.toCamera(this.view,a))?J.externalToInternal(this.view,a):null};m.prototype.setStateCamera=function(a,d){var e=this;if(!a||!this.view.state.stopActiveCameraController())return!1;this.cameraSetByUser=!0;this.cancelImmediateGoTo();this.view.state.updateCamera(function(b){b.copyFrom(a);d.applyConstraints&&
L.applyAll(e.view,b)});d.applyConstraints||(this.view.state.cameraController=new U.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:a}));return!0};m.prototype.handleResize=function(a,d){var b=this.view.canvas;!b||b.width===a&&b.height===d||(b.width=a,b.height=d);this.view.state&&(b=this.view.state.camera,b.fullWidth!==a||b.fullHeight!==d)&&(e.copyFrom(b),e.fullWidth=a,e.fullHeight=d,this.view.state.camera=e)};m.prototype.beforeCameraChangeHandle=function(a){this.updateCameraAboveGround(a)};
m.prototype.cameraChangedSync=function(a){a&&this.view._stage&&this.view._stage.setCamera(a)};m.prototype.updateCameraAboveGround=function(a){var d=this.view.basemapTerrain,e=this.view.renderCoordsHelper.getAltitude(a.eye),d=d&&d.spatialReference?K.surfaceElevationBelowEye(this.view,a):0;a.aboveGround=e>=d};m.prototype.createGoToCamera=function(a){var d=this;return y.whenOnce(this,"ready",null,!0).then(function(){return I.create(d.view,a)}).then(function(e){var b=!!(a instanceof n&&a.camera||a instanceof
t),c=e.camera;if(!d.isCompatible(c))throw e=(e=c.position)&&e.spatialReference,new B("goto:incompatible-spatialreference","Resulting camera has an incompatible spatial reference (camera: "+(e?e.wkid:"none")+", view: "+d.view.spatialReference.wkid+")",{camera:c});c=J.externalToInternal(d.view,c);if(!c)throw new B("goto:invalid-camera","Resulting camera is invalid");return{viewpoint:e,camera:c,isFullySpecified:b}})};m.prototype.cancellableGoTo=function(a){var d=this,e;return v.create(function(d,b){e=
{resolve:d,reject:b};a.asyncResult=e},function(){d.view.state.cameraController===a&&a.active&&a.asyncResult===e&&a.stopController()})};m.prototype.goToImmediate=function(a,d){var e=this;this.cancelAnimatedGoTo();this.cancelImmediateGoTo();var b=this.createGoToCamera(a).then(function(a){e.immediateGoToPromise===b&&(e.immediateGoToPromise=null);e.setStateCamera(a.camera,{applyConstraints:!a.isFullySpecified})}).catch(function(a){e.immediateGoToPromise===b&&(e.immediateGoToPromise=null);a instanceof
B&&a.message&&T.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));throw a;});return this.immediateGoToPromise=b};m.prototype.goToAnimatedBeforeReady=function(a,d){var e=this;this.cancelAnimatedGoTo();var b=y.whenOnce(this.view,"ready").then(function(){if(b===e.animatedGoToPromise)return e.animatedGoToPromise=null,e.goToAnimated(a,d);throw new B("view:goto-cancelled","Cancelled");});return this.animatedGoToPromise=b};m.prototype.goToAnimated=function(a,
d){var e=this;this.cancelAnimatedGoTo();if(!this.ready)return this.goToAnimatedBeforeReady(a,d);var b=this.view.state.cameraController,c;c=b instanceof z.PointToPointAnimationController&&b.active?b:new z.PointToPointAnimationController(this.view.state,this.pickingHelper);this.cancelAnimatedGoTo();var g=c.viewAnimation;a=this.createGoToCamera(a);var h=a.then(function(a){return a.viewpoint});g.update(h);if(c!==b&&!this.view.state.switchCameraController(c))return g.stop(),T.error("#goTo()","Cannot start an animation while interacting"),
v.reject(new B("view:goto-cannot-interrupt","Cannot start an animation while interacting"));var m=g.target,f=function(){return e.view.state.cameraController===c&&c.viewAnimation.target===m&&c.active};a.then(function(a){var b=a.viewpoint,h=a.camera;a=a.isFullySpecified;if(f()){c.viewAnimation.update(b);m=c.viewAnimation.target;var p;a?(p=new U.SurfaceCollisionCorrectionController({view:e.view,desiredCamera:h}),L.applySurfaceCollision(e.view,h,1)):L.applyAll(e.view,h);c.begin(h,e.internalAnimateOptions(d));
return g.when().then(function(){p&&c.viewAnimation.target===m&&(e.view.state.cameraController=p)})}}).otherwise(function(a){a instanceof B&&a.message&&T.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));if(f())throw e.view.state.cameraController.stopController(),a;});return this.cancellableGoTo(c)};m.prototype.internalAnimateOptions=function(a){var d={};a&&(null!=a.speedFactor&&(d.speedFactor=a.speedFactor),null!=a.duration&&(d.duration=a.duration/
1E3),null!=a.maxDuration&&(d.maxDuration=a.maxDuration/1E3),null!=a.easing&&(d.easing="string"===typeof a.easing?p.named[a.easing]:a.easing));return d};a([b.property({type:t,dependsOn:["view.state.camera","ready"]})],m.prototype,"camera",null);a([b.property({type:w,dependsOn:["view.pointsOfInterest.centerOnContent.location","ready"]})],m.prototype,"center",null);a([b.property({type:D,dependsOn:["view.state.camera","ready"]})],m.prototype,"extent",null);a([b.property({readOnly:!0,dependsOn:["view.state.camera",
"ready"]})],m.prototype,"frustum",null);a([b.property({readOnly:!0,dependsOn:["view.map.initialViewProperties.viewpoint"]})],m.prototype,"hasInitialView",null);a([b.property({readOnly:!0,type:Boolean})],m.prototype,"ready",void 0);a([b.property({dependsOn:["view.pointsOfInterest.centerOnContent.distance","ready"],type:Number})],m.prototype,"scale",null);a([b.property({dependsOn:["view.state.camera","ready"]})],m.prototype,"padding",null);a([b.property({readOnly:!0,dependsOn:["view.width","view.height",
"padding"]})],m.prototype,"screenCenter",null);a([b.property({constructOnly:!0})],m.prototype,"view",void 0);a([b.property({type:n,dependsOn:["camera","ready"]})],m.prototype,"viewpoint",null);a([b.property({type:Number,dependsOn:["scale"]})],m.prototype,"zoom",null);return m=a([b.subclass("esri.views.3d.state.ViewStateManager")],m)}(b.declared(f));r.ViewStateManager=x;var V="camera viewpoint extent scale center zoom".split(" "),h=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",
overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"center",overrides:[]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],ca={heading:0,tilt:0},Q=new t,e=new R,d=N.vec4d.create(),g="pending-initial-view";r.default=x})},"esri/views/animation/easing":function(){define(["require","exports"],function(x,r){function k(a){return a}function a(a){var b=2*(a-Math.sqrt((a-1)*a)),c=b/2/a;return function(f){return f<
c?a*f*f:b*f-b+1}}function b(a,b){return function(c){return c<b?b*a(c/b):1-a((1-c)/(1-b))*(1-b)}}Object.defineProperty(r,"__esModule",{value:!0});r.linear=k;r.inQuad=function(a){return a*a};r.outQuad=function(a){return 1-r.inQuad(1-a)};r.inOutQuad=function(a){return.5>a?r.inQuad(2*a)/2:(r.outQuad(2*(a-.5))+1)/2};r.inCubic=function(a){return a*a*a};r.outCubic=function(a){return 1-r.inCubic(1-a)};r.inOutCubic=function(a){return.5>a?r.inCubic(2*a)/2:(r.outCubic(2*(a-.5))+1)/2};r.inQuart=function(a){return a*
a*a*a};r.outQuart=function(a){return 1-r.inQuart(1-a)};r.inOutQuart=function(a){return.5>a?r.inQuart(2*a)/2:(r.outQuart(2*(a-.5))+1)/2};r.inQuint=function(a){return a*a*a*a*a};r.outQuint=function(a){return 1-r.inQuint(1-a)};r.inOutQuint=function(a){return.5>a?r.inQuint(2*a)/2:(r.outQuint(2*(a-.5))+1)/2};r.inSine=function(a){return-Math.cos(a*Math.PI/2)+1};r.outSine=function(a){return 1-r.inSine(1-a)};r.inOutSine=function(a){return.5>a?r.inSine(2*a)/2:(r.outSine(2*(a-.5))+1)/2};r.inExpo=function(a){return Math.pow(2,
10*(a-1))};r.outExpo=function(a){return 1-r.inExpo(1-a)};r.inOutExpo=function(a){return.5>a?r.inExpo(2*a)/2:(r.outExpo(2*(a-.5))+1)/2};r.inCirc=function(a){return-(Math.sqrt(1-a*a)-1)};r.outCirc=function(a){return 1-r.inCirc(1-a)};r.inOutCirc=function(a){return.5>a?r.inCirc(2*a)/2:(r.outCirc(2*(a-.5))+1)/2};r.inCoastQuad=b(a(1),1);r.outCoastQuad=b(a(1),0);r.inOutCoastQuad=b(a(1),.5);r.inCoastCubic=b(a(2),1);r.outCoastCubic=b(a(2),0);r.inOutCoastCubic=b(a(2),.5);r.inCoastQuart=b(a(3),1);r.outCoastQuart=
b(a(3),0);r.inOutCoastQuart=b(a(3),.5);r.inCoastQuint=b(a(4),1);r.outCoastQuint=b(a(4),0);r.inOutCoastQuint=b(a(4),.5);r.named={linear:k,"in-quad":r.inQuad,"out-quad":r.outQuad,"in-out-quad":r.inOutQuad,"in-cubic":r.inCubic,"out-cubic":r.outCubic,"in-out-cubic":r.inOutCubic,"in-quart":r.inQuart,"out-quart":r.outQuart,"in-out-quart":r.inOutQuart,"in-quint":r.inQuint,"out-quint":r.outQuint,"in-out-quint":r.inOutQuint,"in-sine":r.inSine,"out-sine":r.outSine,"in-out-sine":r.inOutSine,"in-expo":r.inExpo,
"out-expo":r.outExpo,"in-out-expo":r.inOutExpo,"in-circ":r.inCirc,"out-circ":r.outCirc,"in-out-circ":r.inOutCirc}})},"esri/views/3d/state/controllers/PointToPointAnimationController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./AnimationController ../../webgl-engine/lib/Camera ../../lib/glMatrix ../../animation/pointToPoint/Animation".split(" "),function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c,f){f=a.call(this,f)||
this;f.viewState=b;f.pickingHelper=c;f.hasTarget=!1;f.animation=new t.default(f.viewState.mode);return f}k(b,a);b.prototype.begin=function(a,b){this.hasTarget=!0;b=this.animationSettings(b);n.copyFrom(this.viewState.camera);this.pickingHelper.pickRaySegment(n.eye,n.center,f)&&(n.center=f);this.animation.update(n,a,b);this.animation.finished&&this.finish()};b.prototype.finish=function(){this.animation.currentTime=this.animation.time;a.prototype.finish.call(this)};Object.defineProperty(b.prototype,
"steppingFinished",{get:function(){return this.hasTarget&&this.animation.finished},enumerable:!0,configurable:!0});b.prototype.stepController=function(b,c){a.prototype.stepController.call(this,b,c);this.hasTarget&&this.animation.step(b,c)};b.prototype.onControllerEnd=function(b){this.hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,b),this.animation.currentTime=this.animation.time);a.prototype.onControllerEnd.call(this,b)};b.prototype.animationSettings=function(a){void 0===
a&&(a={});return{apex:{maximumDistance:this.viewState.constraints.clampAltitude(Infinity)/6,ascensionFactor:void 0,descensionFactor:void 0},speedFactor:a.speedFactor,duration:a.duration,maxDuration:a.maxDuration,easing:a.easing}};return b}(a.AnimationController);r.PointToPointAnimationController=x;var n=new b,f=c.vec3d.create()})},"esri/views/3d/animation/pointToPoint/Animation":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../animation/pointToPoint/Animation ./Camera ../../lib/glMatrix ../../webgl-engine/lib/Camera".split(" "),
function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});var n=c.vec3d,f=n.create();x=function(){function c(c){this.currentTime=0;this.animation=new a.Animation(function(){return new b.default(c)});this._current=new b.default(c)}Object.defineProperty(c.prototype,"finished",{get:function(){return this.currentTime>=this.animation.time},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"time",{get:function(){return this.animation.time},enumerable:!0,configurable:!0});
c.prototype.update=function(a,b,c){var l=this.animation.definition.source,q=this.animation.definition.target,k=n.subtract(b.center,a.center,f),t=n.length(k);1E-5<=t?(k[0]/=t,k[1]/=t,k[2]/=t):(k[0]=0,k[1]=1,k[0]=0);n.set(k,l.lookAtDirection);n.set(k,q.lookAtDirection);l.copyFromRenderCamera(a);q.copyFromRenderCamera(b);this._current.copyFrom(l);this.animation.update(l,q,c);this.currentTime=0;a.almostEquals(b,5E-4,!0)&&(this.currentTime=this.animation.time)};c.prototype.cameraAt=function(a,b){a=this.animation.cameraAt(a,
this._current);b||(b=new t);a.copyToRenderCamera(b);return b};c.prototype.step=function(a,b){this.finished||(this.currentTime+=a,this.currentTime>=this.time&&(this.currentTime=this.time));return this.cameraAt(this.currentTime/this.time,b)};return c}();r.Animation=x;r.default=x})},"esri/views/animation/pointToPoint/Animation":function(){define("require exports ../easing ./Definition ./Settings ./apex/Path".split(" "),function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});var t={zoom:0,
pan:0,rotate:0};x=function(){function n(b){this.createCamera=b;this.time=0;this.definition=new a.Definition(b);this.path=new c.Path}n.prototype.update=function(a,b,c){this.definition.update(a,b,c);this.path.update(this.definition,c);this.time=this._applyTimeSettings(this.path.time,c);this.settings=c};n.prototype.cameraAt=function(a,b){b||(b=this.createCamera());a=Math.min(Math.max(0,a),1);a=this.settings.easing?this.normalizedEasing(this.settings.easing,a,1E3*this.time):1<=this.time?this.normalizedEasing(k.inOutCoastQuad,
a):this.normalizedEasing(k.outExpo,a);a=this.path.interpolateComponentsAt(a,t);b.interpolate(this.definition.source,this.definition.target,a);return b};n.prototype.normalizedEasing=function(a,b,c){c=a(0);var f=a(1);return(a(b)-c)/(f-c)};n.prototype._applyTimeSettings=function(a,c){var f=null!=c.speedFactor?c.speedFactor:1;null!=c.duration?a=c.duration:null!=c.speedFactor&&(a/=f);return a=Math.min(Math.max(null!=c.minDuration?c.minDuration:b.defaultSettings.minDuration/f,a),null!=c.maxDuration?c.maxDuration:
b.defaultSettings.maxDuration/f)};return n}();r.Animation=x;r.default=x})},"esri/views/animation/pointToPoint/Definition":function(){define(["require","exports","./Settings"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function a(a){this.createCamera=a;this.compared={sourceZoom:0,targetZoom:0,pan:0,rotate:0};this.settings={desiredScreenFlow:k.defaultSettings.desiredScreenFlow};this.source=a();this.target=a()}a.prototype.clone=function(){var b=new a(this.createCamera);
b.copyFrom(this);return b};a.prototype.copyFrom=function(a){this.update(a.source,a.target,a.settings)};a.prototype.update=function(a,c,t){this.source!==a&&this.source.copyFrom(a);this.target!==c&&this.target.copyFrom(c);this.settings.desiredScreenFlow=null!=t.desiredScreenFlow?t.desiredScreenFlow:k.defaultSettings.desiredScreenFlow;this.compared=this.source.compareTo(this.target,this.compared);this.desiredPixelFlow=this.settings.desiredScreenFlow*this.target.size;this.halfWindowSize=this.target.size/
2};a.prototype.halfWindowPanAtZoom=function(a){a=this.target.pixelsPerPanAtZoom(a);return this.halfWindowSize/a};Object.defineProperty(a.prototype,"hasZoom",{get:function(){return 1E-5<Math.abs(this.compared.sourceZoom-this.compared.targetZoom)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasPan",{get:function(){return 1E-9<this.compared.pan},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasRotate",{get:function(){return 1E-9<this.compared.rotate},enumerable:!0,
configurable:!0});return a}();r.Definition=x;r.default=x})},"esri/views/animation/pointToPoint/Settings":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.defaultSettings={desiredScreenFlow:2,minDuration:.5,maxDuration:8}})},"esri/views/animation/pointToPoint/apex/Path":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../easing ../Path ../Segment ./planning".split(" "),function(x,r,k,a,b,c,t){Object.defineProperty(r,
"__esModule",{value:!0});x=function(b){function f(a,f){var l=b.call(this)||this;l._preallocSegments=[new c.default,new c.default,new c.default];l.update(a,f);return l}k(f,b);f.prototype.update=function(a,b){if(a){this.definition?this.definition.copyFrom(a):this.definition=a.clone();var c=null;b&&b.apex&&(c=t.optimalDistance(a,b.apex));this.segments.length=0;this._descensionSegment=this._ascensionSegment=null;null==c?this._updateWithoutApex():this._updateWithApex(c,b.apex)}};f.prototype.segmentInterpolateComponentsAt=
function(b,c,f){f=b.interpolateComponentsAt(c,f);b===this._ascensionSegment?f.zoom=a.outQuad(f.zoom):b===this._descensionSegment&&(f.zoom=a.inQuad(f.zoom));return f};f.prototype._updateWithApex=function(a,b){var c=this._preallocSegments,f=c[0],l=c[1],c=c[2],q=null!=b.ascensionFactor?b.ascensionFactor:.5;b=Math.min(1-q,null!=b.ascensionFactor?b.descensionFactor:.5);var n=1-q-b;f.definition?f.definition.copyFrom(this.definition):f.definition=this.definition.clone();f.definition.compared.targetZoom=
a;f.definition.compared.pan=this.definition.compared.pan*q;f.definition.compared.rotate=this.definition.compared.rotate*q;f.update();this._ascensionSegment=f;this.segments.push(f);0<n&&(l.definition?l.definition.copyFrom(this.definition):l.definition=this.definition.clone(),l.definition.copyFrom(this.definition),l.definition.compared.sourceZoom=a,l.definition.compared.targetZoom=a,l.definition.compared.pan=this.definition.compared.pan*n,l.definition.compared.rotate=this.definition.compared.rotate*
n,l.update(),this.segments.push(l));c.definition?c.definition.copyFrom(this.definition):c.definition=this.definition.clone();c.definition.compared.sourceZoom=a;c.definition.compared.pan=this.definition.compared.pan*b;c.definition.compared.rotate=this.definition.compared.rotate*b;c.update();this._descensionSegment=c;this.segments.push(c)};f.prototype._updateWithoutApex=function(){var a=this._preallocSegments[0];a.update(this.definition);this.segments.push(a)};return f}(b.default);r.Path=x;r.default=
x})},"esri/views/animation/pointToPoint/Path":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(){this.segments=[]}Object.defineProperty(k.prototype,"time",{get:function(){return this.segments.reduce(function(a,b){return a+b.time},0)},enumerable:!0,configurable:!0});k.prototype.interpolateComponentsAt=function(a,b){a=Math.min(Math.max(a,0),1);a*=this.time;for(var c=0,k=0,n=this.definition,f=0;f<this.segments.length;f++){var q=
this.segments[f],l=q.definition;if(a<=q.time||f===this.segments.length-1)return b=this.segmentInterpolateComponentsAt(q,a/q.time,b),b.pan=n.hasPan?(c+l.compared.pan*b.pan)/n.compared.pan:1,b.rotate=n.hasRotate?(k+l.compared.rotate*b.rotate)/n.compared.rotate:1,a=b.zoom*(l.compared.targetZoom-l.compared.sourceZoom)+l.compared.sourceZoom,c=this.segments[0].definition.compared.sourceZoom,k=this.segments[this.segments.length-1].definition.compared.targetZoom,b.zoom=n.hasZoom?(a-c)/(k-c):1,b;a-=q.time;
c+=l.compared.pan;k+=l.compared.rotate}};k.prototype.segmentInterpolateComponentsAt=function(a,b,c){return a.interpolateComponentsAt(b,c)};return k}();r.Path=x;r.default=x})},"esri/views/animation/pointToPoint/Segment":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(a){a&&this.update(a)}k.prototype.update=function(a){a&&(this.definition?this.definition.copyFrom(a):this.definition=a.clone());this._updatePrecomputedVariables();
this._updatePixelFlow()};k.prototype._updatePrecomputedVariables=function(){var a=this.definition,b=a.compared,c=b.sourceZoom,k=b.targetZoom;this._sl=c>k?1:-1;this._panPixelsAtSource=b.pan*a.source.pixelsPerPanAtZoom(c);a=(a.source.pixelsPerRotateAtZoom(c)+a.target.pixelsPerRotateAtZoom(k))/2;this._rotatePixels=b.rotate*a};k.prototype._updatePixelFlow=function(){var a=this.definition.compared.sourceZoom,b=this.definition.compared.targetZoom,c=this.definition.hasZoom,k=this.definition.hasPan,n=this.definition.hasRotate,
f,q;f=k&&c?(b/a-1)/(-1/(this._sl*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource):0;q=c&&n?Math.log(a/b)/Math.LN2*this._sl*this.definition.halfWindowSize/this._rotatePixels:0;this._rotatePixelFlow=this._panPixelFlow=this._zoomPixelFlow=0;a=this.definition.desiredPixelFlow;c&&k&&n?(b=f+q+f*q,this._zoomPixelFlow=f*q/b*a,this._panPixelFlow=q/b*a,this._rotatePixelFlow=f/b*a):c&&k?(b=1+f,this._zoomPixelFlow=f/b*a,this._panPixelFlow=1/b*a):c&&n?(b=1+q,this._zoomPixelFlow=q/b*a,this._rotatePixelFlow=
1/b*a):k&&n?(f=this._panPixelsAtSource/this._rotatePixels,b=1+f,this._panPixelFlow=f/b*a,this._rotatePixelFlow=1/b*a):k?this._panPixelFlow=a:c?this._zoomPixelFlow=a:n&&(this._rotatePixelFlow=a);this.time=n?this.rotateTime:c?this.zoomTime:k?this.panTime:0};Object.defineProperty(k.prototype,"zoomTime",{get:function(){return this.definition.hasZoom?Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2*this._sl*this.definition.halfWindowSize/this._zoomPixelFlow:0},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"panTime",{get:function(){if(this.definition.hasPan){if(this.definition.hasZoom){var a=-1/(this._sl*this.definition.halfWindowSize)*Math.LN2;return Math.log(this._zoomPixelFlow/this._panPixelFlow*this._panPixelsAtSource*a+1)/(a*this._zoomPixelFlow)}return this._panPixelsAtSource/this._panPixelFlow}return 0},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"rotateTime",{get:function(){return this.definition.hasRotate?
this._rotatePixels/this._rotatePixelFlow:0},enumerable:!0,configurable:!0});k.prototype._interpolateComponentsZoom=function(a){if(this.definition.hasZoom){var b=this.definition.compared.sourceZoom,c=this.definition.compared.targetZoom;return(b*Math.pow(b/c,-a)-b)/(c-b)}return a};k.prototype._interpolateComponentsPan=function(a){if(this.definition.hasPan&&this.definition.hasZoom){var b=-1/(this._sl*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*this._panPixelFlow*
(Math.pow(2,b*a*this.time)-1)/(b*Math.LN2)}return a};k.prototype._interpolateComponentsRotate=function(a){return a};k.prototype.interpolateComponentsAt=function(a,b){a=Math.min(Math.max(a,0),1);var c=this._interpolateComponentsZoom(a),k=this._interpolateComponentsPan(a);a=this._interpolateComponentsRotate(a);b?(b.zoom=c,b.pan=k,b.rotate=a):b={zoom:c,pan:k,rotate:a};return b};return k}();r.Segment=x;r.default=x})},"esri/views/animation/pointToPoint/apex/planning":function(){define(["require","exports",
"./functions"],function(x,r,k){function a(a,c){var b=Math.max(a.compared.sourceZoom,a.compared.targetZoom);a=a.source.zoomAtPixelsPerPan(a.desiredPixelFlow/a.compared.pan)/2;return a<b?null!=c.maximumDistance?b+(c.maximumDistance-b)/2:1.5*b:c.maximumDistance?Math.min(c.maximumDistance,a):a}Object.defineProperty(r,"__esModule",{value:!0});r.optimalDistance=function(b,c){var t=a(b,c),n={ascensionFactor:null!=c.ascensionFactor?c.ascensionFactor:.5,descensionFactor:null!=c.descensionFactor?c.descensionFactor:
.5},f=0===n.ascensionFactor,q=0===n.descensionFactor,l=f?k.tAscensionZoomOnly:k.tAscensionZoomPan,y=f?k.dtAscensionZoomOnly:k.dtAscensionZoomPan,B=f?k.ddtAscensionZoomOnly:k.ddtAscensionZoomPan,v=q?k.tDescensionZoomOnly:k.tDescensionZoomPan,w=q?k.dtDescensionZoomOnly:k.dtDescensionZoomPan,D=q?k.ddtDescensionZoomOnly:k.ddtDescensionZoomPan,f=function(a){return l(b,n,a)+k.tPanion(b,n,a)+v(b,n,a)},q=function(a){return y(b,n,a)+k.dtPanion(b,n,a)+w(b,n,a)},F=function(a){return B(b,n,a)+k.ddtPanion(b,n,
a)+D(b,n,a)},G=f(t),p=k.tBaseLine(b),z=c.maximumIterations||20,A=null!=c.maximumDistance?c.maximumDistance:Infinity;for(c=0;c<z;c++){var r=(q(t)+1E-6)/F(t);if(isNaN(r)||t>=A&&0>r){if(!isFinite(A))return null;t=A;G=f(t);break}t-=r;if(t<b.compared.sourceZoom||t<b.compared.targetZoom)return null;r=f(t);if(.005>=Math.abs(r-G)/G)break;G=r}return G>.7*p?null:t<b.compared.sourceZoom||t<b.compared.targetZoom?null:t}})},"esri/views/animation/pointToPoint/apex/functions":function(){define(["require","exports"],
function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.tAscensionZoomPan=function(k,a,b){var c=k.halfWindowPanAtZoom(b-k.compared.sourceZoom);return-k.halfWindowSize*(a.ascensionFactor*Math.LN2*k.compared.pan+c)*Math.log(k.compared.sourceZoom/b)/(k.desiredPixelFlow*Math.LN2*c)};r.dtAscensionZoomPan=function(k,a,b){var c=1/b,t=Math.log(k.compared.sourceZoom*c),n=1/k.desiredPixelFlow,f=1/Math.LN2;b-=k.compared.sourceZoom;var q=1/b;a=(a.ascensionFactor*Math.LN2*k.compared.pan+k.halfWindowPanAtZoom(b))/
k.halfWindowPanAtZoom(1);return k.halfWindowSize*c*n*f*q*a-k.halfWindowSize*t*n*f*q+k.halfWindowSize*t*n*f*a/(b*b)};r.ddtAscensionZoomPan=function(k,a,b){var c=b-k.compared.sourceZoom,t=1/c,n=1/b,f=Math.log(k.compared.sourceZoom*n);a=(a.ascensionFactor*Math.LN2*k.compared.pan+k.halfWindowPanAtZoom(c))/k.halfWindowPanAtZoom(1);return k.halfWindowSize*t*(-2*t*n*a+2*t*f+2*n-2*f*a/(c*c)-a/(b*b))/(k.desiredPixelFlow*Math.LN2)};r.tAscensionZoomOnly=function(k,a,b){return-k.halfWindowSize*Math.log(k.compared.sourceZoom/
b)/(k.desiredPixelFlow*Math.LN2)};r.dtAscensionZoomOnly=function(k,a,b){return k.halfWindowSize/(b*k.desiredPixelFlow*Math.LN2)};r.ddtAscensionZoomOnly=function(k,a,b){return-k.halfWindowSize/(b*b*k.desiredPixelFlow*Math.LN2)};r.tPanion=function(k,a,b){return-k.compared.pan*k.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(k.desiredPixelFlow*k.halfWindowPanAtZoom(b))};r.dtPanion=function(k,a,b){return k.compared.pan*k.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(k.desiredPixelFlow*
k.halfWindowPanAtZoom(b*b))};r.ddtPanion=function(k,a,b){return-2*k.compared.pan*k.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(k.desiredPixelFlow*k.halfWindowPanAtZoom(b*b*b))};r.tDescensionZoomPan=function(k,a,b){return k.halfWindowSize*(-k.halfWindowPanAtZoom(b)-a.descensionFactor*Math.LN2*k.compared.pan+k.halfWindowPanAtZoom(k.compared.targetZoom))*Math.log(b/k.compared.targetZoom)/(k.desiredPixelFlow*Math.LN2*k.halfWindowPanAtZoom(-b+k.compared.targetZoom))};r.dtDescensionZoomPan=
function(k,a,b){var c=Math.log(b/k.compared.targetZoom),t=1/k.desiredPixelFlow,n=1/Math.LN2,f=-b+k.compared.targetZoom,q=1/f;a=(-k.halfWindowPanAtZoom(b)-a.descensionFactor*Math.LN2*k.compared.pan+k.halfWindowPanAtZoom(k.compared.targetZoom))/k.halfWindowPanAtZoom(1);return-k.halfWindowSize*c*t*n*q+k.halfWindowSize*c*t*n*a/(f*f)+k.halfWindowSize*t*n*q*a/b};r.ddtDescensionZoomPan=function(k,a,b){var c=b-k.compared.targetZoom,t=1/c,n=1/b,f=Math.log(b/k.compared.targetZoom);a=(k.halfWindowPanAtZoom(b)+
a.descensionFactor*Math.LN2*k.compared.pan-k.halfWindowPanAtZoom(k.compared.targetZoom))/k.halfWindowPanAtZoom(1);return k.halfWindowSize*t*(-2*t*n*a-2*t*f+2*n+2*f*a/(c*c)-a/(b*b))/(k.desiredPixelFlow*Math.LN2)};r.tDescensionZoomOnly=function(k,a,b){return k.halfWindowSize*Math.log(b/k.compared.targetZoom)/(k.desiredPixelFlow*Math.LN2)};r.dtDescensionZoomOnly=function(k,a,b){return k.halfWindowSize/(b*k.desiredPixelFlow*Math.LN2)};r.ddtDescensionZoomOnly=function(k,a,b){return-k.halfWindowSize/(b*
b*k.desiredPixelFlow*Math.LN2)};r.tBaseLine=function(k){var a=Math.LN2*k.compared.pan,b=k.halfWindowPanAtZoom(k.compared.sourceZoom-k.compared.targetZoom),c=k.halfWindowSize*Math.log(k.compared.sourceZoom/k.compared.targetZoom)/(k.desiredPixelFlow*Math.LN2*b);return k.compared.sourceZoom<=k.compared.targetZoom?c*(a-b):c*(a+b)}})},"esri/views/3d/animation/pointToPoint/Camera":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(x,r,k,a){Object.defineProperty(r,
"__esModule",{value:!0});var b=a.angle,c=a.lerp,t=a.slerpOrLerp,n=k.vec3d,f=k.mat3d,q=n.create(),l=n.create(),y=n.create(),B=n.create(),v=n.create(),w=n.create(),D=n.createFrom(0,0,1),F=n.createFrom(0,1,0),G=n.createFrom(1,0,0),p=f.create();x=function(){function a(a){void 0===a&&(a="global");this.viewingMode=a;this.center=n.create();this.distance=this.yaw=this.pitch=0;this.lookAtDirection=n.create(F)}a.prototype.pixelsPerPanAtZoom=function(a){return this.size/2/(this._zoomToPanScale*a)};a.prototype.zoomAtPixelsPerPan=
function(a){return this.size/2/(this._zoomToPanScale*a)};a.prototype.pixelsPerRotateAtZoom=function(a){return this.size/2/Math.max(Math.cos(Math.abs(this.pitch)),.5)};a.prototype.compareTo=function(a,c){c||(c={pan:0,rotate:0,sourceZoom:0,targetZoom:0});if("global"===this.viewingMode){var f=n.length(this.center),p=n.length(a.center),f=(f+p)/2;c.pan=b(this.center,a.center)*f}else c.pan=n.dist(this.center,a.center);f=Math.abs(a.yaw-this.yaw);f>=Math.PI&&(f=2*Math.PI-f);c.rotate=Math.max(f,Math.abs(a.pitch-
this.pitch));c.sourceZoom=this.distance;c.targetZoom=a.distance;return c};a.prototype.interpolate=function(a,b,f){"global"===this.viewingMode?t(a.center,b.center,f.pan,this.center,z):n.lerp(a.center,b.center,f.pan,this.center);this.distance=c(a.distance,b.distance,f.zoom);this.pitch=c(a.pitch,b.pitch,f.rotate);a=a.yaw;b=b.yaw;Math.abs(b-a)>=Math.PI&&(a+=2*(a<b?1:-1)*Math.PI);this.yaw=c(a,b,f.rotate)};a.prototype.copyFrom=function(a){n.set(a.center,this.center);this.pitch=a.pitch;this.yaw=a.yaw;this.distance=
a.distance;n.set(a.lookAtDirection,this.lookAtDirection);this.size=a.size;this.copyFromCommon(a);this.viewingMode=a.viewingMode};a.prototype.copyFromRenderCamera=function(a){var b=this._lookAtOrientation(a.center,p);n.set(a.center,this.center);f.multiplyVec3(b,n.subtract(a.center,a.eye,B));f.multiplyVec3(b,a.up,v);this.distance=n.length(B);B[0]/=this.distance;B[1]/=this.distance;B[2]/=this.distance;this.pitch=this._eyeUpToPitch(B,v);this.yaw=this._eyeUpToYaw(B,v);this.size=Math.sqrt(a.width*a.width+
a.height*a.height);this.copyFromCommon(a)};a.prototype.copyFromCommon=function(a){this.fov=a.fov;this._zoomToPanScale=Math.atan(.5*this.fov)};a.prototype.copyToRenderCamera=function(a){var b=this._lookAtOrientation(this.center,p);f.transpose(b);this._axisAngleVec3(G,this.pitch-Math.PI/2,F,B);this._axisAngleVec3(D,this.yaw,B);this._axisAngleVec3(G,this.pitch-Math.PI/2,D,v);this._axisAngleVec3(D,this.yaw,v);n.scale(B,this.distance);f.multiplyVec3(b,B);f.multiplyVec3(b,v);a.center=this.center;a.eye=
n.subtract(this.center,B,B);a.up=v};a.prototype._axisAngleVec3=function(a,b,c,f){void 0===f&&(f=c);var p=Math.cos(b);b=Math.sin(b);n.scale(c,p,q);n.scale(n.cross(a,c,l),b);n.scale(a,(1-p)*n.dot(a,c),y);return n.add(n.add(q,l,f),y,f)};a.prototype._lookAtOrientation=function(a,b){this._upAtLookAt(a,y);n.normalize(n.cross(this.lookAtDirection,y,q));0===q[0]&&0===q[1]&&0===q[2]&&n.set(G,q);n.normalize(n.cross(y,q,l));b||(b=f.create());b[0]=q[0];b[1]=l[0];b[2]=y[0];b[3]=q[1];b[4]=l[1];b[5]=y[1];b[6]=q[2];
b[7]=l[2];b[8]=y[2];return b};a.prototype._upAtLookAt=function(a,b){return"local"===this.viewingMode?n.set(D,b):n.normalize(a,b)};a.prototype._eyeUpToPitch=function(a,c){return Math.PI-b(D,a)};a.prototype._eyeUpToYaw=function(a,c){.5>Math.abs(c[2])?(n.set(c,w),0<a[2]&&n.scale(w,-1)):n.set(a,w);return b(G,n.normalize(n.cross(w,D,l)),D)};return a}();var z=1E-4;r.default=x})},"esri/views/3d/support/cameraUtils":function(){define("require exports dojo/_base/lang ../../../geometry/SpatialReference ../../../config ../../../geometry/Point ../../../geometry/support/webMercatorUtils ../../../Camera ../webgl-engine/lib/Camera ../lib/glMatrix ./mathUtils ./earthUtils ./projectionUtils ./cameraUtilsPlanar ./cameraUtilsSpherical ../camera/intersectionUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D){function F(a){return"global"===a.viewingMode?w:v}function G(b,f,p){var k=b.renderSpatialReference,h=q.vec3d.set(f.viewForward,O),h=J(b,f.eye,h,f.up,P);b=b.spatialReference||a.WGS84;B.vectorToVector(f.eye,k,K,b)||(b=a.WGS84,B.vectorToVector(f.eye,k,K,b));return p?(p.position.x=K[0],p.position.y=K[1],p.position.z=K[2],p.position.spatialReference=b,p.heading=h.heading,p.tilt=h.tilt,p.fov=l.rad2deg(f.fov),p):new n(new c(K,b),h.heading,h.tilt,l.rad2deg(f.fov))}
function p(a,c,f){var p=a.state.camera,h=p.fovX,p=p.width/2;"global"===a.viewingMode&&null!=f&&(c*=Math.cos(l.deg2rad(f)));c/=a.renderCoordsHelper.unitInMeters;return p/(39.37*b.screenDPI/c)/Math.tan(h/2)}function z(a,c,f){var p=a.state.camera;c=39.37*b.screenDPI/(p.width/2/(c*Math.tan(p.fovX/2)));"global"===a.viewingMode&&(c/=Math.cos(l.deg2rad(f)));return c*=a.renderCoordsHelper.unitInMeters}function A(b,c,f,p,h,l){var q=b.renderSpatialReference;c=I(b,p.heading,p.tilt,c,f,h);b=B.vectorToPoint(c.eye,
q,b.spatialReference||a.WGS84);if(!b)return null;if(!l)return new n(b,c.heading,c.tilt,p.fov);l.position=b;l.heading=c.heading;l.tilt=c.tilt;l.fov=p.fov;return l}function J(a,b,c,f,h){return F(a).directionToHeadingTilt(b,c,f,h)}function I(b,f,p,l,h,n){var t=q.vec3d.create(),e=b.renderSpatialReference;if(l)if(l instanceof c){var d=l;B.pointToVector(d,t,b.renderSpatialReference);null==d.z&&null!=b.basemapTerrain&&(d=b.basemapTerrain.getElevation(d),null!=d&&b.renderCoordsHelper.setAltitude(d,t))}else l&&
q.vec3d.set(l,t);else q.vec3d.set(b.state.camera.center,t);l&&l instanceof c||(l=B.vectorToPoint(t,e,b.spatialReference||a.WGS84));h=Math.max(h,b.state.constraints.minimumPoiDistance);e=p;p=h;if(!(d=n&&n.noReset))var d=l,g=b.engineToScreen(b.state.camera.center),m=b.toScreen(d),d=g.x-m.x,g=g.y-m.y,m=b.pointsOfInterest.centerOnSurfaceFrequent.distance,m=Math.log(Math.max(p,m)/Math.min(p,m))/Math.LN2,d=!(Math.sqrt(d*d+g*g)>5*Math.max(b.width,b.height)||8<m&&8E5<p);d?(e=F(b).eyeTiltToLookAtTilt(t,p,
e),e=b.state.constraints.clampTilt(p,e),e=F(b).lookAtTiltToEyeTilt(t,p,e)):(f=0,e=b.state.constraints.tilt(p).min);p=e;e=F(b).eyeForCenterWithHeadingTilt;f=e(t,h,f,p);t={eye:f.eye,up:f.up,center:t,heading:f.heading,tilt:f.tilt};return n&&n.noReset||"global"!==b.viewingMode||(f=b.renderCoordsHelper.fromRenderCoords(t.eye,U,b.spatialReference)?b.basemapTerrain&&(b.basemapTerrain.getElevation(U)||0)>U.z-1:!1,!f)?t:(t=b.state.constraints.tilt(h).min,I(b,0,t,l,h,k.mixin({},n,{noReset:!0})))}Object.defineProperty(r,
"__esModule",{value:!0});var K=q.vec3d.create(),L=q.vec3d.create(),O=q.vec3d.create(),P={heading:0,tilt:0},U=new c,N=new l.Cyclical(-2.0037508342788905E7,2.0037508342788905E7);r.externalToInternal=function(a,b){var c=a.renderSpatialReference,f=F(a).headingTiltToDirectionUp,h=q.vec3d.create();return B.pointToVector(b.position,h,c)?(c=f(h,b.heading,b.tilt),q.vec3d.add(c.direction,h),a=D.cameraOnContentAlongViewDirection(a,h,c.direction,c.up),a.fov=l.deg2rad(b.fov),a):null};r.internalToExternal=G;r.scaleToDistance=
p;r.distanceToScale=z;r.fromCenterScale=function(a,b,c,f,h,l){c=p(a,c,b.latitude);return A(a,b,c,f,h,l)};r.fromCenterDistance=A;r.directionToHeadingTilt=J;r.eyeHeadingTiltForCenterPointAtDistance=I;r.fromExtent=function(b,f,p,l,h,q){var k;h instanceof n?(q=h,k={noReset:!1}):k=h;var e="global"===b.viewingMode;h=b.renderSpatialReference;var d=b.spatialReference||a.WGS84,g=a.WebMercator,m=f.spatialReference||g,v,w=0;null!=f.zmax&&null!=f.zmin&&(v=(f.zmax+f.zmin)/2,w=f.zmax-f.zmin);if(e){var e=new c(f.xmin,
f.ymin,m),D=new c(f.xmax,f.ymax,m),e=t.project(e,g),D=t.project(D,g);if(null===e||null===D)return;f=new c(N.center(e.x,D.x),(D.y+e.y)/2,g);null!=v&&(f.z=v);v=y.getGreatCircleSpanAt(f,e,D);g=v.lon;m=v.lat;N.diff(e.x,D.x)>N.range/2&&(g+=y.halfEarthCircumference);g=Math.min(g,y.halfEarthCircumference);m=Math.min(m,y.halfEarthCircumference)}else t.canProject(f,d)&&(f=t.project(f,d)),g=f.xmax-f.xmin,m=f.ymax-f.ymin,f=new c({x:f.xmin+.5*g,y:f.ymin+.5*m,z:v,spatialReference:d});v=b.state.camera;p=I(b,p,
l,f,Math.max(1/Math.tan(v.fovX/2)*g*.5,1/Math.tan(v.fovY/2)*m*.5,1/Math.tan(v.fov/2)*w*.5)/1,k);l=B.vectorToPoint(p.eye,h,d);if(!l)return null;q||(q=new n);q.position=l;q.heading=p.heading;q.tilt=p.tilt;q.fov=b.camera.fov;return q};r.toExtent=function(b,c,f,p,h){var l;l=b.renderSpatialReference;c||(f||(f=b.state.camera),c=G(b,f,h));if(f)h=B.vectorToPoint(f.center,l,b.spatialReference||a.WGS84),l=f.distance;else{h=b.toMap(b.screenCenter);if(!h)return null;l=y.computeCarthesianDistance(c.position,h)}f||
(f=b.state.camera);c=2*l*Math.tan(f.fovX/2)*1;f=2*l*Math.tan(f.fovY/2)*1;return"global"===b.viewingMode?w.toExtent(b,h,c,f,p):v.toExtent(b,h,c,f,p)};r.scaleToZoom=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.levelAtScale(b):void 0};r.zoomToScale=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.scaleAtLevel(b):void 0};r.computeScale=function(b,c,p){var l=b.renderSpatialReference;c||(c=b.state.camera);var h;h=a.WGS84;c instanceof f?(B.vectorToVector(c.center,
l,L,h),h=L[1],c=c.distance):(h=c.position.latitude,B.pointToVector(c.position,K,l),B.pointToVector(p,L,l),c=q.vec3d.dist(K,L));return z(b,c,h)}})},"esri/views/3d/support/projectionUtils":function(){define("../../../geometry/SpatialReference ../../../geometry/Point ./mathUtils ./earthUtils ../lib/glMatrix ../webgl-engine/lib/BufferVectorMath".split(" "),function(x,r,k,a,b,c){var t=b.vec3d,n=b.mat4d,f=c.Vec3Compact,q=t.create(),l=t.create(),y=t.create(),B=k.deg2rad(1),v=k.rad2deg(1),w,D,F,G,p=new x({wkt:'\r\n GEOCCS["Spherical geocentric",\r\n DATUM["Not specified",\r\n SPHEROID["Sphere",'+
a.earthRadius+',0]],\r\n PRIMEM["Greenwich",0.0,\r\n AUTHORITY["EPSG","8901"]],\r\n UNIT["m",1.0],\r\n AXIS["Geocentric X",OTHER],\r\n AXIS["Geocentric Y",EAST],\r\n AXIS["Geocentric Z",NORTH]\r\n ]\r\n '}),z=new x({wkt:'\r\n GEOCCS["WGS 84",\r\n DATUM["WGS_1984",\r\n SPHEROID["WGS 84",6378137,298.257223563,\r\n AUTHORITY["EPSG","7030"]],\r\n AUTHORITY["EPSG","6326"]],\r\n PRIMEM["Greenwich",0,\r\n AUTHORITY["EPSG","8901"]],\r\n UNIT["m",1.0,\r\n AUTHORITY["EPSG","9001"]],\r\n AXIS["Geocentric X",OTHER],\r\n AXIS["Geocentric Y",OTHER],\r\n AXIS["Geocentric Z",NORTH],\r\n AUTHORITY["EPSG","4978"]\r\n ]\r\n '}),
A=a.earthRadius,J=function(a){return a===p?1:a.isWGS84?2:a.isWebMercator?3:a===z?4:0};x=function(a,b,c,f){c[f++]=a[b++];c[f++]=a[b++];c[f]=a[b]};var I=function(a,b,c,f){var p=.4999999*Math.PI,l=B*a[b+1],l=k.clamp(l,-p,p),p=Math.sin(l);c[f++]=B*a[b]*A;c[f++]=A/2*Math.log((1+p)/(1-p));c[f]=a[b+2]},K=function(a,b,c,f){var p=A+a[b+2],l=B*a[b+1];a=B*a[b];b=Math.cos(l);c[f++]=Math.cos(a)*b*p;c[f++]=Math.sin(a)*b*p;c[f]=Math.sin(l)*p},L=[void 0,K,x,I,function(a,b,c,f){var p=B*a[b],l=B*a[b+1];a=a[b+2];b=
Math.sin(l);var l=Math.cos(l),q=6378137/Math.sqrt(1-.006694379990137799*b*b);c[f++]=(q+a)*l*Math.cos(p);c[f++]=(q+a)*l*Math.sin(p);c[f++]=(.9933056200098622*q+a)*b}],O=[void 0,function(a,b,c,p){var l=f.length(a,b),q=k.asin(a[b+2]/l);a=(0<a[b+1]?1:-1)*k.acos(a[b]/(Math.cos(q)*l));c[p++]=v*a;c[p++]=v*q;c[p]=l-A},x,function(a,b,c,f){c[f++]=v*(a[b++]/A);c[f++]=v*(Math.PI/2-2*Math.atan(Math.exp(-1*a[b++]/A)));c[f]=a[b]},function(a,b,c,f){var p=a[b],l=a[b+1];a=a[b+2];var q,h,n,k,e,d,g;b=Math.abs(a);q=p*
p+l*l;h=Math.sqrt(q);n=q+a*a;k=Math.sqrt(n);p=Math.atan2(l,p);e=a*a/n;n=q/n;l=1.8230912546075456E9/k;q=142.91722289812412-4.557728136518864E9/k;.3<n?(e=b/k*(1+n*(42697.67270715754+l+e*q)/k),k=Math.asin(e),l=e*e,n=Math.sqrt(1-l)):(n=h/k*(1-e*(42840.589930055656-l-n*q)/k),k=Math.acos(n),l=1-n*n,e=Math.sqrt(l));d=1-.006694379990137799*l;l=6378137/Math.sqrt(d);g=.9933056200098622*l;l=h-l*n;q=b-g*e;b=n*l+e*q;h=n*q-e*l;l=h/(g/d+b);k+=l;0>a&&(k=-k);c[f++]=v*p;c[f++]=v*k;c[f]=b+h*l/2}];return{SphericalECEFSpatialReference:p,
WGS84ECEFSpatialReference:z,vectorToVector:function(a,b,c,f){2===a.length?(q[0]=a[0],q[1]=a[1],q[2]=0,a=q):a===c&&(t.set(a,q),a=q);return this.bufferToBuffer(a,b,0,c,f,0,1)},pointToVector:function(a,b,c){q[0]=a.x;q[1]=a.y;var f=a.z;q[2]=void 0!==f?f:0;return this.bufferToBuffer(q,a.spatialReference,0,b,c,0,1)},vectorToPoint:function(a,b,c,f){"esri.SpatialReference"===c.declaredClass?(f=c,c=new r({spatialReference:f})):f=f||c.spatialReference;return this.bufferToBuffer(a,b,0,q,f,0,1)?(c.x=q[0],c.y=
q[1],c.z=q[2],c.spatialReference=f,c):null},xyzToVector:function(a,b,c,f,p,l){q[0]=a;q[1]=b;q[2]=c;return this.bufferToBuffer(q,f,0,p,l,0,1)},bufferToBuffer:function(a,b,c,f,p,q,n){n=n||1;w!==b&&(D=J(b),w=b);F!==p&&(G=J(p),F=p);n=c+3*n;if(D!==G||0===D&&!b.equals(p))if(0<D&&0<G)if(2!==G){var h=L[G];if(2!==D)for(p=O[D];c<n;c+=3,q+=3)p(a,c,l,0,b.wkid),h(l,0,f,q);else for(;c<n;c+=3,q+=3)h(a,c,f,q)}else for(p=O[D];c<n;c+=3,q+=3)p(a,c,f,q,b.wkid);else return!1;else if(f!==a||c!==q)for(;c<n;c++,q++)f[q]=
a[c];return!0},computeLinearTransformation:function(a,b,c,f){var p=J(a),q=J(f);if(p===q&&(0!==p||a.equals(f)))return n.identity(c),n.translate(c,b),!0;if(1===q){if(f=O[p])return f(b,0,l,0,a.wkid),K(l,0,y,0),f=B*l[0],b=B*l[1],a=Math.sin(f),f=Math.cos(f),p=Math.sin(b),b=Math.cos(b),c[0]=-a,c[4]=-p*f,c[8]=b*f,c[12]=y[0],c[1]=f,c[5]=-p*a,c[9]=b*a,c[13]=y[1],c[2]=0,c[6]=b,c[10]=p,c[14]=y[2],c[3]=0,c[7]=0,c[11]=0,c[15]=1,!0}else if(3===q&&(2===p||1===p))return O[p](b,0,l,0,a.wkid),a=B*l[1],I(l,0,y,0),n.identity(c),
n.translate(c,y),a=1/Math.cos(a),n.scale(c,[a,a,1]),!0;return!1},mbsToMbs:function(a,b,c,f){var p=J(b),q=J(f);if(p===q&&(0!==p||b.equals(f)))return c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],!0;if(1===q){if(f=O[p])return f(a,0,l,0,b.wkid),K(l,0,c,0),c[3]=a[3],!0}else if(3===q&&(2===p||1===p))return O[p](a,0,l,0,b.wkid),b=B*l[1],b=Math.abs(b)+Math.asin(a[3]/(A+a[2])),I(l,0,c,0),c[3]=b>.9999*Math.PI?Number.MAX_VALUE:1/Math.cos(b)*a[3],!0;return!1},extentToBoundingBox:function(a,b,c){if(null==a)return!1;
var f;q[0]=null!=a.xmin?a.xmin:0;q[1]=null!=a.ymin?a.ymin:0;q[2]=null!=a.zmin?a.zmin:0;f=this.bufferToBuffer(q,a.spatialReference,0,b,c,0,1);q[0]=null!=a.xmax?a.xmax:0;q[1]=null!=a.ymax?a.ymax:0;q[2]=null!=a.zmax?a.zmax:0;f=f&&this.bufferToBuffer(q,a.spatialReference,0,b,c,3,1);null==a.xmin&&(b[0]=-Infinity);null==a.ymin&&(b[1]=-Infinity);null==a.zmin&&(b[2]=-Infinity);null==a.xmax&&(b[3]=Infinity);null==a.ymax&&(b[4]=Infinity);null==a.zmax&&(b[5]=Infinity);return f},extentToBoundingRect:function(a,
b,c){if(null==a)return!1;var f;q[0]=null!=a.xmin?a.xmin:0;q[1]=null!=a.ymin?a.ymin:0;q[2]=null!=a.zmin?a.zmin:0;f=this.bufferToBuffer(q,a.spatialReference,0,q,c,0,1);b[0]=q[0];b[1]=q[1];q[0]=null!=a.xmax?a.xmax:0;q[1]=null!=a.ymax?a.ymax:0;q[2]=null!=a.zmax?a.zmax:0;f=f&&this.bufferToBuffer(q,a.spatialReference,0,q,c,0,1);b[2]=q[0];b[3]=q[1];null==a.xmin&&(b[0]=-Infinity);null==a.ymin&&(b[1]=-Infinity);null==a.xmax&&(b[2]=Infinity);null==a.ymax&&(b[3]=Infinity);return f},webMercator:{x2lon:function(a){return a/
A},y2lat:function(a){return Math.PI/2-2*Math.atan(Math.exp(-1*a/A))},lon2x:function(a){return a*A},lat2y:function(a){a=Math.sin(a);return A/2*Math.log((1+a)/(1-a))}}}})},"esri/views/3d/webgl-engine/lib/BufferVectorMath":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});(function(k){k.length=function(a,b){var c=a[b],k=a[b+1];a=a[b+2];return Math.sqrt(c*c+k*k+a*a)};k.normalize=function(a,b){var c=a[b],k=a[b+1],n=a[b+2],c=1/Math.sqrt(c*c+k*k+n*n);
a[b]*=c;a[b+1]*=c;a[b+2]*=c};k.scale=function(a,b,c){a[b]*=c;a[b+1]*=c;a[b+2]*=c};k.add=function(a,b,c,k,n,f){void 0===f&&(f=b);n=n||a;n[f]=a[b]+c[k];n[f+1]=a[b+1]+c[k+1];n[f+2]=a[b+2]+c[k+2]};k.subtract=function(a,b,c,k,n,f){void 0===f&&(f=b);n=n||a;n[f]=a[b]-c[k];n[f+1]=a[b+1]-c[k+1];n[f+2]=a[b+2]-c[k+2]}})(r.Vec3Compact||(r.Vec3Compact={}))})},"esri/views/3d/support/cameraUtilsPlanar":function(){define("require exports ../../../geometry/Extent ./mathUtils ./projectionUtils ./cameraUtilsInternal ../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t){function n(b,c,n){b=t.vec3d.create();var k=t.vec3d.create();t.mat4d.identity(l);t.mat4d.rotateZ(l,-a.deg2rad(c));t.mat4d.rotateX(l,a.deg2rad(n));t.mat4d.multiplyVec3(l,q,b);t.vec3d.scale(b,-1);t.mat4d.multiplyVec3(l,f,k);return{direction:b,up:k}}Object.defineProperty(r,"__esModule",{value:!0});var f=t.vec3d.createFrom(0,1,0),q=t.vec3d.createFrom(0,0,1),l=t.mat4d.create(),y=t.vec3d.create(),B=t.vec3d.create();r.headingTiltToDirectionUp=n;r.directionToHeadingTilt=function(a,
b,l,n){return c.directionToHeadingTilt(b,l,n,q,f)};r.eyeForCenterWithHeadingTilt=function(a,b,c,f){var l=n(a,c,f);a=t.vec3d.add(t.vec3d.scale(l.direction,-b,t.vec3d.create()),a);return{up:l.up,eye:a,heading:c,tilt:f}};r.lookAtTiltToEyeTilt=function(b,c,f){return a.rad2deg(f)};r.eyeTiltToLookAtTilt=function(b,c,f){return a.deg2rad(f)};r.toExtent=function(a,c,f,l,q){var p=a.renderSpatialReference;a=a.map&&a.spatialReference||c.spatialReference;b.pointToVector(c,y,p);b.pointToVector(c,B,p);y[0]-=f/2;
B[0]+=f/2;y[1]-=l/2;B[1]+=l/2;b.vectorToVector(y,p,y,a);b.vectorToVector(B,p,B,a);q?(q.xmin=y[0],q.ymin=y[1],q.xmax=B[0],q.ymax=B[1],q.spatialReference=a):q=new k(y[0],y[1],B[0],B[1],a);return q}})},"esri/views/3d/support/cameraUtilsInternal":function(){define(["require","exports","./mathUtils","../lib/glMatrix"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});var b=a.vec3d.create(),c=a.vec3d.create();r.directionToHeadingTilt=function(t,n,f,q,l){var y=b;a.vec3d.normalize(t,y);var B=
a.vec3d.dot(y,q),v=0<B,B=Math.abs(B);.99<B&&(B=Math.abs(a.vec3d.dot(n,q)),.99>B?(a.vec3d.set(n,y),v&&a.vec3d.scale(y,-1)):y=null);n=0;y&&(a.vec3d.scale(q,a.vec3d.dot(q,y),c),a.vec3d.subtract(y,c),n=a.vec3d.dot(y,l)/(a.vec3d.length(y)*a.vec3d.length(l)),a.vec3d.cross(y,l,c),n=(0<a.vec3d.dot(c,q)?1:-1)*k.rad2deg(k.acos(n)));t=k.rad2deg(k.acos(-a.vec3d.dot(q,t)/a.vec3d.length(t)));return f?(f.heading=n,f.tilt=t,f):{heading:n,tilt:t}}})},"esri/views/3d/support/cameraUtilsSpherical":function(){define("require exports ../../../geometry/SpatialReference ../../../geometry/Extent ../../../geometry/support/webMercatorUtils ./mathUtils ./earthUtils ./cameraUtilsInternal ../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n,f){function q(a,b,l){var p=f.vec3d.create(),q=f.vec3d.create();f.vec3d.cross(a,B,F);0===f.vec3d.dot(F,F)&&f.vec3d.cross(a,v,F);f.mat4d.identity(D);f.mat4d.rotate(D,-c.deg2rad(b),a);f.mat4d.rotate(D,-c.deg2rad(l),F);f.vec3d.cross(F,a,q);f.vec3d.normalize(q);f.mat4d.multiplyVec3(D,q);f.vec3d.normalize(a,p);f.mat4d.multiplyVec3(D,f.vec3d.negate(p));return{direction:p,up:q}}function l(a){var b=a[1];a[1]=-a[2];a[2]=b}function y(a,b){b=q(b,a.heading,a.tilt);a.up=b.up;return a}Object.defineProperty(r,
"__esModule",{value:!0});var B=f.vec3d.createFrom(0,0,1),v=f.vec3d.normalize(f.vec3d.createFrom(1,1,1)),w=new c.Cyclical(-180,180),D=f.mat4d.create(),F=f.vec3d.create(),G=f.vec3d.create();r.headingTiltToDirectionUp=q;r.directionToHeadingTilt=function(a,b,c,l){var p=F;f.vec3d.normalize(a,p);f.vec3d.cross(p,B,G);0===f.vec3d.dot(G,G)&&f.vec3d.cross(p,v,G);f.vec3d.cross(G,p,G);return n.directionToHeadingTilt(b,c,l,p,G)};r.eyeForCenterWithHeadingTilt=function(a,b,q,n){var p={eye:f.vec3d.create(),up:null,
tilt:n,heading:q},k=F;k[0]=a[0];k[1]=a[2];k[2]=-a[1];q=c.deg2rad(q);var t=c.deg2rad(n);n=Math.sin(q);q=Math.cos(q);var v=Math.sin(t),w=Math.cos(t),D=f.vec3d.length(k);if(1E-8>Math.abs(t))t=b+D;else var B=D/v,z=c.asin(b/B),t=B*Math.sin(Math.PI-t-z);var B=v*b,w=w*b,z=q*B,A=t-w,G=A*A,r=b*b*v*v,v=q*q*r,r=n*n*r,h=k[1]*A,J=v*(v+G-k[1]*k[1]);if(0>J)return f.vec3d.scale(k,t/D,p.eye),p.tilt=0,p;var x=Math.sqrt(J),J=v+G,h=0<q?-x+h:x+h;if(1E-8>Math.abs(J))return 1E-8>D?(p.eye[0]=0,p.eye[1]=0,p.eye[2]=b):f.vec3d.scale(k,
t/D,p.eye),p.tilt=0,l(p.eye),y(p,a);p.eye[1]=h/J;J=p.eye[1]*p.eye[1];b=1-J;h=Math.sqrt(b);z=v*J+r-2*z*p.eye[1]*h*A+b*G;if(1E-8>Math.abs(z))return f.vec3d.scale(k,t/D,p.eye),p.tilt=0,l(p.eye),y(p,a);p.eye[0]=(b*(t*k[0]-w*k[0])-B*h*(k[0]*p.eye[1]*q+k[2]*n))/z;p.eye[2]=(b*(t*k[2]-w*k[2])-B*h*(k[2]*p.eye[1]*q-k[0]*n))/z;f.vec3d.scale(p.eye,t);l(p.eye);return y(p,a)};r.lookAtTiltToEyeTilt=function(a,b,l){a=f.vec3d.length(a);b=c.asin(b/(Math.sqrt(b*b+a*a-2*b*a*Math.cos(Math.PI-l))/Math.sin(l)));return c.rad2deg(l-
b)};r.eyeTiltToLookAtTilt=function(a,b,l){l=c.deg2rad(l);a=f.vec3d.length(a);return c.asin(b/(a/Math.sin(l)))+l};r.toExtent=function(f,l,q,n,v){function p(a){var b=Math.PI/2;a=c.cyclical2PI.normalize(a,-b);a>b&&(a=Math.PI-a);return a}var y;y=l.latitude;l=l.longitude;var D=t.getLonDeltaForDistance(l,y,q)/2;q=l-D;l+=D;y=c.deg2rad(y);D=t.earthRadius;y=(1+Math.sin(y))/(1-Math.sin(y));var B=(y+1)*Math.tan(n/D/2);y=1.5*Math.PI-2*Math.atan(.5*(B+Math.sqrt(4*y+B*B)));n=y+n/D;y=p(y);n=p(n);n<y&&(D=n,n=y,y=
D);y=Math.max(c.rad2deg(y),-90);n=Math.min(c.rad2deg(n),90);l=w.monotonic(q,l);180<l-q&&(D=(l-q-180)/2,q+=D,l-=D);v?(v.xmin=q,v.ymin=y,v.xmax=l,v.ymax=n,v.spatialReference=k.WGS84):v=new a(q,y,l,n,k.WGS84);f.spatialReference&&f.spatialReference.isWebMercator&&b.geographicToWebMercator(v,!1,v);return v}})},"esri/views/3d/camera/intersectionUtils":function(){define("require exports ../../../geometry/Point ../lib/glMatrix ../support/aaBoundingRect ../support/earthUtils ../webgl-engine/lib/Selector".split(" "),
function(x,r,k,a,b,c,t){function n(b,l,q,n){void 0===n&&(n=a.vec3d.create());var k=f[b.viewingMode];k||(k=new t(b.viewingMode),k.enableBackfacesTerrain=!b.state.isGlobal,k.enableInvisibleTerrain=!0,f[b.viewingMode]=k);b._stage.pickRay(l,q,null,null,null,null,k);if((k=k.getMinResult())&&k.getIntersectionPoint(n))return n;k=a.vec3d.direction(q,l,B);if(!b.renderCoordsHelper.intersectManifold(l,k,0,n))if("global"===b.viewingMode){b=n;var k=a.vec3d.dot(l,l),p=c.earthRadius*c.earthRadius,k=k>p?Math.sqrt(k-
p)/3:1;a.vec3d.subtract(q,l,b);a.vec3d.scale(b,k/a.vec3d.length(b),b);a.vec3d.add(b,l)}else q!==n&&a.vec3d.set(q,n);return n}Object.defineProperty(r,"__esModule",{value:!0});r.eyeWithinExtent=function(a,c,f,l){return a.renderCoordsHelper.fromRenderCoords(c.eye,q,l)&&b.containsPoint(f,q)};r.surfaceElevationBelowEye=function(a,b){return a.renderCoordsHelper.fromRenderCoords(b.eye,y,a.basemapTerrain.spatialReference)?a.basemapTerrain.getElevation(y)||0:0};r.cameraOnContentAlongViewDirection=function(b,
c,f,q){var k=b.state.camera.copy();c&&(k.eye=c);f&&(k.center=f);q&&(k.up=q);n(b,k.eye,k.center,l);f=b.state.constraints;q=f.minimumPoiDistance;a.vec3d.dist2(k.eye,l)<q&&(c=f.collision.enabled,a.vec3d.set(k.viewForward,B),a.vec3d.scale(B,q),c?a.vec3d.subtract(l,B,k.eye):a.vec3d.add(k.eye,B,l),b=b.renderCoordsHelper,q=b.getAltitude(k.eye),f=f.collision.elevationMargin,c&&q<f&&(a.vec3d.subtract(l,k.eye,B),b.setAltitude(f,k.eye),a.vec3d.add(k.eye,B,l)));k.center=l;return k};r.contentAlongViewDirection=
n;var f={},q=a.vec3d.create(),l=a.vec3d.create(),y=new k,B=a.vec3d.create()})},"esri/views/3d/support/aaBoundingRect":function(){define(["require","exports","./mathUtils"],function(x,r,k){function a(a){return a[0]>=a[2]?0:a[2]-a[0]}function b(a){return a[1]>=a[3]?0:a[3]-a[1]}function c(a){return 4===a.length}Object.defineProperty(r,"__esModule",{value:!0});r.create=function(a){void 0===a&&(a=r.ZERO);return[a[0],a[1],a[2],a[3]]};r.fromExtent=function(a){return[a.xmin,a.ymin,a.xmax,a.ymax]};r.expand=
function(a,b,f){void 0===f&&(f=a);var q=b.declaredClass;"esri.geometry.Extent"===q?(f[0]=Math.min(a[0],b.xmin),f[1]=Math.min(a[1],b.ymin),f[2]=Math.max(a[2],b.xmax),f[3]=Math.max(a[3],b.ymax)):"esri.geometry.Point"===q?(f[0]=Math.min(a[0],b.x),f[1]=Math.min(a[1],b.y),f[2]=Math.max(a[2],b.x),f[3]=Math.max(a[3],b.y)):c(b)?(f[0]=Math.min(a[0],b[0]),f[1]=Math.min(a[1],b[1]),f[2]=Math.max(a[2],b[2]),f[3]=Math.max(a[3],b[3])):!Array.isArray(b)||2!==b.length&&3!==b.length||(f[0]=Math.min(a[0],b[0]),f[1]=
Math.min(a[1],b[1]),f[2]=Math.max(a[2],b[0]),f[3]=Math.max(a[3],b[1]));return f};r.allFinite=function(a){for(var b=0;4>b;b++)if(!isFinite(a[b]))return!1;return!0};r.width=a;r.height=b;r.center=function(c,n){void 0===n&&(n=[0,0]);n[0]=c[0]+a(c)/2;n[1]=c[1]+b(c)/2;return n};r.containsPoint=function(a,b){return b[0]>=a[0]&&b[1]>=a[1]&&b[0]<=a[2]&&b[1]<=a[3]};r.containsPointWithMargin=function(a,b,c){return b[0]>=a[0]-c&&b[1]>=a[1]-c&&b[0]<=a[2]+c&&b[1]<=a[3]+c};r.intersects=function(a,b){return Math.max(b[0],
a[0])<=Math.min(b[2],a[2])&&Math.max(b[1],a[1])<=Math.min(b[3],a[3])};r.contains=function(a,b){return b[0]>=a[0]&&b[2]<=a[2]&&b[1]>=a[1]&&b[3]<=a[3]};r.intersection=function(a,b,c){void 0===c&&(c=a);var f=b[0],l=b[1],n=b[2];b=b[3];c[0]=k.clamp(a[0],f,n);c[1]=k.clamp(a[1],l,b);c[2]=k.clamp(a[2],f,n);c[3]=k.clamp(a[3],l,b);return c};r.offset=function(a,b,c,q){void 0===q&&(q=a);q[0]=a[0]+b;q[1]=a[1]+c;q[2]=a[2]+b;q[3]=a[3]+c;return q};r.setMin=function(a,b,c){void 0===c&&(c=a);c[0]=b[0];c[1]=b[1];c!==
a&&(c[2]=a[2],c[3]=a[3]);return c};r.setMax=function(a,b,c){void 0===c&&(c=a);c[2]=b[0];c[3]=b[1];c!==a&&(c[0]=a[0],c[1]=a[1]);return a};r.set=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a};r.is=c;r.isPoint=function(c){return(0===a(c)||!isFinite(c[0]))&&(0===b(c)||!isFinite(c[1]))};r.equals=function(a,b,f){if(null==a||null==b)return a===b;if(!c(a)||!c(b))return!1;if(f)for(var q=0;q<a.length;q++){if(!f(a[q],b[q]))return!1}else for(q=0;q<a.length;q++)if(a[q]!==b[q])return!1;return!0};
r.POSITIVE_INFINITY=[-Infinity,-Infinity,Infinity,Infinity];r.NEGATIVE_INFINITY=[Infinity,Infinity,-Infinity,-Infinity];r.ZERO=[0,0,0,0]})},"esri/views/3d/webgl-engine/lib/Selector":function(){define("require exports dojo/has ./PerformanceTimer ./gl-matrix ./Object3D".split(" "),function(x,r,k,a,b,c){var t=b.vec3d.create(),n=b.vec3d.create();x=function(){function a(a,c,l,n,k,t,r,p){void 0===p&&(p=!1);this.dir=b.vec3d.create();this.normalDir=null;this.minResult=new f;this.maxResult=new f;this.transform=
b.mat4d.create();this._transformInverse=new q({value:this.transform},b.mat4d.inverse,b.mat4d.create);this._transformInverseTranspose=new q(this._transformInverse,b.mat4d.transpose,b.mat4d.create);this._transformTranspose=new q({value:this.transform},b.mat4d.transpose,b.mat4d.create);this._transformInverseRotation=new q({value:this.transform},b.mat4d.toInverseMat3,b.mat3d.create);this.enableTerrain=this.enableHUDSelection=!0;this.enableInvisibleTerrain=!1;this.enableBackfacesTerrain=!0;this.performanceInfo=
{queryDuration:0,numObjectsTested:0};this.viewingMode=a||"global";this.intersectObject=this.intersectObject.bind(this);this.init(c,l,n,k,t,r,p)}a.prototype.init=function(a,c,f,l,q,n,k){c&&f&&b.vec3d.subtract(f,c,this.dir);this.minResult.init(c,f);this.maxResult.init(c,f);this.numObjectsTested=0;this.point=l;this.camera=q;this.isSelection=k;this.layers=a;this.p0=c;this.p1=f;this.hudResults=[];null==n&&(n=1E-5);this.tolerance=n;if(this.layers)for(a=0;a<this.layers.length;++a)if(c=this.layers[a],f=c.getSpatialQueryAccelerator?
c.getSpatialQueryAccelerator():void 0)f.forEachAlongRay(this.p0,this.dir,this.intersectObject);else for(c=c.getObjects(),f=0;f<c.length;++f)this.intersectObject(c[f])};Object.defineProperty(a.prototype,"transformInverse",{get:function(){return this._transformInverse.value},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"transformInverseTranspose",{get:function(){return this._transformInverseTranspose.value},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"transformInverseRotation",
{get:function(){return this._transformInverseRotation.value},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"transformTranspose",{get:function(){return this._transformTranspose.value},enumerable:!0,configurable:!0});a.prototype.getDirection=function(){this.normalDir||(this.normalDir=b.vec3d.create(),b.vec3d.normalize(this.dir,this.normalDir));return this.normalDir};a.prototype.intersectObject=function(a){var c=this;this.numObjectsTested++;for(var l=a.getId(),q=a.getGeometryRecords(),
k=a.objectTransformation,y,r=0;r<q.length;r++){var p=q[r],z=p.geometry,A=p.materials,J=p.instanceParameters;y=z.getId();b.mat4d.set(k,this.transform);b.mat4d.multiply(this.transform,p.getShaderTransformation());this._transformInverse.invalidate();this._transformInverseTranspose.invalidate();this._transformTranspose.invalidate();this._transformInverseRotation.invalidate();b.mat4d.multiplyVec3(this.transformInverse,this.p0,t);b.mat4d.multiplyVec3(this.transformInverse,this.p1,n);A[0].intersect(z,J,
this.transform,this,t,n,function(b,p,q,n,k,t){0<=b&&(k?(k=new f,k.init(c.p0,c.p1),k.set(a,l,b,p,n,t,y,q),c.hudResults.push(k)):((null==c.minResult.priority||n>=c.minResult.priority)&&(null==c.minResult.dist||b<c.minResult.dist)&&c.minResult.set(a,l,b,p,n,null,y,q),(null==c.maxResult.priority||n>=c.maxResult.priority)&&(null==c.maxResult.dist||b>c.maxResult.dist)&&c.maxResult.set(a,l,b,p,n,null,y,q)))},p.customTransformation)}};a.prototype.getMinResult=function(){return this.minResult};a.prototype.getMaxResult=
function(){return this.maxResult};a.prototype.getHudResults=function(){return this.hudResults};a.DEFAULT_TOLERANCE=1E-5;return a}();var f=function(){function a(a,c){this.normal=b.vec3d.create();this.init(a,c)}a.prototype.getIntersectionPoint=function(a){if(null==this.dist)return!1;b.vec3d.lerp(this.p0,this.p1,this.dist,a);return!0};a.prototype.set=function(a,f,l,q,n,k,t,p){this.dist=l;b.vec3d.set(q,this.normal);this.targetType=a?a instanceof c?"StageObject":"StagePoint":"None";this.target=a;this.name=
f;this.priority=n;this.center=k?b.vec3d.create(k):null;this.geometryId=t;this.triangleNr=p};a.prototype.copyFrom=function(a){this.p0=a.p0;this.p1=a.p1;this.dist=a.dist;this.targetType=a.targetType;this.target=a.target;this.name=a.name;this.priority=a.priority;this.center=a.center?b.vec3d.create(a.center):null;this.geometryId=a.geometryId;this.triangleNr=a.triangleNr;this.intersector=a.intersector;b.vec3d.set(a.normal,this.normal)};a.prototype.setIntersector=function(a){this.intersector=a};a.prototype.init=
function(a,b){this.dist=void 0;this.targetType="None";this.priority=this.name=this.target=void 0;this.triangleNr=this.geometryId=this.center=null;this.intersector="stage";this.p0=a;this.p1=b};return a}(),q=function(){function a(a,b,c){this.original=a;this.update=b;this.dirty=!0;this.transform=c()}a.prototype.invalidate=function(){this.dirty=!0};Object.defineProperty(a.prototype,"value",{get:function(){this.dirty&&(this.update(this.original.value,this.transform),this.dirty=!1);return this.transform},
enumerable:!0,configurable:!0});return a}();return x})},"esri/views/3d/webgl-engine/lib/PerformanceTimer":function(){define(["require","exports","./Util"],function(x,r,k){return function(){function a(a){this._filterSampleIndex=0;this._lastTime=NaN;this._numMeasurements=this._totalTime=0;this._filterSamples=Array(a);this.reset();this._filterSize=a}a.prototype.reset=function(){for(var a=this._filterSampleIndex=0;a<this._filterSize;a++)this._filterSamples[a]=NaN};a.prototype.start=function(){this._tsStart=
k.performance.now()};a.prototype.stop=function(){this._lastTime=k.performance.now()-this._tsStart;this._totalTime+=this._lastTime;this._numMeasurements++;this._filterSize&&(this._filterSamples[this._filterSampleIndex]=this._lastTime,this._filterSampleIndex=(this._filterSampleIndex+1)%this._filterSize);return this._lastTime};a.prototype.getLast=function(){return this._lastTime};a.prototype.getLastFiltered=function(){for(var a=0,c=0;c<this._filterSamples.length;c++)a+=this._filterSamples[c];return a/
this._filterSamples.length};a.prototype.getAverage=function(){return this._totalTime/this._numMeasurements};a.prototype.getTotal=function(){return this._totalTime};a.prototype.getNumMeasurements=function(){return this._numMeasurements};return a}()})},"esri/views/3d/webgl-engine/lib/Object3D":function(){define("require exports ./IdGen ./Util ./gl-matrix ./ComponentUtils ./HighlightUtils ./ModelContentType ./GeometryRecord".split(" "),function(x,r,k,a,b,c,t,n,f){var q=a.assert,l=b.mat4d,y=b.vec3d,B=
l.identity();x=function(){function a(b){void 0===b&&(b={});this._bvObjectSpace=new v;this._bvWorldSpace=new v;this._bvDirty=!0;this._hasVolatileTransformation=!1;this.id=a._idGen.gen(b.idHint);this.name=b.name;this.castShadow=null!=b.castShadow?b.castShadow:!0;this.metadata=b.metadata;this.objectTransformation=l.identity();this._initializeGeometryRecords(b.geometries,b.materials,b.transformations)}a.prototype._initializeGeometryRecords=function(a,b,c){if(Array.isArray(a)){q(b.length===a.length,"Object3D: materials don't match geometries");
q(c.length===a.length,"Object3D: transformations don't match geometries");this.geometryRecords=Array(a.length);this.geometries=a.slice();for(var p=0;p<a.length;p++)q(Array.isArray(b[p]),"Object3D: materials parameter must be array of array"),this.geometryRecords[p]=new f(a[p],b[p].slice(),l.create(c[p]),{});this._hasVolatileTransformation=!1}else this.geometryRecords=[],this.geometries=[]};a.prototype.getId=function(){return this.id};Object.defineProperty(a.prototype,"parentLayer",{get:function(){return this._parentLayer},
set:function(a){q(null==this._parentLayer||null==a,"Object3D can only be added to a single Layer");this._parentLayer=a},enumerable:!0,configurable:!0});a.prototype.getParentLayer=function(){return this.parentLayer};a.prototype.addParentLayer=function(a){this.parentLayer=a};a.prototype.removeParentLayer=function(a){this.parentLayer=null};a.prototype.getNumGeometryRecords=function(){return this.geometryRecords.length};a.prototype.getFirstGeometryIndex=function(a){a=this.geometries.indexOf(a);q(-1<a,
"Object3D.getFirstGeometryIndex: geometry not found");return a};a.prototype.findGeometryRecords=function(a){for(var b=[],c=0;c<this.geometries.length;c++)this.geometries[c]===a&&b.push(this.geometryRecords[c]);return b};a.prototype.getGeometryRecord=function(a){q(0<=a&&a<this.geometryRecords.length,"Object3d.getGeometryDataByIndex: index out of range");return this.geometryRecords[a]};a.prototype.getGeometryRecords=function(){return this.geometryRecords};a.prototype.addGeometry=function(a,b,c,p,n,
k){void 0===c&&(c=B);q(Array.isArray(b),"Object3D.addGeometry: materials must be array");this.geometries.push(a);a=new f(a,b.slice(),l.create(c),p||{},n,k);this.geometryRecords.push(a);this._hasVolatileTransformation=this.geometryRecords.some(function(a){return!!a.customTransformation});this._notifyDirty("objGeometryAdded",a);this._invalidateBoundingVolume();return a};a.prototype.hasGeometry=function(a){return-1<this.geometries.indexOf(a)};a.prototype.removeGeometry=function(a){var b=this.geometryRecords.splice(a,
1)[0];this._hasVolatileTransformation=this.geometryRecords.some(function(a){return!!a.customTransformation});this.geometries.splice(a,1);this._notifyDirty("objGeometryRemoved",b);this._invalidateBoundingVolume();return b};a.prototype.removeAllGeometries=function(){for(;0<this.getNumGeometryRecords();)this.removeGeometry(0)};a.prototype.geometryVertexAttrsUpdated=function(a){this._notifyDirty("vertexAttrsUpdated",this.geometryRecords[a]);this._invalidateBoundingVolume()};a.prototype.geometryColorAttrsUpdated=
function(a){this._notifyDirty("colorAttrsUpdated",this.geometryRecords[a])};a.prototype.isAllHidden=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var f=b[a],p=f.instanceParameters.componentVisibilities,f=f.geometry.getData().componentOffsets;if(!c.isAllHidden(p,f))return!1}return!0};a.prototype.isAllVisible=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var f=b[a],p=f.instanceParameters.componentVisibilities,f=f.geometry.getData().componentOffsets;if(!c.isAllVisible(p,
f))return!1}return!0};a.prototype.hasComponents=function(){for(var a=!1,b=0;b<this.geometries.length&&!(a=this.geometries[b].getData(),a=c.hasComponents(a.componentOffsets));b++);return a};a.prototype.setComponentVisibility=function(a,b,f){var p=a.instanceParameters.componentVisibilities,l=a.geometry.getData().componentOffsets;b=c.updateVisibility(p,l,b,f);a.instanceParameters.componentVisibilities=b;this._notifyDirty("componentVisibilityChanged",a)};a.prototype.getComponentVisibility=function(a,
b){return c.getVisibility(a.instanceParameters.componentVisibilities,b)};a.prototype.hideAllComponents=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var f=b[a],p=c.hideAllComponents(f.instanceParameters.componentVisibilities);f.instanceParameters.componentVisibilities=p}this._notifyDirty("componentVisibilityChanged")};a.prototype.unhideAllComponents=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var f=b[a],p=c.unhideAllComponents(f.instanceParameters.componentVisibilities);
f.instanceParameters.componentVisibilities=p}this._notifyDirty("componentVisibilityChanged")};a.prototype._setComponentHighlight=function(a,b,f,p){b=c.addHighlight(a.instanceParameters.componentHighlights,b,f,p);a.instanceParameters.componentHighlights=b};a.prototype.setComponentHighlight=function(a,b,c){var f=t.generateHighlightId();this._setComponentHighlight(a,b,c,f);this._notifyDirty("componentHighlightChanged");return f};a.prototype.highlightAllComponents=function(a){for(var b=t.generateHighlightId(),
c=0,f=this.geometryRecords;c<f.length;c++)this._setComponentHighlight(f[c],null,a,b);this._notifyDirty("componentHighlightChanged");return b};a.prototype.removeHighlights=function(a){for(var b=0,f=this.geometryRecords;b<f.length;b++){var p=f[b].instanceParameters,l=c.removeHighlight(p.componentHighlights,a);p.componentHighlights=l}this._notifyDirty("componentHighlightChanged")};a.prototype.getComponentFromTriangleNr=function(a,b){q(0<=a&&a<this.geometryRecords.length,"Object3d.getComponentFromTriangleNr: index out of range");
a=this.geometryRecords[a].geometry.getData().componentOffsets;return c.componentFind(a,3*b)};a.prototype.setGeometryTransformation=function(a,b){q(0<=a&&a<this.geometryRecords.length,"Object3d.setGeometryTransformation: index out of range");var c=this.geometryRecords[a];b=new f(c.geometry,c.materials,l.create(b),c.instanceParameters);this.geometryRecords[a]=b;this._notifyDirty("objGeometryReplaced",[c,b]);this._invalidateBoundingVolume()};a.prototype.getObjectTransformation=function(){return l.create(this.objectTransformation)};
a.prototype.setObjectTransformation=function(a){l.set(a,this.objectTransformation);this._invalidateBoundingVolume();this._notifyDirty("objTransformation")};a.prototype.getCombinedStaticTransformation=function(a,b){b=b||l.create();l.multiply(this.objectTransformation,a.getStaticTransformation(),b);return b};a.prototype.getCombinedShaderTransformation=function(a,b){b=b||l.create();l.multiply(this.objectTransformation,a.getShaderTransformation(),b);return b};a.prototype.hasVolativeTransformation=function(){return this._hasVolatileTransformation};
a.prototype.getCastShadow=function(){return this.castShadow};a.prototype.setCastShadow=function(a){this.castShadow=a};a.prototype.getMetadata=function(){return this.metadata};a.prototype.getName=function(){return this.name};a.prototype.getBBMin=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bbMin:this._bvWorldSpace.bbMin};a.prototype.getBBMax=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bbMax:this._bvWorldSpace.bbMax};a.prototype.getCenter=function(a){this._validateBoundingVolume();
return a?this._bvObjectSpace.center:this._bvWorldSpace.center};a.prototype.getBSRadius=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bsRadius:this._bvWorldSpace.bsRadius};a.prototype._validateBoundingVolume=function(){if(this._bvDirty||this._hasVolatileTransformation){this._bvObjectSpace.init();this._bvWorldSpace.init();for(var a=0;a<this.geometryRecords.length;++a){var b=this.geometries[a],c=this.geometryRecords[a],b=b.getBoundingInfo();this._calculateTransformedBoundingVolume(b,
this._bvObjectSpace,c.getShaderTransformation());this._calculateTransformedBoundingVolume(b,this._bvWorldSpace,this.getCombinedShaderTransformation(c))}y.lerp(this._bvObjectSpace.bbMin,this._bvObjectSpace.bbMax,.5,this._bvObjectSpace.center);y.lerp(this._bvWorldSpace.bbMin,this._bvWorldSpace.bbMax,.5,this._bvWorldSpace.center);for(var c=y.create(),f=y.create(),q=this._getScaleFactor(this.objectTransformation),a=0;a<this.geometryRecords.length;++a){var b=this.geometries[a],n=this.geometryRecords[a].getShaderTransformation(),
k=this._getScaleFactor(n),b=b.getBoundingInfo();l.multiplyVec3(n,b.getCenter(),c);n=y.dist(c,this._bvObjectSpace.center);b=b.getBSRadius()*k;this._bvObjectSpace.bsRadius=Math.max(this._bvObjectSpace.bsRadius,n+b);l.multiplyVec3(this.objectTransformation,c,f);k=y.dist(f,this._bvWorldSpace.center);this._bvWorldSpace.bsRadius=Math.max(this._bvWorldSpace.bsRadius,k+b*q)}this._bvDirty=!1}};a.prototype._calculateTransformedBoundingVolume=function(a,b,c){var f=a.getBBMin();a=a.getBBMax();for(var q=y.create(),
n=y.create(),k=-1;3>k;++k){y.set(f,q);y.set(a,n);-1<k&&(q[k]=a[k],n[k]=f[k]);l.multiplyVec3(c,q);l.multiplyVec3(c,n);for(var t=0;3>t;++t)b.bbMin[t]=Math.min(b.bbMin[t],q[t],n[t]),b.bbMax[t]=Math.max(b.bbMax[t],q[t],n[t])}};a.prototype._getScaleFactor=function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))};a.prototype._invalidateBoundingVolume=function(){this._bvDirty=!0;this._parentLayer&&
this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace)};a.prototype._notifyDirty=function(a,b,c,f){this._parentLayer&&(c=c||n.OBJECT,this._parentLayer.notifyDirty(a,b,c,f||this))};a._idGen=new k;return a}();var v=function(){function a(){this.bbMin=y.create();this.bbMax=y.create();this.center=y.create();this.bsRadius=0}a.prototype.init=function(){y.set3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,this.bbMin);y.set3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,this.bbMax);
y.set3(0,0,0,this.center);this.bsRadius=0};a.prototype.getCenter=function(){return this.center};a.prototype.getBSRadius=function(){return this.bsRadius};return a}();return x})},"esri/views/3d/webgl-engine/lib/IdGen":function(){define(["require","exports"],function(x,r){return function(){function k(){this._count=0}k.prototype.gen=function(a){null==a&&(a="a");return a+"_"+this._count++};return k}()})},"esri/views/3d/webgl-engine/lib/ComponentUtils":function(){define(["require","exports","../../../../core/arrayUtils"],
function(x,r,k){function a(a,b){if(null!=a){var c=a.isVisibleBit,f=a.data,l=8*f.BYTES_PER_ELEMENT;return b<f.length*l?B(c,f,b,l):!a.isVisibleBit}return!0}function b(a){return null===a.component?-1:a.component}function c(b,c,f,l,q){a(c,l)&&t(b,c,f,f[l],f[l+1]-1,q)}function t(a,b,c,f,l,q){c=(b=0<a.length?a[a.length-1]:null)?b.range[1]:-1;var p=b?b.options:null;c>=f||(c+1===f&&p===q?b.range[1]=l:a.push({range:[f,l],options:q}))}function n(a){void 0===a&&(a=!0);return{isVisibleBit:!a,data:new Uint32Array(0)}}
function f(a,b){return l(a,b,!0)}function q(a,b){return l(a,b,!1)}function l(a,b,c){var f=!1;a=a||w;f=a.isVisibleBit;a=a.data;b=v(b);var p=8*a.BYTES_PER_ELEMENT,l=a.length*p;c=c===f;if(0===a.length||0===b)f=!c;else if(l<b&&!c)f=!0;else{for(var q=D[p],l=D[0],n=0;n<a.length-1;n++)if(f=!c&&a[n]!==q||c&&a[n]!==l)return f;f=a.length-1;b=D[(b-1)%p+1];f=!c&&(a[f]&b)!==b||c&&(a[f]&b)!==l}return f}function y(a){return 0<a.length}function B(a,b,c,f){var p=c/f|0;return 0!==(b[p]&1<<c-p*f)===a}function v(a){return Math.max(0,
a.length-1)}Object.defineProperty(r,"__esModule",{value:!0});r.updateVisibility=function(a,b,c,f){if(c<v(b)){null==a&&(a=n());var p=a.isVisibleBit,l=a.data,q=8*l.BYTES_PER_ELEMENT,k=c/q|0,t=c-q*k;b=(v(b)-1)/q|0;var w=l;f=f===p;c<w.length*q||!f||(c=Math.max(k+1,Math.ceil(1.5*w.length)),c=Math.min(c,b+1),l=new Uint32Array(c),l.set(w));k<l.length&&(l[k]=l[k]&~(1<<t)|(f?1:0)<<t);a.data=l}return a};r.getVisibility=a;r.hideAllComponents=function(a){if(null==a)a=n(!1);else{a.isVisibleBit=!0;for(var b=0;b<
a.data.length;b++)a.data[b]=0}return a};r.unhideAllComponents=function(a){var b;if(null!=a)for(b=a,b.isVisibleBit=!1,a=0;a<b.data.length;a++)b.data[a]=0;return b};r.generateVisibleIndexRanges=function(a,b){var c;if(a)if(y(b))if(0===a.data.length)c=[],b=[[b[0],b[b.length-1]-1]],c=a.isVisibleBit?c:b;else{c=[];for(var f=a.isVisibleBit,l=a.data,q=8*l.BYTES_PER_ELEMENT,n=l.length*q,k=v(b),t=!1,w=0;w<n&&w<k;w++){var D=B(f,l,w,q);if(D!==t){var F=b[w];D?c.push([F,0]):(t=c[c.length-1],t[1]=F-1);t=D}}a=!a.isVisibleBit;
k>n&&a&&!t?c.push([b[n],b[k]-1]):t&&(t=c[c.length-1],t[1]=b[a?k:Math.min(k,n)]-1)}else c=[],c=a.isVisibleBit?c:null;else c=null;return c};r.addHighlight=function(a,c,f,l){a=a||[];c={component:c,options:f,id:l};a.push(c);c=b(c);for(f=a.length-1;0<f&&c<b(a[f-1]);)l=[a[f],a[f-1]],a[f-1]=l[0],a[f]=l[1],--f;return a};r.removeHighlight=function(a,b){return a?(a=a.filter(function(a){return a.id!==b}),0===a.length?null:a):a};r.generateHighlightedIndexRanges=function(a,b,f){if(b){if(y(f)){for(var p=f[0],l=
f[f.length-1]-1,n=[],k=!q(a,f),w=0;w<b.length;++w){var B=b[w].options,D=b[w].component;if(null!==D)c(n,a,f,D,B);else if(k)t(n,a,f,p,l,B);else for(D=0;D<v(f);++D)c(n,a,f,D,B)}return 0<n.length?n:null}var k=!a||!a.isVisibleBit;return k?b.map(function(a){return{range:null,options:a.options}}):null}return null};r.defaultVisibilities=n;r.isAllVisible=function(a,b){return!q(a,b)};r.isAllHidden=function(a,b){return!f(a,b)};r.hasVisible=f;r.hasHidden=q;var w=n();r.createOffsets=function(a){return Array.isArray(a)?
new Uint32Array(a):a};r.hasComponent=function(a,b){return b<v(a)};r.hasComponents=y;var D=[];for(x=0;65>x;x++)D.push(Math.pow(2,x)-1);r.componentCount=v;r.componentFind=function(a,b){a=k.binaryIndexOf(a,b,!0);return 0<=a?a:null}})},"esri/views/3d/webgl-engine/lib/HighlightUtils":function(){define(["require","exports","./IdGen"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});var a=new k;r.generateHighlightId=function(){return a.gen("highlight")}})},"esri/views/3d/webgl-engine/lib/ModelContentType":function(){define(["require",
"exports"],function(x,r){return function(){function k(){}k.LAYER="layers";k.OBJECT="objects";k.GEOMETRY="geometries";k.MATERIAL="materials";k.TEXTURE="textures";return k}()})},"esri/views/3d/webgl-engine/lib/GeometryRecord":function(){define(["require","exports","./IdGen"],function(x,r,k){return function(){function a(b,c,k,n,f,q){this.id=a._idGen.gen(b.getId());this.geometry=b;this.materials=c;this.transformation=k;this.instanceParameters=n;this.origin=f;this.customTransformation=q}a.prototype.getId=
function(){return this.id};a.prototype.getStaticTransformation=function(){return this.transformation};a.prototype.getShaderTransformation=function(){return this.customTransformation?this.customTransformation(this.transformation):this.transformation};a._idGen=new k;return a}()})},"esri/views/3d/support/viewpointUtils":function(){define("require exports ../../../geometry/SpatialReference ../../../geometry/Point ../../../geometry/Extent ../../../geometry/Geometry ../../../geometry/support/webMercatorUtils ../../../core/Error ../../../core/promiseUtils ../../../Camera ../../../Viewpoint ../../../Graphic ../lib/glMatrix ./mathUtils ./projectionUtils ../camera/intersectionUtils ./cameraUtils ./aaBoundingBox ./aaBoundingRect ./intersectionUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z){function A(a){return 360-v.cyclicalDeg.normalize(a)}function J(a){return v.cyclicalDeg.normalize(360-a)}function I(a,d,e){if(!d)return null;var b=a.spatialReference||k.WGS84;if(d.camera){a=d.get("camera.position.spatialReference");if(!t.canProject(a,b))return null;d=d.camera.clone();a.equals(b)||(d.position=t.project(d.position,b));return d}var c=d.get("targetGeometry.spatialReference");if(c&&!t.canProject(c,b))return null;var c=F.internalToExternal(a,
a.state.camera),g={noReset:!1};null!=d.rotation&&(c.heading=A(d.rotation),g.noReset=!0);null!=e&&(c.tilt=e);if("point"===d.targetGeometry.type){e=d.targetGeometry;var h=void 0,f=d.targetGeometry.clone(),h=null!=d.scale?F.scaleToDistance(a,d.scale,e.latitude):a.state.camera.distance;d=F.eyeHeadingTiltForCenterPointAtDistance(a,c.heading,c.tilt,f,h,g);b=w.vectorToPoint(d.eye,a.renderSpatialReference,b);return new q(b,d.heading,d.tilt,c.fov)}return F.fromExtent(a,d.targetGeometry.extent,c.heading,c.tilt,
g)}function K(a,d,e){d=e.scale;null==d&&null!=e.zoom&&(d=F.zoomToScale(a,e.zoom));return d}function L(a,d){var e=!1;null!=d.heading?(a.heading=d.heading,e=!0):null!=d.rotation&&(a.heading=A(d.rotation),e=!0);null!=d.tilt&&(a.tilt=d.tilt,e=!0);null!=d.fov&&(a.fov=d.fov);return e}function O(a,d,e){var b=a.spatialReference||k.WGS84;d=d||F.externalToInternal(a,e.camera);e.targetGeometry=w.vectorToPoint(d.center,a.renderSpatialReference,b);e.scale=F.computeScale(a,d);e.rotation=J(e.camera.heading);return e}
function P(a,d,e){if(d){if(!t.canProject(d.spatialReference,a.spatialReference))throw new n("viewpointutils:incompatible-spatialreference","Spatial reference ("+(d.spatialReference?d.spatialReference.wkid:"unknown")+") is incompatible with the view ("+a.spatialReference.wkid+")",{geometry:d});var b=[];if(!d.hasZ&&a.basemapTerrain){var c=void 0;(c="point"===d.type?d:"multipoint"===d.type||"polyline"===d.type?d.extent.center:"extent"===d.type?d.center:d.centroid)&&t.canProject(c,a.basemapTerrain.spatialReference)?
Q[2]=a.basemapTerrain.getElevation(c)||0:Q[2]=0}(0,da[d.type])(d,function(a){b.push(a[0],a[1],a[2])},Q);var g=b.length/3;if(0!==g&&(c=Array(b.length),w.bufferToBuffer(b,d.spatialReference,0,c,a.spatialReference,0,g)))for(d.hasZ&&(e.hasZ=!0),a=0;a<c.length;a+=3)d.hasZ?(Q[0]=c[a+0],Q[1]=c[a+1],Q[2]=c[a+2]):(Q[0]=c[a+0],Q[1]=c[a+1]),G.expand(e.boundingBox,Q)}}function U(a,d,e){return a.whenViewForGraphic(d).then(function(a){if(a&&a.whenGraphicBounds)return a.whenGraphicBounds(d)}).then(function(a){var d=
a.boundingBox;G.expand(e.boundingBox,d);a.screenSpaceObjects&&a.screenSpaceObjects.forEach(function(a){e.screenSpaceObjects.push(a)});isFinite(d[2])&&(e.hasZ=!0)}).otherwise(function(){P(a,d.geometry,e)})}function N(a,d,e){if(Array.isArray(d)&&2===d.length){var b=d[0],g=d[1];if("number"===typeof b&&"number"===typeof g)return W.x=b,W.y=g,W.z=void 0,W.spatialReference=k.WGS84,P(a,W,e),f.resolve()}if(d&&"function"===typeof d.map)return f.eachAlways(d.map(function(d){return N(a,d,e)}));if(d instanceof
c)try{P(a,d,e)}catch(la){return f.reject(la)}else if(d instanceof y)return U(a,d,e);return f.resolve()}function R(a,d,e,b){if(d.camera)return S(a,e,d.camera,b);b.scale=d.scale;b.rotation=d.rotation;b.targetGeometry=d.targetGeometry?d.targetGeometry.clone():null;b.camera=null;null!=e.heading?b.rotation=J(e.heading):null!=e.rotation&&(b.rotation=e.rotation);d=K(a,b.targetGeometry,e);null!=d&&(b.scale=d);b.camera=I(a,b,e.tilt);return b}function S(a,d,e,b){b.camera=e.clone();b.camera.fov=a.camera.fov;
d=a.spatialReference;e=b.camera.position.spatialReference;if(!t.canProject(e,d))return null;e.equals(d)||(b.camera.position=t.project(b.camera.position,d));return O(a,null,b)}function T(d,e,b,c){if(!b)return null;c.targetGeometry=b.clone();var g=D.cameraOnContentAlongViewDirection(d);if(e.position){b=c.targetGeometry;var h=d.renderSpatialReference;w.pointToVector(e.position,C,h);w.pointToVector(b,M,h);c.targetGeometry=new a(b);c.camera.position=new a(e.position);B.vec3d.subtract(M,C,u);F.directionToHeadingTilt(d,
C,u,g.up,c.camera);c.scale=F.distanceToScale(d,B.vec3d.dist(C,M),c.targetGeometry.latitude);c.rotation=J(c.camera.heading);return c}if(e.zoomFactor){var h=g.distance/e.zoomFactor,f=B.vec3d.scale(g.viewForward,-h,Q);B.vec3d.add(g.center,f,g.eye);g.markViewDirty();c.scale=F.distanceToScale(d,h,b.latitude)}F.internalToExternal(d,g,c.camera);h={noReset:!1};L(c.camera,e)&&(h.noReset=!0);return e.zoomFactor||(c.scale=K(d,c.targetGeometry,e),null==c.scale&&(w.pointToVector(b,Q,d.renderSpatialReference),
z.frustumPoint(g.frustumPlanes,Q)?c.scale=F.distanceToScale(d,B.vec3d.dist(g.eye,Q),b.latitude):c.scale=F.computeScale(d,g)),F.fromCenterScale(d,c.targetGeometry,c.scale,c.camera,h,c.camera))?c:null}function V(a,d,e,b){b.targetGeometry=e.clone();var c=D.cameraOnContentAlongViewDirection(a);F.internalToExternal(a,c,b.camera);c={noReset:!1};L(b.camera,d)&&(c.noReset=!0);return F.fromExtent(a,e,b.camera.heading,b.camera.tilt,c,b.camera)?b:null}function h(a,d){if(!d||!a.spatialReference)return null;a=
{target:null};if("declaredClass"in d||Array.isArray(d))a.target=d;else{for(var e in d)a[e]=d[e];d.center&&!a.target&&(a.target=d.center)}return a}function ca(a){a&&(a.rotation=J(a.camera.heading));return f.resolve(a)}Object.defineProperty(r,"__esModule",{value:!0});r.DEFAULT_FRAME_COVERAGE=.66;r.rotationToHeading=A;r.headingToRotation=J;r.toCamera=I;r.fromInternalCamera=function(a,d,e){e||(e=new l({camera:new q}));F.internalToExternal(a,d,e.camera);return O(a,d,e)};r.fromCamera=function(a,d,e){e||
(e=new l);e.camera=d.clone();return O(a,null,e)};r.create=function(c,k){var t=h(c,k);if(!t)return f.reject(new n("viewpointutils-create:no-target","Missing target for creating viewpoint"));var v=new l({camera:new q({fov:c.camera.fov})}),y=null!=t.scale||null!=t.zoom;if(t.target instanceof l)return ca(R(c,t.target,t,v));if(t.target instanceof q)return ca(S(c,t,t.target,v));if(t.target instanceof b)return k=t.target.xmin===t.target.xmax||t.target.ymin===t.target.ymax,y||k?ca(T(c,t,t.target.center,v)):
ca(V(c,t,t.target,v));var z={boundingBox:G.create(G.NEGATIVE_INFINITY),spatialReference:c.spatialReference,hasZ:!1,screenSpaceObjects:[]};return N(c,t.target,z).then(function(){if(isFinite(z.boundingBox[0])){G.center(z.boundingBox,Q);W.x=Q[0];W.y=Q[1];W.z=Q[2];W.spatialReference=c.spatialReference;var b=void 0;isFinite(W.z)&&z.hasZ?b=G.isPoint(z.boundingBox):(W.z=void 0,b=p.isPoint(G.toRect(z.boundingBox,m)));if(y||b)return T(c,t,W,v);var h=W,b=z.boundingBox,f;f=z.screenSpaceObjects;var l=r.DEFAULT_FRAME_COVERAGE;
if(f.length){for(var q=Number.NEGATIVE_INFINITY,n=0;n<f.length;n++)var k=f[n].screenSpaceBoundingRect,q=Math.max(q,Math.abs(k[0]),Math.abs(k[1]),Math.abs(k[2]),Math.abs(k[3]));f=l-q/Math.min(c.width,c.height)*2}else f=l;l=f;v.targetGeometry=h.clone();f=D.cameraOnContentAlongViewDirection(c);q=0;h.hasZ?q=h.z:c.basemapTerrain&&(q=c.basemapTerrain.getElevation(h));B.vec3d.set3(h.x,h.y,q,Q);w.computeLinearTransformation(c.spatialReference,Q,e,c.renderSpatialReference);B.mat4d.toMat3(e,d);B.mat3d.transpose(d);
G.set(g,G.NEGATIVE_INFINITY);h=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(n=0;n<h.length;n++){var k=h[n],A=b[k[2]];isFinite(A)||(A=q);B.vec3d.set3(b[k[0]],b[k[1]],A,Q);w.vectorToVector(Q,c.spatialReference,Q,c.renderSpatialReference);G.expand(g,B.mat3d.multiplyVec3(d,Q))}b=G.width(g);h=G.height(g);q=G.depth(g);n=1/Math.tan(f.fovY/2);b=Math.max(.5*Math.sqrt(b*b+q*q)*Math.max(n,1/Math.tan(f.fovX/2))+.5*h,.5*h*n+.5*Math.max(b,q))/l;F.internalToExternal(c,f,v.camera);f={noReset:!1};
L(v.camera,t)&&(f.noReset=!0);v.scale=F.distanceToScale(c,b,v.targetGeometry.latitude);b=F.fromCenterScale(c,v.targetGeometry,v.scale,v.camera,f,v.camera)?v:null;return b}if(t.position)return b=D.cameraOnContentAlongViewDirection(c),B.vec3d.set(b.viewForward,u),F.directionToHeadingTilt(c,b.eye,u,b.up,Y),v.camera.position=new a(t.position),v.camera.heading=null!=t.heading?t.heading:Y.heading,v.camera.tilt=null!=t.tilt?t.tilt:Y.tilt,O(c,null,v);b=D.cameraOnContentAlongViewDirection(c);b=w.vectorToPoint(b.center,
c.renderSpatialReference,W,c.spatialReference);return T(c,t,b,v)}).then(function(a){return ca(a)})};var Q=B.vec3d.create(),e=B.mat4d.create(),d=B.mat3d.create(),g=G.create(),m=p.create(),u=B.vec3d.create(),C=B.vec3d.create(),M=B.vec3d.create(),Y={heading:0,tilt:0},W=new a,da={point:function(a,d,e){e[0]=a.x;e[1]=a.y;a.hasZ&&(e[2]=a.z);d(e)},polygon:function(a,d,e){for(var b=a.hasZ,c=0;c<a.rings.length;c++)for(var g=a.rings[c],h=0;h<g.length;h++)e[0]=g[h][0],e[1]=g[h][1],b&&(e[2]=g[h][2]),d(e)},polyline:function(a,
d,e){for(var b=a.hasZ,c=0;c<a.paths.length;c++)for(var g=a.paths[c],h=0;h<g.length;h++)e[0]=g[h][0],e[1]=g[h][1],b&&(e[2]=g[h][2]),d(e)},multipoint:function(a,d,e){var b=a.points;a=a.hasZ;for(var c=0;c<b.length;c++)e[0]=b[c][0],e[1]=b[c][1],a&&(e[2]=b[c][2]),d(e)},extent:function(a,d,e){a.hasZ?(d(B.vec3d.set3(a.xmin,a.ymin,a.zmin,e)),d(B.vec3d.set3(a.xmax,a.ymin,a.zmin,e)),d(B.vec3d.set3(a.xmin,a.ymax,a.zmin,e)),d(B.vec3d.set3(a.xmax,a.ymax,a.zmin,e)),d(B.vec3d.set3(a.xmin,a.ymin,a.zmax,e)),d(B.vec3d.set3(a.xmax,
a.ymin,a.zmax,e)),d(B.vec3d.set3(a.xmin,a.ymax,a.zmax,e)),d(B.vec3d.set3(a.xmax,a.ymax,a.zmax,e))):(d(B.vec3d.set3(a.xmin,a.ymin,e[2],e)),d(B.vec3d.set3(a.xmax,a.ymin,e[2],e)),d(B.vec3d.set3(a.xmin,a.ymax,e[2],e)),d(B.vec3d.set3(a.xmax,a.ymax,e[2],e)))}}})},"esri/views/3d/support/aaBoundingBox":function(){define(["require","exports","./aaBoundingRect","../../../geometry/Extent"],function(x,r,k,a){function b(a){return a[0]>=a[3]?0:a[3]-a[0]}function c(a){return a[1]>=a[4]?0:a[4]-a[1]}function t(a){return a[2]>=
a[5]?0:a[5]-a[2]}function n(a){return 6===a.length}Object.defineProperty(r,"__esModule",{value:!0});r.create=function(a){void 0===a&&(a=r.ZERO);return[a[0],a[1],a[2],a[3],a[4],a[5]]};r.fromExtent=function(a){return[a.xmin,a.ymin,a.zmin,a.xmax,a.ymax,a.zmax]};r.toExtent=function(b,c){return isFinite(b[2])||isFinite(b[5])?new a({xmin:b[0],xmax:b[3],ymin:b[1],ymax:b[4],zmin:b[2],zmax:b[5],spatialReference:c}):new a({xmin:b[0],xmax:b[3],ymin:b[1],ymax:b[4],spatialReference:c})};r.fromMinMax=function(a,
b){return[a[0],a[1],a[2],b[0],b[1],b[2]]};r.expand=function(a,b,c){void 0===c&&(c=a);var f=b.declaredClass;"esri.geometry.Extent"===f?(c[0]=Math.min(a[0],b.xmin),c[1]=Math.min(a[1],b.ymin),c[3]=Math.max(a[3],b.xmax),c[4]=Math.max(a[4],b.ymax),b.hasZ&&(c[2]=Math.min(a[2],b.zmin),c[5]=Math.max(a[5],b.zmax))):"esri.geometry.Point"===f?(c[0]=Math.min(a[0],b.x),c[1]=Math.min(a[1],b.y),c[3]=Math.max(a[3],b.x),c[4]=Math.max(a[4],b.y),b.hasZ&&(c[2]=Math.min(a[2],b.z),c[5]=Math.max(a[5],b.z))):n(b)?(c[0]=
Math.min(a[0],b[0]),c[1]=Math.min(a[1],b[1]),c[2]=Math.min(a[2],b[2]),c[3]=Math.max(a[3],b[3]),c[4]=Math.max(a[4],b[4]),c[5]=Math.max(a[5],b[5])):k.is(b)?(c[0]=Math.min(a[0],b[0]),c[1]=Math.min(a[1],b[1]),c[3]=Math.max(a[3],b[2]),c[4]=Math.max(a[4],b[3])):Array.isArray(b)&&(2===b.length?(c[0]=Math.min(a[0],b[0]),c[1]=Math.min(a[1],b[1]),c[3]=Math.max(a[3],b[0]),c[4]=Math.max(a[4],b[1])):3===b.length&&(c[0]=Math.min(a[0],b[0]),c[1]=Math.min(a[1],b[1]),c[2]=Math.min(a[2],b[2]),c[3]=Math.max(a[3],b[0]),
c[4]=Math.max(a[4],b[1]),c[5]=Math.max(a[5],b[2])));return c};r.expandBuffer=function(a,b,c,n,k){void 0===k&&(k=a);var f=a[0],l=a[1],q=a[2],t=a[3],y=a[4];a=a[5];for(var p=0;p<n;p++)f=Math.min(f,b[c+3*p]),l=Math.min(l,b[c+3*p+1]),q=Math.min(q,b[c+3*p+2]),t=Math.max(t,b[c+3*p]),y=Math.max(y,b[c+3*p+1]),a=Math.max(a,b[c+3*p+2]);k[0]=f;k[1]=l;k[2]=q;k[3]=t;k[4]=y;k[5]=a;return k};r.allFinite=function(a){for(var b=0;6>b;b++)if(!isFinite(a[b]))return!1;return!0};r.width=b;r.depth=c;r.height=t;r.center=
function(a,q){void 0===q&&(q=[0,0,0]);q[0]=a[0]+b(a)/2;q[1]=a[1]+c(a)/2;q[2]=a[2]+t(a)/2;return q};r.size=function(a,q){void 0===q&&(q=[0,0,0]);q[0]=b(a);q[1]=c(a);q[2]=t(a);return q};r.containsPoint=function(a,b){return b[0]>=a[0]&&b[1]>=a[1]&&b[2]>=a[2]&&b[0]<=a[3]&&b[1]<=a[4]&&b[2]<=a[5]};r.containsPointWithMargin=function(a,b,c){return b[0]>=a[0]-c&&b[1]>=a[1]-c&&b[2]>=a[2]-c&&b[0]<=a[3]+c&&b[1]<=a[4]+c&&b[2]<=a[5]+c};r.contains=function(a,b){return b[0]>=a[0]&&b[1]>=a[1]&&b[2]>=a[2]&&b[3]<=a[3]&&
b[4]<=a[4]&&b[5]<=a[5]};r.intersects=function(a,b){return Math.max(b[0],a[0])<=Math.min(b[3],a[3])&&Math.max(b[1],a[1])<=Math.min(b[4],a[4])&&Math.max(b[2],a[2])<=Math.min(b[5],a[5])};r.offset=function(a,b,c,n,k){void 0===k&&(k=a);k[0]=a[0]+b;k[1]=a[1]+c;k[2]=a[2]+n;k[3]=a[3]+b;k[4]=a[4]+c;k[5]=a[5]+n;return k};r.setMin=function(a,b,c){void 0===c&&(c=a);c[0]=b[0];c[1]=b[1];c[2]=b[2];c!==a&&(c[3]=a[3],c[4]=a[4],c[5]=a[5]);return c};r.setMax=function(a,b,c){void 0===c&&(c=a);c[3]=b[0];c[4]=b[1];c[5]=
b[2];c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2]);return a};r.set=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];return a};r.toRect=function(a,b){b||(b=k.create());b[0]=a[0];b[1]=a[1];b[2]=a[3];b[3]=a[4];return b};r.fromRect=function(a,b){a[0]=b[0];a[1]=b[1];a[3]=b[2];a[4]=b[3];return a};r.is=n;r.isPoint=function(a){return 0===b(a)&&0===c(a)&&0===t(a)};r.equals=function(a,b,c){if(null==a||null==b)return a===b;if(!n(a)||!n(b))return!1;if(c)for(var f=0;f<a.length;f++){if(!c(a[f],
b[f]))return!1}else for(f=0;f<a.length;f++)if(a[f]!==b[f])return!1;return!0};r.POSITIVE_INFINITY=[-Infinity,-Infinity,-Infinity,Infinity,Infinity,Infinity];r.NEGATIVE_INFINITY=[Infinity,Infinity,Infinity,-Infinity,-Infinity,-Infinity];r.ZERO=[0,0,0,0,0,0]})},"esri/views/3d/support/intersectionUtils":function(){define(["../lib/glMatrix"],function(x){function r(b,c,f,q){q.clip[0]=0;q.clip[1]=f?q.len:Number.MAX_VALUE;for(f=0;f<b.length;f++){var l;var n=b[f],k=c;l=q;var t=a.dot(n,l.dir),k=-a.dot(k,n)-
n[3];0>k&&0<=t?l=!1:-1E-6<t&&1E-6>t?l=!0:!(0>k||0>t)||0>k&&0>t?(k/=t,0<t?k<l.clip[1]&&(l.clip[1]=k):k>l.clip[0]&&(l.clip[0]=k),l=l.clip[0]<=l.clip[1]):l=!0;if(!l)return!1}return!0}function k(c,n,f,q){c?(f&&q&&(b.len=a.dist(n,f)),a.set(c,b.dir)):q?(b.len=a.dist(n,f),a.scale(a.subtract(f,n,b.dir),1/b.len)):a.normalize(a.subtract(f,n,b.dir));return b}var a=x.vec3d;x=x.vec2d;var b={dir:a.create(),len:0,clip:x.create()},c={planeSphere:function(a,b,c){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]<c},frustumSphere:function(a,
b,f){for(var q=0;6>q;q++)if(!c.planeSphere(a[q],b,f))return!1;return!0},frustumRay:function(a,b,c,q){c=k(q,b,c,!1);return r(a,b,null,c)},frustumPoint:function(b,c){for(var f=0;6>f;f++){var q=b[f];if(0>-a.dot(c,q)-q[3])return!1}return!0},frustumLineSegment:function(a,b,c,q){q=k(q,b,c,!0);return r(a,b,c,q)},closestPointOnRay:function(b,c,f,q){f=a.dot(c,a.subtract(f,b,q));a.add(b,a.scale(c,f,q),q);return q}};return c})},"esri/views/3d/camera/constraintUtils":function(){define("require exports ../lib/glMatrix ../../animation/easing ./constraintUtils/common ./constraintUtils/tilt ./constraintUtils/tilt ./constraintUtils/altitude ./constraintUtils/altitude ./constraintUtils/distance ./constraintUtils/distance ./constraintUtils/surfaceCollision ./constraintUtils/surfaceCollision".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){Object.defineProperty(r,"__esModule",{value:!0});r.applyTilt=t.apply;r.tiltError=t.error;r.applyAltitude=f.apply;r.altitudeError=f.error;r.applyDistance=l.apply;r.distanceError=l.error;r.applySurfaceCollision=B.apply;r.applyAll=function(a,c,f,l){void 0===f&&(f=w);void 0===l&&(l=c);var p=!1;l!==c&&l.copyFrom(c);l.markViewDirty();l.computeUp(a.state.mode);for(c=0;c<D;c++){for(var q=0,n=0,k=v;n<k.length;n++){var t=k[n];if(b.hasConstraintType(f.selection,t.type)){var B=
Math.abs(t.error(a,l,f));t.apply(a,l,f)&&(p=!0,q+=B)}}if(0===q)break}c=b.hasConstraintType(f.selection,8);f=4===f.interactionType?1:0;c&&y.apply(a,l,f)&&(p=!0);p&&l.computeUp(a.state.mode);return p};r.pixelDistanceToInteractionFactor=function(b,c){b="number"===typeof b?b:k.vec2d.dist(b,c);return a.inOutCubic(Math.min(1,b/150))};var v=[{type:1,error:function(a,b,f){return c.error(a,b,f)*b.distance},apply:c.apply},{type:2,error:n.error,apply:n.apply},{type:4,error:q.error,apply:q.apply}],w={selection:15,
interactionType:0,interactionFactor:0,interactionStartCamera:null,interactionDirection:null},D=5})},"esri/views/3d/camera/constraintUtils/common":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.hasConstraintType=function(a,c){return 0!==(a&c)};r.adjustRangeForInteraction=function(a,c,k,n,f,q){0!==a&&(k?(q.min=Math.min(q.min,c),q.max=Math.max(q.max,c)):null!=n?(q.min-=Math.max(0,(c-q.min)*(1-
n)),q.max+=Math.max(0,(c-q.max)*(1-n))):f&&(q.min-=Math.max(0,c-q.min-f),q.max+=Math.max(0,c-q.max-f)))};r.defaultApplyOptions={selection:0,interactionType:0,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};r.interactionDirectionTowardsConstraintMinimization=function(b,c,t,n,f){t||(t=c.viewForward);k.vec3d.set(t,f);k.vec3d.scale(f,a.sign(k.vec3d.dot(t,n)));return f}})},"esri/views/3d/camera/constraintUtils/tilt":function(){define("require exports ../../lib/glMatrix ../../support/mathUtils ../../support/earthUtils ../../state/utils/viewUtils ./common".split(" "),
function(x,r,k,a,b,c,t){function n(b,l,q,k){void 0===q&&(q=t.defaultApplyOptions);void 0===k&&(k=t.defaultApplyOptions);if(3===q.interactionType||!b.state.constraints.tilt)return 0;var v=c.viewAngle(b.renderCoordsHelper,l.center,l.eye);l=b.state.constraints.tilt(l.distance,B);if(0!==q.interactionType){var p=q.interactionStartCamera,w=q.interactionFactor,D=l.min,F=l.max,r=n(b,p,t.defaultApplyOptions,q),K=0===r?0:c.viewAngle(b.renderCoordsHelper,p.center,p.eye);l.min=D;l.max=F;2===q.interactionType?
(t.hasConstraintType(q.selection,2)&&f(b,p,l),t.adjustRangeForInteraction(r,K,!0,w,y,l)):t.adjustRangeForInteraction(r,K,!1,w,y,l)}2===k.interactionType&&t.hasConstraintType(k.selection,2)&&f(b,k.interactionStartCamera,l);b=a.clamp(v,l.min,l.max);v-=b;return 1E-6>=Math.abs(v)?0:v}function f(c,f,l){if(!c.state.isLocal){var q=c.state.constraints;if(q.altitude){c=k.vec3d.length2(f.center);var n=Math.sqrt(c);f=f.distance;var p=q.altitude.min+b.earthRadius,q=q.altitude.max+b.earthRadius,p=(p*p-f*f-c)/
(-2*n*f);l.min=Math.max(l.min,Math.min(Math.PI-a.acos((q*q-f*f-c)/(-2*n*f)),l.max));l.max=Math.min(l.max,Math.PI-a.acos(p))}}}Object.defineProperty(r,"__esModule",{value:!0});r.apply=function(a,b,c,f){void 0===c&&(c=t.defaultApplyOptions);void 0===f&&(f=b);b!==f&&f.copyFrom(b);a=n(a,b,c);if(0===a)return!1;k.mat4d.identity(l);k.mat4d.rotate(l,-a,b.viewRight);k.vec3d.subtract(b.center,b.eye,q);k.mat4d.multiplyVec3(l,q);k.vec3d.subtract(b.center,q,f.eye);k.mat4d.multiplyVec3(l,f.up);f.markViewDirty();
return!0};r.error=n;var q=k.vec3d.create(),l=k.mat4d.create(),y=a.deg2rad(5),B={min:0,max:0}})},"esri/views/3d/state/utils/viewUtils":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.viewAngle=function(t,n,f){t.worldUpAtPosition(n,b);k.vec3d.subtract(f,n,c);t=k.vec3d.length(c);return 0===t?0:a.acos(k.vec3d.dot(c,b)/t)};var b=k.vec3d.create(),c=k.vec3d.create()})},"esri/views/3d/camera/constraintUtils/altitude":function(){define("require exports ../../lib/glMatrix ../../support/mathUtils ../../support/intersectionUtils ./common".split(" "),
function(x,r,k,a,b,c){function t(b,l,q){void 0===q&&(q=c.defaultApplyOptions);var n;n=b.state.constraints.altitude;n=b.state.isGlobal&&n?2===q.interactionType&&c.hasConstraintType(q.selection,1)?!1:!0:!1;if(!n)return 0;var k=b.state.constraints.altitude;n=f;n.min=k.min;n.max=k.max;var v=q.interactionType;if(0!==v){var k=n.min,p=n.max,y=q.interactionStartCamera;q=q.interactionFactor;var v=2===v||1===v,w=t(b,y),y=0===w?0:b.renderCoordsHelper.getAltitude(y.eye);n.min=k;n.max=p;c.adjustRangeForInteraction(w,
y,v,q,.05*y,n)}b=b.renderCoordsHelper.getAltitude(l.eye);b=a.clamp(b,n.min,n.max)-b;return 1E-6>=Math.abs(b)?0:b}function n(a,b,c,f){a.renderCoordsHelper.worldUpAtPosition(b.eye,f);k.vec3d.scale(f,c);return f}Object.defineProperty(r,"__esModule",{value:!0});r.apply=function(f,v,w,D){void 0===w&&(w=c.defaultApplyOptions);void 0===D&&(D=v);D!==v&&D.copyFrom(v);var B=t(f,v,w);if(0===B)return!1;var r=f.renderCoordsHelper,p=r.getAltitude(v.eye)+B;f=c.interactionDirectionTowardsConstraintMinimization(f,
v,w.interactionDirection,n(f,v,a.sign(B),l),q);w=k.vec3d.set(v.viewForward,y);r.intersectManifold(v.eye,f,p,D.eye)||r.setAltitude(p,D.eye);b.closestPointOnRay(v.eye,w,v.center,v.center);D.markViewDirty();return!0};r.error=t;var f={min:0,max:0},q=k.vec3d.create(),l=k.vec3d.create(),y=k.vec3d.create()})},"esri/views/3d/camera/constraintUtils/distance":function(){define(["require","exports","../../lib/glMatrix","../../webgl-engine/lib/Util","./common"],function(x,r,k,a,b){function c(a,f,l){void 0===
l&&(l=b.defaultApplyOptions);if(!a.state.isLocal)return 0;var q=a.state.constraints.distance;if(!a.pointsOfInterest.surfaceOrigin.renderLocation||Infinity===q)return 0;t.min=0;t.max=q;var q=t,n=l.interactionType;if(0!==n){var v=q.min,y=q.max,p=l.interactionStartCamera;l=l.interactionFactor;var n=1===n||4===n,B=c(a,p),p=0===B?0:k.vec3d.dist(p.eye,a.pointsOfInterest.surfaceOrigin.renderLocation);q.min=v;q.max=y;b.adjustRangeForInteraction(B,p,n,l,.05*p,q)}a=k.vec3d.dist(f.eye,a.pointsOfInterest.surfaceOrigin.renderLocation);
a=t.max-a;return-1E-6<=a?0:a}Object.defineProperty(r,"__esModule",{value:!0});r.error=c;r.apply=function(t,B,v,w){void 0===v&&(v=b.defaultApplyOptions);void 0===w&&(w=B);w!==B&&w.copyFrom(B);var y=c(t,B,v);if(0===y)return!1;var F=t.pointsOfInterest.surfaceOrigin,y=k.vec3d.dist(B.eye,t.pointsOfInterest.surfaceOrigin.renderLocation)+y,r=k.vec3d.set(B.eye,n);v=b.interactionDirectionTowardsConstraintMinimization(t,B,v.interactionDirection,k.vec3d.direction(t.pointsOfInterest.surfaceOrigin.renderLocation,
B.eye,l),q);return a.raySphere(B.eye,v,F.renderLocation,y,w.eye)?(B=k.vec3d.subtract(w.eye,r,f),k.vec3d.add(w.center,B),w.markViewDirty(),B=t.renderCoordsHelper.getAltitude(w.center),t.renderCoordsHelper.intersectManifold(w.eye,w.viewForward,B,w.center),w.markViewDirty(),!0):!1};var t={min:0,max:0},n=k.vec3d.create(),f=k.vec3d.create(),q=k.vec3d.create(),l=k.vec3d.create()})},"esri/views/3d/camera/constraintUtils/surfaceCollision":function(){define(["require","exports","../intersectionUtils","../../lib/glMatrix"],
function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.apply=function(c,t,n,f){void 0===n&&(n=0);void 0===f&&(f=t);var q=c.state.constraints;t!==f&&f.copyFrom(t);if(!q.collision.enabled)return!1;var l=k.surfaceElevationBelowEye(c,t);t=c.renderCoordsHelper.getAltitude(t.eye);q=q.collision.elevationMargin;if(t-l>=q)return!1;a.vec3d.subtract(f.center,f.eye,b);c.renderCoordsHelper.setAltitude(l+q,f.eye);1===n&&a.vec3d.add(f.eye,b,f.center);f.markViewDirty();return!0};var b=a.vec3d.create()})},
"esri/views/3d/state/Frustum":function(){define(["require","exports","../lib/glMatrix","../support/earthUtils","../webgl-engine/lib/Util"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function c(){this.planes=Array(6);this.points=Array(8);this.lines=Array(12);this.origin=k.vec3d.create();this.direction=k.vec3d.create();this._altitude=null;for(var a=0;6>a;a++)this.planes[a]=k.vec4d.create();for(a=0;8>a;a++)this.points[a]=k.vec3d.create();for(a=0;12>a;a++)this.lines[a]=
{origin:null,direction:k.vec3d.create(),endpoint:null}}c.prototype.updateLine=function(a,b,c){a.origin=b;a.endpoint=c;k.vec3d.direction(c,b,a.direction)};c.prototype.update=function(c){b.matrix2frustumPlanes(c.viewMatrix,c.projectionMatrix,this.points,this.planes);for(var n=0;4>n;n++){var f=n,q=n+4;this.updateLine(this.lines[n],this.points[f],this.points[q]);this.updateLine(this.lines[n+4],this.points[f],3===n?this.points[0]:this.points[f+1]);this.updateLine(this.lines[n+8],this.points[q],3===n?this.points[4]:
this.points[q+1])}k.vec3d.set(c.eye,this.origin);k.vec3d.set(c.viewForward,this.direction);this._altitude=k.vec3d.length(this.origin)-a.earthRadius};Object.defineProperty(c.prototype,"altitude",{get:function(){return this._altitude},enumerable:!0,configurable:!0});return c}();r.Frustum=x;r.default=x})},"esri/views/3d/state/ConstraintsManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/HandleRegistry ../../../core/watchUtils ../camera/intersectionUtils ../camera/constraintUtils ./SurfaceCollisionConstraint ./NearFarHeuristic ../support/mathUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function w(a){var b=c.call(this)||this;b.handles=new t;b.nearFarHeuristic=y.createNearFarHeuristic(a.view.state.mode,a.view.basemapTerrain,a.view.renderCoordsHelper.spatialReference);return b}k(w,c);w.prototype.initialize=function(){var a=this;this.handles.add([this.view.watch(["constraints.clipDistance.near","constraints.clipDistance.far"],function(){return a.handleClipDistanceNearFarChanged()}),this.view.watch("constraints.clipDistance.mode",
function(){return a.handleClipDistanceModeChanged()}),this.view.state.events.on("before-camera-change",function(b){return a.cameraUpdateNearFar(b.camera)}),this.view.watch("dataExtent",function(){return a.updateNearFar()},!0)],"clipDistance");this.handles.add([this.view.watch(["constraints.altitude.min","constraints.altitude.max"],function(){return a.handleAltitudeMinMaxChanged()},!0)],"altitude");this.handles.add([this.view.watch("constraints.tilt.max",function(){return a.handleTiltMaxChanged()},
!0),this.view.watch("constraints.tilt.mode",function(){return a.handleTiltModeChanged()},!0),this.view.watch("state.camera",function(){return a.tiltAutoUpdateMax()},!0)],"tilt");this.handles.add([this.view.watch("constraints.collision.enabled",function(){return a.handleCollisionEnabledChanged()},!0)],"collision");this.view.state.isLocal&&this.handles.add(n.init(this.view,"dataExtent",function(b){return a.updateLocalSurfaceDistance(b)}));this.updateNearFar();"local"!==this.view.state.mode&&this.updateAltitude();
this.updateTilt();this.updateCollision();this._set("surfaceCollisionConstraint",new l.default({view:this.view}))};w.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null);this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))};w.prototype.handleClipDistanceNearFarChanged=function(){var a=this,b=this.view.constraints&&this.view.constraints.clipDistance;b&&"auto"!==b.mode&&this.view.state.updateCamera(function(c){a.cameraUpdateNearFarManual(c,
b);return!0})};w.prototype.handleClipDistanceModeChanged=function(){this.updateNearFar()};w.prototype.updateNearFar=function(){var a=this;this.view.state.updateCamera(function(b){a.cameraUpdateNearFar(b);return!0})};w.prototype.cameraUpdateNearFar=function(a){var b=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(b?b.mode:"auto")?this.cameraUpdateNearFarManual(a,b):this.cameraUpdateNearFarAuto(a,b)};w.prototype.cameraUpdateNearFarAuto=function(a,b){var c=this.nearFarHeuristic.compute(a.eye,
a.center,this.view.dataExtent,f.surfaceElevationBelowEye(this.view,a),v),l=c.distance,q=c.maxFarNearRatio,c=c.minNearDistance;l/q>c?(a.far=l,a.near=a.far/q):(a.near=c,a.far=a.near*q);b&&b.autoUpdate(a.near,a.far)};w.prototype.cameraUpdateNearFarManual=function(a,b){b&&(a.near=b.near,a.far=b.far)};w.prototype.handleCollisionEnabledChanged=function(){this.updateCollision()};w.prototype.updateCollision=function(){var a=this.view.constraints&&this.view.constraints.collision,b=this.view.state.constraints.collision,
a=a?a.enabled:!1;a!==b.enabled&&(b.enabled=a)&&this.reapplyConstraints(8)};w.prototype.handleAltitudeMinMaxChanged=function(){this.updateAltitude()};w.prototype.updateAltitude=function(){var a=this.view.constraints&&this.view.constraints.altitude;this.view.state.constraints.altitude=a&&"local"!==this.view.state.mode?{min:a.min,max:a.max}:null;this.reapplyConstraints()};w.prototype.handleTiltModeChanged=function(){this.updateTilt()};w.prototype.handleTiltMaxChanged=function(){var a=this.view.constraints&&
this.view.constraints.tilt;a&&"auto"!==a.mode&&(this.updateTiltManual(a),this.reapplyConstraints())};w.prototype.updateTilt=function(){var a=this.view.constraints&&this.view.constraints.tilt;"manual"===(a?a.mode:"auto")?this.updateTiltManual(a):this.updateTiltAuto(a);this.reapplyConstraints()};w.prototype.updateTiltManual=function(a){var b=this.view.state.constraints;b.tilt=b.createConstantMaxTilt(B.deg2rad(a.max))};w.prototype.updateTiltAuto=function(a){a=this.view.state.constraints;a.tilt=a.createDefaultTilt();
this.tiltAutoUpdateMax()};w.prototype.tiltAutoUpdateMax=function(){var a=this.view.constraints&&this.view.constraints.tilt;if(a&&"auto"===a.mode){var b=this.view.state.constraints;b.tilt&&(b=b.tilt(this.view.state.camera.distance).max,a.autoUpdate(B.rad2deg(b)))}};w.prototype.updateLocalSurfaceDistance=function(a){var b=Math.max(a.width,a.height);0>=b||(a.hasZ&&(b=Math.max(b,a.zmax-a.zmin)),a=this.view.state,b=3*b/Math.atan(a.camera.fov/2),b!==a.constraints.distance&&(a.constraints.distance=b))};
w.prototype.reapplyConstraints=function(a){var b=this;void 0===a&&(a=15);this.view.state.updateCamera(function(c){return q.applyAll(b.view,c,{selection:a,interactionType:0,interactionFactor:null,interactionStartCamera:null,interactionDirection:null})})};a([b.property({constructOnly:!0})],w.prototype,"view",void 0);a([b.property({readOnly:!0})],w.prototype,"surfaceCollisionConstraint",void 0);return w=a([b.subclass("esri.views.3d.state.ConstraintsManager")],w)}(b.declared(c));r.ConstraintsManager=
x;var v={distance:0,maxFarNearRatio:0,minNearDistance:0};r.default=x})},"esri/views/3d/state/SurfaceCollisionConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/HandleRegistry ../camera/intersectionUtils ../camera/constraintUtils".split(" "),function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function l(a){a=
c.call(this)||this;a.handles=new t;return a}k(l,c);l.prototype.initialize=function(){var a=this;this.handles.add(this.view.basemapTerrain.on("elevation-change",function(b){return a.handleElevationChangeEvent(b)}))};l.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};l.prototype.handleElevationChangeEvent=function(a){if(this.view.state.cameraController)return!1;n.eyeWithinExtent(this.view,this.view.state.camera,a.extent,a.spatialReference)&&this.applyToCurrentCamera()};
l.prototype.applyToCurrentCamera=function(){var a=this;this.view.state.updateCamera(function(b){f.applySurfaceCollision(a.view,b,1)})};a([b.property({constructOnly:!0})],l.prototype,"view",void 0);return l=a([b.subclass("esri.views.3d.state.ElevationCollisionConstraint")],l)}(b.declared(c));r.SurfaceCollisionConstraint=x;r.default=x})},"esri/views/3d/state/NearFarHeuristic":function(){define("require exports ../lib/glMatrix ../../../geometry/support/scaleUtils ../support/mathUtils ../support/earthUtils".split(" "),
function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});r.createNearFarHeuristic=function(a,b,c){return"global"===a?new n:new t(b,c)};var t=function(){function l(b,c){this.elevationProvider=b;this.unitInMeters=a.getMetersPerUnitForSR(c)}l.prototype.compute=function(a,p,l,n,t){t||(t={maxFarNearRatio:0,distance:0,minNearDistance:0});var y=c.earthRadius;t.maxFarNearRatio=f;t.minNearDistance=q/this.unitInMeters;var z=a[2]*this.unitInMeters,A=z;n=z-n;var F=this.elevationProvider?this.elevationProvider.getElevationBounds():
null;F&&(z=0<=n?A-this.unitInMeters*F[0]:this.unitInMeters*F[1]-A);A=Math.max(l.xmax-l.xmin,l.ymax-l.ymin,4*Math.max(l.xmax-l.xmin,l.ymax-l.ymin));k.vec3d.subtract(p,a,D);w[0]=0<D[0]?l.xmax:l.xmin;w[1]=0<D[1]?l.ymax:l.ymin;w[2]=0<D[2]?A/2:-A/2;k.vec3d.subtract(w,a);k.vec3d.normalize(D);a=1.1*k.vec3d.dot(w,D)*this.unitInMeters;p=z+y;y=Math.sqrt(p*p-y*y);l=Math.max(l.xmax-l.xmin,l.ymax-l.ymin);p=l*v*this.unitInMeters;z=b.clamp((z-p)/(l*B*this.unitInMeters-p),0,1);t.distance=b.lerp(y,a,z*z*z);t.distance*=
Math.max(Math.log(Math.abs(n)),1);t.distance=Math.min(t.distance,Math.max(34064E4,A));t.distance/=this.unitInMeters;return t};return l}(),n=function(){function a(){}a.prototype.compute=function(a,p,l,n,t){t||(t={maxFarNearRatio:0,minNearDistance:0,distance:0});p=c.earthRadius;a=k.vec3d.dot(a,a);l=p*p;t.maxFarNearRatio=f;t.minNearDistance=q/1;this.isNemoMode(a,n)?(n=p+n,t.distance=Math.sqrt(a-n*n)/1):a>l?(t.maxFarNearRatio=b.clamp(2E4-(Math.log(Math.sqrt(a)-p)-7.983)/9.011*19E3,1E3,2E4),t.distance=
Math.sqrt(a-l)/1):t.distance=t.maxFarNearRatio*t.minNearDistance;t.distance*=1.2;return t};a.prototype.isNemoMode=function(a,b){var f=c.earthRadius+l;return a<f*f&&b<y};return a}(),f=2E4,q=2,l=2E4,y=-500,B=.001,v=1E-4,w=k.vec3d.create(),D=k.vec3d.create()})},"esri/views/3d/state/controllers/SurfaceCollisionCorrectionController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/HandleRegistry ../../camera/intersectionUtils ../../camera/constraintUtils ./CameraController".split(" "),
function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(n){function f(b){var c=n.call(this)||this;c.handles=new a;c.view=b.view;c.desiredCamera=b.desiredCamera.copy();return c}k(f,n);Object.defineProperty(f.prototype,"canStop",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"constraintEnabled",{get:function(){return this.view.state.constraints.collision.enabled},enumerable:!0,configurable:!0});f.prototype.onControllerStart=function(a){var b=
this;n.prototype.onControllerStart.call(this,a);this.handles.add(this.view.basemapTerrain.on("elevation-change",function(a){return b.handleElevationChangeEvent(a)}));this.applyCorrection()};f.prototype.onControllerEnd=function(a){this.handles.removeAll();n.prototype.onControllerEnd.call(this,a)};f.prototype.handleElevationChangeEvent=function(a){b.eyeWithinExtent(this.view,this.desiredCamera,a.extent,a.spatialReference)&&this.applyCorrection()};f.prototype.applyCorrection=function(){var a=this;this.view.state.updateCamera(function(b){b.copyViewFrom(a.desiredCamera);
c.applySurfaceCollision(a.view,b,1)||a.constraintEnabled||(a.state=t.State.Stopped)})};return f}(t.CameraController);r.SurfaceCollisionCorrectionController=x})},"esri/views/3d/state/helpers/PickingHelper":function(){define(["require","exports","../../lib/glMatrix","../../webgl-engine/lib/Selector","../../camera/intersectionUtils"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function c(b){this.view=b;this.tmpR0=k.vec3d.create();this.tmpR1=k.vec3d.create();this.tmpSelector=
new a(this.view.viewingMode)}c.prototype.pickPointInScreen=function(a,b){return this.pickedIntersectionPoint(this.pickInScreen(a,!1),b)};c.prototype.pickFreePointFromSegment=function(a,c,f){k.vec3d.set(a,this.tmpR0);k.vec3d.set(c,this.tmpR1);k.vec3d.subtract(this.tmpR1,this.tmpR0);k.vec3d.normalize(this.tmpR1);var q=this.view.dataExtent;a=Math.max(q.xmax-q.xmin,q.ymax-q.ymin,8*Math.max(q.xmax-q.xmin,q.ymax-q.ymin));c=this.view.state.camera;var l=Math.max(0,q.xmin-c.eye[0],c.eye[0]-q.xmax),q=Math.max(0,
q.ymin-c.eye[1],c.eye[1]-q.ymax),l=Math.sqrt(l*l+q*q),q=this.view.renderCoordsHelper.getAltitude(c.eye);c=b.surfaceElevationBelowEye(this.view,c);c=a/Math.max(1,Math.pow(Math.max(0,Math.log(a/(Math.abs(q-c)+Number.MIN_VALUE))),2));c=Math.max(c,Math.min(l,a));k.vec3d.scale(this.tmpR1,c);k.vec3d.add(this.tmpR0,this.tmpR1,f)};c.prototype.pickFreePointInScreen=function(a,b){this.view._pickRayWithBeginPoint(a,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);this.pickFreePointFromSegment(this.tmpR0,
this.tmpR1,b)};c.prototype.pickRaySegment=function(a,b,c){return this.pickedIntersectionPoint(this.view._pickRay(a,b,null,null,null,null,this.tmpSelector),c)};c.prototype.pickInScreen=function(a,b){this.view._pickRayWithBeginPoint(a,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);b&&k.vec3d.set(this.view.state.camera.eye,this.tmpR0);return this.view._pickRay(this.tmpR0,this.tmpR1,a,a,null,null,this.tmpSelector)};c.prototype.pickedIntersectionPoint=function(a,b){return a?a.getMinResult().getIntersectionPoint(b):
!1};return c}();r.PickingHelper=x})},"esri/views/3d/environment/SceneViewEnvironment":function(){define(["dojo/_base/lang","../../../webscene/Environment","../../../webscene/Lighting","./SceneViewLighting","./SceneViewAtmosphere"],function(x,r,k,a,b){var c=r.createSubclass({declaredClass:"esri.views.3d.environment.SceneViewEnvironment",properties:{atmosphere:{type:b,json:{read:!1}},atmosphereEnabled:{value:!0,json:{read:!1}},starsEnabled:{value:!0,json:{read:!1}},lighting:{set:function(b){if(b)if(this.lighting)null!=
b.date&&(this.lighting.date=b.date),null!=b.defaultDate&&(this.lighting.defaultDate=b.defaultDate),null!=b.displayUTCOffset&&(this.lighting.displayUTCOffset=b.displayUTCOffset),this.lighting.directShadowsEnabled=b.directShadowsEnabled,null!=b.ambientOcclusionEnabled&&(this.lighting.ambientOcclusionEnabled=b.ambientOcclusionEnabled),null!=b.cameraTrackingEnabled&&(this.lighting.cameraTrackingEnabled=b.cameraTrackingEnabled);else if(b instanceof a)this._set("lighting",b);else if(b instanceof k){var c=
{directShadowsEnabled:b.directShadowsEnabled};null!=b.date&&(c.date=b.date);null!=b.displayUTCOffset&&(c.displayUTCOffset=b.displayUTCOffset);null!=b.defaultDate&&(c.defaultDate=b.defaultDate);this._set("lighting",new a(c))}else this._set("lighting",new a(b));else this.lighting||this._set("lighting",new a)}}},getDefaults:function(){return x.mixin(this.inherited(arguments),{atmosphere:{}})},atmosphere:null,atmosphereEnabled:!0,starsEnabled:!0,clone:function(){return new c({lighting:this.lighting.clone(),
atmosphere:this.atmosphere.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled})}});return c})},"esri/views/3d/environment/SceneViewLighting":function(){define(["../../../core/Evented","../../../webscene/Lighting"],function(x,r){var k=new Date,a={target:null,date:null},b={target:null,timezoneOffset:0};return r.createSubclass([x],{declaredClass:"esri.views.3d.environment.SceneViewLighting",properties:{cameraTrackingEnabled:{value:!0},ambientOcclusionEnabled:{value:!1},defaultDate:{get:function(){return new Date(this._get("defaultDate"))},
set:function(a){var b=this._get("date")===this._get("defaultDate");a=new Date(a);this._set("defaultDate",a);b&&this._set("date",a)}},date:{cast:function(a){return a},set:function(a){null!=a&&(this._set("date",new Date(a)),this.positionTimezoneInfo.autoUpdated=!1,this._emitDateWillChange())}}},constructor:function(){this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};this._autoUpdateDate=null;var a=(new Date).getFullYear(),a=new Date("March 15, "+a+" 12:00:00 UTC");this._set("defaultDate",
a);this._set("date",a)},autoUpdate:function(a,k){var c=this._calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=k.hours;this.positionTimezoneInfo.minutes=k.minutes;this.positionTimezoneInfo.seconds=k.seconds;if(null!=a){this.positionTimezoneInfo.autoUpdated=!0;var f=this.date&&this.date.getTime();this._set("date",new Date(a));this._emitDateWillChange()}k=this._calculateTimezoneOffset(this.positionTimezoneInfo);c!==k&&(b.target=this,b.timezoneOffset=k,this.emit("timezone-will-change",
b));if(null!=a)return f!==a.getTime()},_calculateTimezoneOffset:function(a){return Math.round(a.hours+a.minutes/60+a.seconds/3600)},_emitDateWillChange:function(){a.target=this;k.setTime(this._get("date").getTime());a.date=k;this.emit("date-will-change",a)}})})},"esri/views/3d/environment/SceneViewAtmosphere":function(){define(["../../../core/Accessor"],function(x){return x.createSubclass({properties:{quality:{}},quality:"low",_qualitySetter:function(r){-1!==["low","high"].indexOf(r)&&this._set("quality",
r)},clone:function(){return new this.constructor({quality:this.quality})}})})},"esri/views/3d/environment/SceneViewEnvironmentManager":function(){define("../../../core/declare ../../../core/Accessor ../../../core/Evented ../../../core/promiseUtils ../../../core/watchUtils ../../../core/HandleRegistry ../../../geometry/Point ../../../geometry/support/webMercatorUtils ../../../geometry/SpatialReference ../support/sunUtils ../support/earthUtils ./EnvironmentRenderer ../webgl-engine/lighting/Lightsources ../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){var w=v.vec3d,D=new Date,F={hours:0,minutes:0,seconds:0},G=[.5773502691896258,-.5773502691896258,.5773502691896258],p=w.createFrom(.22,.22,.33),z=w.createFrom(.22,.22,.22);x=x([r,k],{declaredClass:"esri.views.3d.environment.SceneViewEnvironmentManager",referencePointUpdateDelay:200,referencePointUpdateInterval:3E3,referencePointUpdateDistThreshold:1E6,properties:{updating:{dependsOn:["noReferencePositionQueries"],readOnly:!0,get:function(){return!this.noReferencePositionQueries&&
(!!this._referencePosUpdateQuery||!!this._referencePosMapCoordsRequested)}},noReferencePositionQueries:{},view:{},_environmentRenderer:{}},constructor:function(){this._viewHandles=new c;this._environmentRenderer=null;this._viewConnected=this._trackingEnabled=this._preserveAbsoluteDateTime=!1;this._referencePosResetPreserveAbsoluteTime=null;this._resetReferencePosition()},destroy:function(){this._viewHandles.destroy();this.disposeRendering()},disposeRendering:function(){this._environmentRenderer&&
(this._environmentRenderer.destroy(),this._environmentRenderer=null);this._resetReferencePosition(!0)},updateReadyChange:function(a){a&&!this._viewConnected?(this._viewConnected=!0,this.connectView(this.view)):!a&&this._viewConnected&&(this._viewConnected=!1,this.disconnectView(this.view))},connectView:function(a){this._environmentRenderer=new y({view:a});this._viewHandles.add([b.on(this.view,"environment.lighting","date-will-change",this._lightingDateHandler.bind(this)),this.view.watch("interacting,stationary",
this._interactingStationaryHandler.bind(this)),this.view.watch("environment.lighting.directShadowsEnabled,environment.lighting.ambientOcclusionEnabled",this._updateRenderParamsHandler.bind(this)),this.view.watch("spatialReference",this._spatialReferenceHandler.bind(this)),b.init(this.view,"viewingMode",this._viewingModeHandler.bind(this)),b.init(this.view,"environment.lighting.cameraTrackingEnabled",this._updateCameraTracking.bind(this),!0),this.watch("noReferencePositionQueries",this._cameraHandler.bind(this,
null))]);this._updateRenderParamsHandler();this._updateLightParams();this._cameraHandler()},_updateCameraTracking:function(a){if(this._trackingEnabled=a)a=b.init(this,"view.state.camera",this._cameraHandler.bind(this,null),!0),this._viewHandles.add(a,"camera");else{if(a=this.get("view.environment.lighting"))a.positionTimezoneInfo.autoUpdated=!1;this._viewHandles.remove("camera")}},disconnectView:function(a){this.disposeRendering();this._viewHandles.removeAll()},_lightingDateHandler:function(a){if(a=
a.date){var b=this.view.environment.lighting;if(!b.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;var c=this.view.spatialReference;if(!(c.isWGS84||c.isWebMercator||(c=this.view.camera.position,this._referencePosMapCoords&&this._referencePosMapCoords.equals(c)))){this._requestReferencePositionUpdate(c);return}this._preupdateTracking(a);this._referencePosWGS84&&(c=l.positionToTimezone(this._referencePosWGS84,F),b.autoUpdate(null,c),this._trackingEnabled&&(b.positionTimezoneInfo.autoUpdated=
!0))}this._updateLightParams(a)}},_preupdateTracking:function(a){!this._trackingEnabled&&this.get("view.environment.lighting.cameraTrackingEnabled")&&this._cameraHandler(a)},_cameraHandler:function(a){if(this.view.ready){var b=this.view.camera;if(b){var c=this.view.spatialReference;c.isWGS84||c.isWebMercator?this._cameraHandlerGlobal(b,a):this._cameraHandlerLocal(b,a)}}},_cameraHandlerGlobal:function(a,b){a=a.position;this._referencePosWGS84||(this._referencePosWGS84=new t({spatialReference:f.WGS84}));
a.spatialReference.isWebMercator?n.webMercatorToGeographic(a,!1,this._referencePosWGS84):(this._referencePosWGS84.x=a.x,this._referencePosWGS84.y=a.y);this._referencePosWGS84.z=a.z;this._autoUpdateTimezone(a,b)||this._updateLightParams(b)},_cameraHandlerLocal:function(a,b){a=a.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(a))&&this._requestReferencePositionUpdate(a,!0);this.view.mapCoordsHelper&&this._referencePosWGS84&&(this._referencePosWGS84.z=
a.z*this.view.mapCoordsHelper.unitInMeters,this._referencePosChanged())},_interactingStationaryHandler:function(){!this.view.interacting&&this.view.stationary&&this._executePendingReferencePositionUpdate()},_mainLight:new B.MainLight,_ambientLight:new B.AmbientLight,_moonLight:new B.FillLight,_updateLightParams:function(a){var b=this.view.environment.lighting;a=a||b.date;var b=this.view._stage,c;this._referencePosWGS84?(c=q.computeColorAndIntensity(a,this._referencePosWGS84),q.computeDirection(a,
this._referencePosWGS84,this.view.viewingMode,c.diffuse.direction)):c={diffuse:{color:[1,1,1],intensity:.55,direction:G},ambient:{color:[1,1,1],intensity:.55},noonFactor:.5,globalFactor:0};w.scale(c.diffuse.color,c.diffuse.intensity*Math.PI,this._mainLight.intensity);w.negate(c.diffuse.direction,this._mainLight.direction);w.scale(c.ambient.color,c.ambient.intensity,this._ambientLight.intensity);w.lerp(p,z,c.globalFactor,this._moonLight.intensity);w.scale(this._moonLight.intensity,(1-.5*c.globalFactor)*
(1-.4*c.noonFactor*(1-c.globalFactor)));w.set(c.diffuse.direction,this._moonLight.direction);b.setLighting({lights:[this._mainLight,this._ambientLight,this._moonLight],globalFactor:c.globalFactor,groundLightingFactor:1-c.noonFactor});this._updateRenderParamsHandler()},_autoUpdateTimezone:function(a,b){if(!this.view.get("environment.lighting.cameraTrackingEnabled"))return!1;D.setTime((b||this.view.environment.lighting.date).getTime());a=l.positionToTimezone(a,F);var c=this.view.environment.lighting.positionTimezoneInfo;
if(!c.autoUpdated)c=a;else if(c.hours===a.hours&&c.minutes===a.minutes&&c.seconds===a.seconds)return!1;var f=D.getUTCHours()-(a.hours-c.hours),p=D.getUTCMinutes()-(a.minutes-c.minutes),c=D.getUTCSeconds()-(a.seconds-c.seconds);D.setUTCHours(f);D.setUTCMinutes(p);D.setUTCSeconds(c);return b?!1:this.view.environment.lighting.autoUpdate(D,a)},_updateRenderParamsHandler:function(){var a=this.view._stage,b=!0;this._referencePosWGS84&&(b=q.computeShadowsEnabled(this._referencePosWGS84,this.view.viewingMode));
a&&a.setRenderParams({shadowMap:this.view.environment.lighting.directShadowsEnabled&&b,ssao:this.view.environment.lighting.ambientOcclusionEnabled})},_spatialReferenceHandler:function(){this._resetReferencePosition()},_viewingModeHandler:function(a){this._resetReferencePosition()},_resetReferencePosition:function(a){this._cancelReferencePosUpdates();this._referencePosWGS84=this._referencePosResetPreserveAbsoluteTime=this._referencePosMapCoordsRequested=this._referencePosMapCoords=null;a||this.notifyChange("updating")},
_requestReferencePositionUpdate:function(b,c){if(this.view.mapCoordsHelper.canProject()&&!this.noReferencePositionQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(b):this._referencePosMapCoordsRequested=b.clone(),this._referencePosResetPreserveAbsoluteTime=!!c,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&!this.view.interacting&&this.view.stationary)){var f=this,p=this._referencePosUpdateQuery=a.after(this.referencePointUpdateDelay).then(function(){if(f._referencePosUpdateQuery===
p)return f._doReferencePositionUpdateQuery(function(){return f._referencePosUpdateQuery!==p})}).always(function(){f._referencePosUpdateQuery===p&&(f._referencePosUpdateQuery=null,f._referencePosUpdateTimer||f._executePendingReferencePositionUpdate(),f.notifyChange("updating"))}),l=this._referencePosUpdateTimer=a.after(this.referencePointUpdateInterval).then(function(){f._referencePosUpdateTimer===l&&(f._referencePosUpdateTimer=null,f._referencePosUpdateQuery||f._executePendingReferencePositionUpdate())});
this.notifyChange("updating")}},_doReferencePositionUpdateQuery:function(a){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1);this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone();this._referencePosMapCoordsRequested=this._referencePosResetPreserveAbsoluteTime=null;return this.view.mapCoordsHelper.toGeographic(this._referencePosMapCoords).then(function(b){if(!a()&&
!isNaN(b[0])&&!isNaN(b[1])){var c=this._referencePosMapCoords.z*this.view.mapCoordsHelper.unitInMeters;this._referencePosWGS84?(this._referencePosWGS84.x=b[0],this._referencePosWGS84.y=b[1],this._referencePosWGS84.z=c):this._referencePosWGS84=new t({x:b[0],y:b[1],z:c,spatialReference:f.WGS84});this._referencePosChanged()}}.bind(this))},_executePendingReferencePositionUpdate:function(){var a=this._referencePosMapCoordsRequested;a&&this._requestReferencePositionUpdate(a,this._referencePosResetPreserveAbsoluteTime)},
_referencePosChanged:function(){this._preserveAbsoluteDateTime?this._updateLightParams():this._autoUpdateTimezone(this._referencePosWGS84)||this._updateLightParams()},_exceedsReferencePosDistThreshold:function(a){return this._referencePosMapCoords?(a=this._referencePosMapCoords.distance(a),this.view.mapCoordsHelper&&(a*=this.view.mapCoordsHelper.unitInMeters),a>this.referencePointUpdateDistThreshold):!0},_cancelReferencePosUpdates:function(){this._referencePosUpdateTimer=this._referencePosUpdateQuery=
null}});x.FIXED_LIGHT_DIRECTION=G;return x})},"esri/views/3d/support/sunUtils":function(){define(["./mathUtils","../lib/glMatrix","../lib/SunCalc"],function(x,r,k){var a=r.vec3d,b=r.mat4d,c=x.lerp,t=b.identity(),n={azimuth:0,altitude:0},f={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,diffuseAtNoon:.65,diffuseAtTwilight:.7},global:{altitude:8E5,ambient:.015,diffuse:.75},planarDirection:{localAltitude:1E4,globalAltitude:1E6,globalAngles:{azimuth:Math.PI/3,altitude:Math.PI/
3}}},q={ambient:{color:a.create(),intensity:0},diffuse:{color:a.create(),intensity:0,direction:a.create()}},l={settings:f,computeDirection:function(c,f,q,y){y||(y=a.create());var v=b.identity(t);if("global"===q)k.getPosition(c,0,0,n),a.set3(0,0,-1,y),b.rotateX(v,-n.azimuth),b.rotateY(v,-n.altitude);else{var w=l.settings.planarDirection;q=w.globalAngles;w=(Math.abs(f.z)-w.localAltitude)/(w.globalAltitude-w.localAltitude);w=x.clamp(w,0,1);1>w?(k.getPosition(c,f.y,f.x,n),n.azimuth=(1-w)*n.azimuth+w*
q.azimuth,n.altitude=(1-w)*n.altitude+w*q.altitude):(n.azimuth=q.azimuth,n.altitude=q.altitude);a.set3(0,-1,0,y);b.rotateZ(v,-n.azimuth);b.rotateX(v,-n.altitude)}b.multiplyVec3(v,y);return y},computeShadowsEnabled:function(a,b){return"global"===b?!0:Math.abs(a.z)<l.settings.planarDirection.localAltitude},computeColorAndIntensity:function(b,n){var t,v,B,r=n.z;v=l.settings;a.set3(1,1,1,q.ambient.color);q.ambient.intensity=v.global.ambient;a.set3(1,1,1,q.diffuse.color);q.diffuse.intensity=v.global.diffuse;
r=(Math.abs(r)-v.local.altitude)/(v.global.altitude-v.local.altitude);r=x.clamp(r,0,1);q.globalFactor=r;n=k.getTimes(b,n.y,n.x);if(1>r){v=b.valueOf();var p,z;n.polarException===k.POLAR_EXCEPTION.MIDNIGHT_SUN?(p=v-36E5*(b.getHours()+48)-6E4*b.getMinutes(),z=p+432E6):n.polarException===k.POLAR_EXCEPTION.POLAR_NIGHT?(p=v-2,z=v-1):(p=n.sunrise.valueOf(),z=n.sunset.valueOf());var A=z-p;B=p+A/2;var J=A/4;t=B-J;var J=B+J,I=.06*A,A=p-I/2;p+=I/2;var K=z-I/2,L=z+I/2;z=f.local;var O=[.01,z.ambientAtNight],P=
[.8,.8,1],U=[.01,.01,.01],N=[z.diffuseAtTwilight,z.ambientAtTwilight],R=[1,.75,.75],S=[.8,.8,1],T=[.9*z.diffuseAtNoon,z.ambientAtNoon],V=[1,.98,.98],h=[.98,.98,1],ca=[z.diffuseAtNoon,z.ambientAtNoon],Q=[1,1,1],e=[1,1,1];z=[0,0];var d=[0,0],I=[0,0];v<A||v>L?(z=O,d=U,I=P):v<p?(I=p-A,z=y(v-A,I,O,N),d=y(v-A,I,U,R),I=y(v-A,I,P,S)):v<t?(I=t-p,z=y(v-p,I,N,T),d=y(v-p,I,R,V),I=y(v-p,I,S,h)):v<B?(I=B-t,z=y(v-t,I,T,ca),d=y(v-t,I,V,Q),I=y(v-t,I,h,e)):v<J?(I=J-B,z=y(v-B,I,ca,T),d=y(v-B,I,Q,V),I=y(v-B,I,e,h)):
v<K?(I=K-J,z=y(v-J,I,T,N),d=y(v-J,I,V,R),I=y(v-J,I,h,S)):v<L&&(I=L-K,z=y(v-K,I,N,O),d=y(v-K,I,R,U),I=y(v-K,I,S,P));v=z[0];B=d;t=z[1];a.lerp(I,q.ambient.color,r,q.ambient.color);q.ambient.intensity=c(t,q.ambient.intensity,r);a.lerp(B,q.diffuse.color,r,q.diffuse.color);q.diffuse.intensity=c(v,q.diffuse.intensity,r)}r=b.valueOf();n.polarException===k.POLAR_EXCEPTION.MIDNIGHT_SUN?(b=r-36E5*(b.getHours()+48)-6E4*b.getMinutes(),n=b+432E6):n.polarException===k.POLAR_EXCEPTION.POLAR_NIGHT?(b=r-2,n=r-1):(b=
n.sunrise.valueOf(),n=n.sunset.valueOf());b=1-x.clamp(Math.abs(r-(b+(n-b)/2))/432E5,0,1);q.noonFactor=b;return q}},y=function(a,b,c,f){for(var l=[],q=0;q<c.length;q++)l[q]=(f[q]-c[q])*a/b+c[q];return l};return l})},"esri/views/3d/lib/SunCalc":function(){define([],function(){function x(a){return new Date(864E5*(a+.5-2440588))}function r(a,b){return w(l(a)*y(p)-B(b)*l(p),y(a))}function k(a,b){return v(l(b)*y(p)+y(b)*l(p)*l(a))}function a(a,b,c){return w(l(a),y(a)*l(b)-B(c)*y(b))}function b(a,b,c){return v(l(b)*
l(c)+y(b)*y(c)*y(a))}function c(a){return F*(1.9148*l(a)+.02*l(2*a)+3E-4*l(3*a))}function t(a,b){a=F*(357.5291+.98560028*a);var f=c(a);a=a+f+102.9372*F+q;b||(b={dec:0,ra:0});b.dec=k(a,0);b.ra=r(a,0);return b}function n(a,b,c){return 2451545+a+.0053*l(b)-.0069*l(2*c)}function f(a){var b=F*(134.963+13.064993*a),c=F*(93.272+13.22935*a);a=F*(218.316+13.176396*a)+6.289*F*l(b);c=5.128*F*l(c);b=385001-20905*y(b);return{ra:r(a,c),dec:k(a,c),dist:b}}var q=Math.PI,l=Math.sin,y=Math.cos,B=Math.tan,v=Math.asin,
w=Math.atan2,D=Math.acos,F=q/180,G={dec:0,ra:0},p=23.4397*F,z={POLAR_EXCEPTION:{NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2},getPosition:function(c,f,p,l){p=F*-p;f*=F;var q=c.valueOf()/864E5-.5+2440588-2451545;c=t(q,G);p=F*(280.16+360.9856235*q)-p-c.ra;l||(l={azimuth:0,altitude:0});l.azimuth=a(p,f,c.dec);l.altitude=b(p,f,c.dec);return l}},A=[[-.83,"sunrise","sunset"]];z.addTime=function(a,b,c){A.push([a,b,c])};z.getTimes=function(a,b,f){function p(a){var e=v,d=G;a=D((l(a)-l(e)*l(d))/(y(e)*y(d)));return n(9E-4+
(a+t)/(2*q)+w,B,r)}var t=F*-f,v=F*b,w=Math.round(a.valueOf()/864E5-.5+2440588-2451545-9E-4-t/(2*q));a=9E-4+(0+t)/(2*q)+w;var B=F*(357.5291+.98560028*a);b=c(B);var r=B+b+102.9372*F+q,G=k(r,0);a=n(a,B,r);b={solarNoon:x(a),nadir:x(a-.5),polarException:z.POLAR_EXCEPTION.NORMAL};var J,K,h,I;f=0;for(J=A.length;f<J;f+=1)K=A[f],h=p(K[0]*F),I=a-(h-a),b[K[1]]=x(I),b[K[2]]=x(h);b.polarException=function(a){a=(l(a)-l(v)*l(G))/(y(v)*y(G));return-1>a?z.POLAR_EXCEPTION.MIDNIGHT_SUN:1<a?z.POLAR_EXCEPTION.POLAR_NIGHT:
z.POLAR_EXCEPTION.NORMAL}(A[0][0]*F);return b};z.getMoonPosition=function(c,p,l){l=F*-l;p*=F;var q=c.valueOf()/864E5-.5+2440588-2451545;c=f(q);l=F*(280.16+360.9856235*q)-l-c.ra;q=b(l,p,c.dec);q+=.017*F/B(q+10.26*F/(q+5.1*F));return{azimuth:a(l,p,c.dec),altitude:q,distance:c.dist}};z.getMoonFraction=function(a){var b=a.valueOf()/864E5-.5+2440588-2451545;a=t(b);b=f(b);a=D(l(a.dec)*l(b.dec)+y(a.dec)*y(b.dec)*y(a.ra-b.ra));a=w(149598E3*l(a),b.dist-149598E3*y(a));return(1+y(a))/2};return z})},"esri/views/3d/environment/EnvironmentRenderer":function(){define("../../../core/watchUtils ../support/ExternalRenderer ./PanoramicAtmosphere ./RealisticAtmosphere ./SimpleAtmosphere ./Stars ../webgl-engine/lib/RenderSlot".split(" "),
function(x,r,k,a,b,c,t){return r.createSubclass({declaredClass:"esri.views.3d.environment.EnvironmentRenderer",properties:{view:{},viewingMode:{dependsOn:["view.viewingMode"],get:function(){return this.get("view.viewingMode")||"global"}},atmosphereQuality:{dependsOn:["view.environment.atmosphereEnabled","view.environment.atmosphere.quality"],get:function(){return this.get("view.environment.atmosphereEnabled")?this.get("view.environment.atmosphere.quality")||"none":"none"}},starsEnabled:{dependsOn:["view.environment.starsEnabled"],
get:function(){return this.get("view.environment.starsEnabled")||!1}},transparent:{dependsOn:["view.basemapTerrain.opacity","view.basemapTerrain.wireframe"],get:function(){var a=this.get("view.basemapTerrain");return a&&a._renderer.isTransparent()}},_atmosphere:{},_stars:{},needsRender:{dependsOn:["_stars.needsRender","_atmosphere.needsRender"],get:function(){return!!(this._needsRender||this._atmosphere&&this._atmosphere.needsRender||this._stars&&this._stars.needsRender)}}},constructor:function(){this._STANDARD_SLOT=
t.BACKGROUND;this._SPECIAL_SLOT=t.POSTPROCESSING_ATMOSPHERE;this._slots=[this._STANDARD_SLOT,this._SPECIAL_SLOT];this._stars=this._atmosphere=this._atmosphereReadyPromise=this._AtmosphereClass=null;this._needsRender=!0;this.notifyChange("needsRender")},initialize:function(){this.view._stage.addExternalRenderer(this._slots,this);this._basemapTerrainHandle=x.when(this.view,"basemapTerrain",this._updateBasemapTerrain.bind(this))},destroy:function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=
null);this._stars&&(this._stars.destroy(),this._stars=null);this._basemapTerrainHandle&&this._basemapTerrainHandle.remove();this.view&&(this.view._stage.removeExternalRenderer(this),this.view=null)},setup:function(a){this.watch("viewingMode,atmosphereQuality,transparent,visible",this._updateAtmosphere.bind(this));this._updateAtmosphere();this.watch("starsEnabled,transparent,visible",this._updateStars.bind(this));this._updateStars();this.watch("view.basemapTerrain.loaded",function(){this._needsRender=
!0;this.notifyChange("needsRender")}.bind(this))},resetNeedsRender:function(){this._atmosphere&&(this._atmosphere.resetNeedsRender?this._atmosphere.resetNeedsRender():this._atmosphere.didRender&&(this._atmosphere.needsRender=!1,this._atmosphere.didRender=!1));this._stars&&(this._stars.resetNeedsRender?this._stars.resetNeedsRender():this._stars.didRender&&(this._stars.needsRender=!1,this._stars.didRender=!1));this.didRender&&(this.didRender=this._needsRender=!1,this.notifyChange("needsRender"))},render:function(a){if(!this.get("view.basemapTerrain.loaded")&&
"global"===this.viewingMode)return!1;if(!this._stars&&!this._atmosphere)return!0;this._stars&&this._stars.render(a);this._atmosphere&&this._atmosphere.render(a);return this._stars&&this._stars.didRender||this._atmosphere&&this._atmosphere.didRender},_updateStars:function(){var a=this._getAtmosphereSlot();this.starsEnabled&&!this._stars?(this._stars=new c({view:this.view,slot:a}),this._stars.initializeRenderContext(this.renderContext)):!this.starsEnabled&&this._stars?(this._stars.destroy(),this._stars=
null):this._stars&&(this._stars.slot=a);this._needsRender=!0;this.notifyChange("needsRender")},_updateAtmosphere:function(){var a=this._getAtmosphereSlot();this._atmosphere&&(this._atmosphere.slot=a);if(this._updateAtmosphereClass(this.renderContext)){this._needsRender=!0;this.notifyChange("needsRender");var b=function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=null)}.bind(this);if(this._AtmosphereClass){this._atmosphereReadyPromise&&(this._atmosphereReadyPromise.cancel(),this._atmosphereReadyPromise=
null);var c=new this._AtmosphereClass({view:this.view,slot:a});c.initializeRenderContext(this.renderContext);this._atmosphere?this._atmosphereReadyPromise=c.when(function(){b();this._atmosphereReadyPromise=null;this._atmosphere=c}.bind(this)):this._atmosphere=c;c.when(this._updateBasemapTerrain.bind(this))}else b(),this._updateBasemapTerrain()}},_updateAtmosphereClass:function(c){var f=this._AtmosphereClass;"none"===this.atmosphereQuality?this._AtmosphereClass=null:"high"===this.atmosphereQuality&&
!this.transparent&&a.isSupported(c)?this._AtmosphereClass="local"===this.viewingMode?k:a:this._AtmosphereClass="local"===this.viewingMode?k:b;return this._AtmosphereClass!==f},_getAtmosphereSlot:function(){return this.transparent&&"global"===this.viewingMode?this._SPECIAL_SLOT:this._STANDARD_SLOT},_updateBasemapTerrain:function(){var b=this.get("view.basemapTerrain");b&&(b.velvetOverground=!(!this._AtmosphereClass||this._AtmosphereClass===a))}})})},"esri/views/3d/support/ExternalRenderer":function(){define("../../../core/declare ../../../core/Accessor ../../../core/Promise dojo/Deferred dojo/aspect dojo/_base/lang".split(" "),
function(x,r,k,a,b,c){return x([r,k],{"-chains-":c.mixin(r._meta.chains,{setup:"after",initializeRenderContext:"after",uninitializeRenderContext:"before"}),properties:{gl:{readOnly:!0,get:function(){return this._gl}},needsRender:{value:!0},visible:{value:!0}},constructor:function(){this.didRender=!1;this.renderContext=null;this.watch("visible",function(){this.needsRender=!0}.bind(this));this._contextDfd=new a},initialize:function(){this.addResolvingPromise(this._contextDfd.promise);b.around(this,
"render",function(a){return function(){return this.isRejected()?this.didRender=!0:this.isResolved()?!this.visible||a.apply(this,arguments)?this.didRender=!0:!1:!1}.bind(this)}.bind(this));this.when(function(){this.destroyed||this.setup(this.renderContext)}.bind(this))},needsRender:!0,visible:!0,initializeRenderContext:function(a){this.renderContext=a;this._contextDfd.resolve()},uninitializeRenderContext:function(a){},setup:function(a){},render:function(a){return!1}})})},"esri/views/3d/environment/PanoramicAtmosphere":function(){define("dojo/text!./materials/SimpleAtmosphereMaterial.xml dojo/Deferred ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/GLTextureRep ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ./resources/SimpleAtmosphereTexture ../../webgl/Program ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){var D=a.vec2d,F=a.vec3d,G=a.mat4d,p=n.VertexAttrConstants,z=G.create();return k.createSubclass({declaredClass:"esri.views.3d.environment.PanoramicAtmosphere",properties:{view:{},needsRender:{value:!1},slot:{value:l.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={texV:D.create(),silCircleCenter:F.create(),silCircleV1:F.create(),silCircleV2:F.create()};this._textureRep=this._texture=null;this.slot=
l.BACKGROUND},initialize:function(){this._textureDfd=new r;this.addResolvingPromise(this._textureDfd.promise)},destroy:function(){this._textureRep&&(this._texture&&(this._textureRep.release("SimpleAtmosphere"),this._textureRep.getTexture("SimpleAtmosphere").unload()),this._textureRep=null);this._program&&(this._program.dispose(),this._program=null);this._textureDfd&&(this._textureDfd.cancel(),this._textureDfd=null)},initializeRenderContext:function(a){this._textureRep=new f({SimpleAtmosphere:new t(y,
"SimpleAtmosphere",{wrapClamp:!0})},a.programRep,function(){return this.view.state.camera.viewport}.bind(this),a.rctx);this._texture=this._textureRep.aquire("SimpleAtmosphere",void 0,void 0,function(a){this._texture=a.getGLTexture();this._textureDfd.resolve();this._textureDfd=null}.bind(this))},setup:function(a){var c=this._createGeometryData(),f=this.renderContext.rctx;this._renderer=new b(c,v.Pos3,null,f);a.shaderSnippets.vsSimpleAtmosphere||a.shaderSnippets._parse(x);this._program=new B(f,a.shaderSnippets.vsSimpleAtmosphere,
a.shaderSnippets.fsSimpleAtmosphere,w.Default3D,["PANORAMIC"])},render:function(a){if(a.slot!==this.slot||a.pass!==q.MATERIAL||!this._textureRep.getIsLoaded("SimpleAtmosphere"))return!1;var b=this.renderContext.rctx,c=b.gl,f=this._program;b.bindProgram(f);b.bindTexture(this._texture);f.setUniform1i("tex",0);f.setUniformMatrix4fv("proj",a.camera.projectionMatrix);G.toRotationMat(a.camera.viewMatrix,z);f.setUniformMatrix4fv("view",z);f.setUniform4f("color",1,1,1,1);f.setUniform3fv("lightDirection",
a.lightingData.direction);b.setFaceCullingEnabled(!0);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);b.setDepthWriteEnabled(!1);this._renderer.render(this._program);b.setDepthWriteEnabled(!0);b.setBlendingEnabled(!1);b.setDepthFunction(c.LESS);b.setFaceCullingEnabled(!1);return!0},_createGeometryData:function(){for(var a=c.createPolySphereGeometry(1,2),b=a.indices[p.POSITION],f=0;f<b.length;f+=3){var l=b[f];b[f]=b[f+2];b[f+2]=l}b=a.getVertexAttr();l=b[p.NORMAL].data;for(f=0;f<l.length;f++)l[f]=
-l[f];return{indices:a.indices,vertexAttr:b}}})})},"esri/views/3d/webgl-engine/lib/GeometryRenderer":function(){define("require exports ../materials/internal/MaterialUtil ./Util ./DefaultVertexAttributeLocations ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ../../../webgl/enums".split(" "),function(x,r,k,a,b,c,t,n,f){return function(){function f(f,q,B,v){this._drawMode=4;this._count=f.indices[a.VertexAttrConstants.POSITION].length;var l=new Float32Array(this._count*
n.getStride(q)/4);B?B(f,void 0,void 0,null,q,l,0):k.fillInterleaved(f,void 0,void 0,null,q,l,0);this._rctx=v;this._vao=new c(v,b.Default3D,{geometry:q},{geometry:t.createVertex(v,35044,l)})}f.prototype.enablePointRendering=function(a){this._drawMode=a?0:4};f.prototype.render=function(a){var b=this._rctx;b.bindVAO(this._vao);n.assertCompatibleVertexAttributeLocations(this._vao,a);b.drawArrays(this._drawMode,0,this._count)};return f}()})},"esri/views/3d/webgl-engine/materials/internal/MaterialUtil":function(){define("require exports ../../lib/IdGen ../../lib/gl-matrix ../../lib/ComponentUtils ../../lib/Util ../../parts/Model ../../lib/screenSizePerspectiveUtils ../../../../webgl/Util ../../../support/aaBoundingBox".split(" "),
function(x,r,k,a,b,c,t,n,f,q){function l(a,b,c,f,p,e){if(void 0===p||3!==e)for(p=0;p<e;++p)c[f+p]=a[b+p];else{var d=a[b],g=a[b+1];a=a[b+2];c[f]=p[0]*d+p[4]*g+p[8]*a+p[12];c[f+1]=p[1]*d+p[5]*g+p[9]*a+p[13];c[f+2]=p[2]*d+p[6]*g+p[10]*a+p[14]}return e}function y(a,b,c,f,p,e){for(var d=a.length,g=0;g<d;++g){for(var h=c*a[g],l=0;l<c;++l)f[p+l]=b[h+l];p+=e}}function B(a,b,c,f,p,e){f=new Uint8Array(f.buffer);p*=4;e*=4;var d=a.length;if(4===c)for(c=0;c<d;++c){var g=4*a[c];f[p]=b[g];f[p+1]=b[g+1];f[p+2]=b[g+
2];f[p+3]=b[g+3];p+=e}else if(3===c)for(c=0;c<d;++c)g=3*a[c],f[p]=b[g],f[p+1]=b[g+1],f[p+2]=b[g+2],f[p+3]=255,p+=e}function v(a,b,c,f,p){var e=D(b,c,L);q.setMin(I,a.getBBMin());q.setMax(I,a.getBBMax());if(F(I,b,e,f)){var e=a.getPrimitiveIndices(),d=a.getIndices(),g=a.getPosition(),h=e?e.length:d.length/3;if(1E4<h&&(a=a.getChildren(),void 0!==a)){for(e=0;8>e;++e)void 0!==a[e]&&v(a[e],b,c,f,p);return}w(b,c,0,h,d,g,e,p)}}function w(b,c,h,f,p,e,d,g){var m=e.data,l=e.offsetIdx;e=e.strideIdx;var q=b[0],
n=b[1];b=b[2];var k=c[0]-q,t=c[1]-n;for(c=c[2]-b;h<f;h++){var v=d?d[h]:h,w=l+e*p[3*v],y=l+e*p[3*v+1],B=l+e*p[3*v+2],z=m[w],D=m[w+1],A=m[w+2],w=m[y]-z,F=m[y+1]-D,y=m[y+2]-A,r=m[B]-z,G=m[B+1]-D,B=m[B+2]-A,L=t*B-G*c,J=c*r-B*k,K=k*G-r*t,I=w*L+F*J+y*K,z=q-z,x=n-D,T=b-A,D=x*y-F*T,A=T*w-y*z,R=z*F-w*x;if(I>O){L=z*L+x*J+T*K;if(0>L||L>I)continue;J=k*D+t*A+c*R;if(0>J||L+J>I)continue}else if(I<-O){L=z*L+x*J+T*K;if(0<L||L<I)continue;J=k*D+t*A+c*R;if(0<J||L+J<I)continue}else continue;I=(r*D+G*A+B*R)/I;0<=I&&(L=
P,a.vec3d.set3(w,F,y,U),a.vec3d.set3(r,G,B,N),w=a.vec3d.normalize(a.vec3d.cross(U,N,L)),g(I,w,v))}}function D(b,c,h){return a.vec3d.set3(1/(c[0]-b[0]),1/(c[1]-b[1]),1/(c[2]-b[2]),h)}function F(a,b,c,f){var h=(a[0]-f-b[0])*c[0],e=(a[3]+f-b[0])*c[0],d=Math.min(h,e),h=Math.max(h,e),e=(a[1]-f-b[1])*c[1],g=(a[4]+f-b[1])*c[1],d=Math.max(d,Math.min(e,g)),h=Math.min(h,Math.max(e,g));if(d>h)return!1;e=(a[2]-f-b[2])*c[2];a=(a[5]+f-b[2])*c[2];d=Math.max(d,Math.min(e,a));h=Math.min(h,Math.max(e,a));return d<=
h}function G(a,b,c,f){if(void 0!==a)return c.aquire(a,b,f)}function p(a,b){void 0!==a&&b.release(a)}function z(a,b){b=b?z(b):{};for(var c in a){var f=a[c];f&&f.forEach&&(f=A(f));null==f&&c in b||(b[c]=f)}return b}function A(a){var b=[];a.forEach(function(a){return b.push(a)});return b}Object.defineProperty(r,"__esModule",{value:!0});var J=a.mat4d.create(),I=q.create(),K=c.VertexAttrConstants;r.__Material_idGen=new k;r.__GLMaterial_id=0;r.IDENTITY=a.mat4d.identity();r.fill=l;r.fillInterleaved=function(a,
b,c,p,l,e,d,g){for(var h=f.getStride(l)/4,q=0;q<l.length;q++){var n=l[q],k=d+n.offset/4,n=n.name,t=a.vertexAttr[n];if(null!=t&&(null==g||null!=g[n]))switch(n){case "uv0":y(a.indices[n],t.data,t.size,e,k,h);break;case "region":for(var n=a.indices[n],v=t.data,w=t.size,t=e,z=h,t=new Uint16Array(t.buffer),k=2*k,z=2*z,D=n.length,A=0;A<D;++A){for(var F=w*n[A],r=0;r<w;++r)t[k+r]=v[F+r];k+=z}break;case "color":if(p&&p.color)if(n=a.indices[n],v=t.data,w=p.color,A=t.size,t=e,z=h,t=new Uint8Array(t.buffer),
k*=4,z*=4,D=n.length,4===A)for(A=0;A<D;++A)F=4*n[A],t[k]=v[F]*w[0],t[k+1]=v[F+1]*w[1],t[k+2]=v[F+2]*w[2],t[k+3]=v[F+3]*w[3],k+=z;else{if(3===A)for(r=255*w[3],A=0;A<D;++A)F=3*n[A],t[k]=v[F]*w[0],t[k+1]=v[F+1]*w[1],t[k+2]=v[F+2]*w[2],t[k+3]=r,k+=z}else B(a.indices[n],t.data,t.size,e,k,h);break;case "symbolColor":B(a.indices[n],t.data,t.size,e,k,h);break;default:if(w=n===K.POSITION?b:n===K.NORMAL?c:void 0,void 0!==w&&3===t.size)for(n=a.indices[n],v=t.data,t=e,z=h,D=n.length,A=0;A<D;++A){var G=3*n[A],
F=v[G],r=v[G+1],G=v[G+2];t[k]=w[0]*F+w[4]*r+w[8]*G+w[12];t[k+1]=w[1]*F+w[5]*r+w[9]*G+w[13];t[k+2]=w[2]*F+w[6]*r+w[10]*G+w[14];k+=z}else y(a.indices[n],t.data,t.size,e,k,h)}}};r.triangleVertexArrayToWireframeLines=function(a,b,c,f){for(c=Math.floor(c/3)-1;0<=c;c--){var h=b+3*c*f,e=b+6*c*f+5*f;l(a,h,a,e,null,f);e-=f;l(a,h+f,a,e,null,f);e-=f;l(a,h+f,a,e,null,f);e-=f;l(a,h+2*f,a,e,null,f);e-=f;l(a,h+2*f,a,e,null,f);e-=f;l(a,h,a,e,null,f)}};r.intersectTriangleGeometry=function(a,f,h,p,l,e,d){c.assert("triangle"===
a.data.primitiveType);f=f.componentVisibilities;p=p.tolerance;var g=a.getBoundingInfo();if(1<a.getComponentCount()){if(h=D(l,e,L),q.setMin(I,g.getBBMin()),q.setMax(I,g.getBBMax()),F(I,l,h,p))for(var m=a.data,g=a.getComponentCount(),n=m.getIndices(K.POSITION),k=m.getAttribute(K.POSITION),m=m.componentOffsets,t=0;t<g;t++)if(b.getVisibility(f,t)){var y=a.getComponentAABB(t,I);F(y,l,h,p)&&w(l,e,m[t]/3,m[t+1]/3,n,k,void 0,d)}}else b.getVisibility(f,0)&&v(g,l,e,p,d)};var L=a.vec3d.create(),O=Math.pow(2,
-52),P=a.vec3d.create(),U=a.vec3d.create(),N=a.vec3d.create();r.transformToWorld=function(b,c,h){return a.vec4d.set4(b[0]-c[0],b[1]-c[1],b[2]-c[2],1,h)};r.transformToView=function(b,c,h,f){a.mat4d.translate(h,c,J);h=J;return a.mat4d.multiplyVec4(h,b,f)};r.transformToProjection=function(b,c,h,f){f[0]=b[0]+h[0];f[1]=b[1]+h[1];f[2]=b[2]+h[2];f[3]=b[3];return a.mat4d.multiplyVec4(c,f)};r.transformToNDC=function(b,c){return a.vec4d.scale(b,1/Math.abs(b[3]),c)};r.applyScreenSizePerspectiveScale=function(a,
b,c,f,p){return n.scale(a,f,c,p)};r.verticalOffsetAtDistance=function(a,b,h,f,p){var e=h.screenLength||0;p&&(e=n.scale(e,f,b,p));return c.clamp(e*Math.tan(.5*a.fovY)/(.5*a.fullHeight)*b,h.minWorldLength||0,null!=h.maxWorldLength?h.maxWorldLength:Infinity)};r.basicMaterialConstructor=function(a,b){var h=!0,f=!1,p=0,e=r.__Material_idGen.gen(b);a.getId=function(){return e};var d;a.getParentStage=function(){return d};a.addParentStage=function(a){c.assert(void 0===d,"Material can only be added to a single Stage");
d=a};a.removeParentStage=function(a){d=void 0};a.setVisible=function(d){h!==d&&(h=d,a.notifyDirty("matChanged"))};a.isVisible=function(){return h};a.setRenderOccluded=function(d){f!==d&&(f=d,a.notifyDirty("matChanged"))};a.isRenderOccluded=function(){return f};a.notifyDirty=function(b){d&&d.notifyDirty(t.ContentType.MATERIAL,a,b)};a.setRenderPriority=function(a){p=a;this.notifyDirty("matChanged")};a.getRenderPriority=function(){return p}};r.aquireIfNotUndefined=G;r.releaseIfNotUndefined=p;var R=a.mat4.create();
r.bindView=function(b,c,h){a.mat4d.translate(c,b,R);h.setUniform3fv("localOrigin",b);h.setUniformMatrix4fv("view",R)};r.bindCamPos=function(a,b,c){c.setUniform3f("camPos",b[3]-a[0],b[7]-a[1],b[11]-a[2])};r.bindVerticalOffset=function(a,b,c){if(a){var h=b.fovY;b=b.viewport[3];var f=void 0;void 0===f&&(f=S);f.screenLength=a.screenLength;f.perDistance=Math.tan(.5*h)/(.5*b);f.minWorldLength=a.minWorldLength;f.maxWorldLength=a.maxWorldLength;a=f;c.setUniform4f("verticalOffset",a.screenLength,a.perDistance,
a.minWorldLength,a.maxWorldLength)}};r.bindScreenSizePerspective=function(a,b,c){void 0===c&&(c="screenSizePerspectiveAlignment");if(a){var h=a.parameters;b.setUniform4f(c,h.divisor,h.offset,h.minPixelSize,a.paddingPixelsOverride)}};r.basicGLMaterialConstructor=function(a,b){var c=r.__GLMaterial_id++;a.getId=function(){return c};a.getMaterialId=function(){return b.getId()};a.isVisible=function(){return b.isVisible()};a.isRenderOccluded=function(){return b.isRenderOccluded()};a.getRenderPriority=function(){return b.getRenderPriority()}};
r.singleTextureGLMaterialConstructor=function(a,b,c,f){var h=G(c.textureId,c.initTexture,b,f);a.updateTexture=function(a){c.textureId!==a&&(p(c.textureId,b),c.textureId=a,h=G(c.textureId,c.initTexture,b,f))};a.renderTexture=function(a){(a=b.getTexture(c.textureId))&&a.dirty&&a.redraw&&a.redraw()};a.bindTexture=function(a,d){void 0!==h&&(d.setUniform1i("tex",0),a.bindTexture(h.getGLTexture()))};a.bindTextureSize=function(a,d){void 0!==h&&(a=h.getGLTexture(),d.setUniform2f("texSize",a.descriptor.width,
a.descriptor.height))};a.dispose=function(){p(c.textureId,b)}};r.multiTextureGLMaterialConstructor=function(a,b,c,f){for(var h=f.length,e=Array(h),d=0;d<h;d++)e[d]=G(c[f[d][0]],c[f[d][1]],b);a.updateTextures=function(a){for(var d=0;d<h;d++){var g=c[f[d][0]],l=a[f[d][0]];g!==l&&(p(g,b),c[f[d][0]]=l,e[d]=G(l,c[f[d][1]],b))}};a.bindTextures=function(a,d){for(var b=0;b<h;b++)void 0!==e[b]&&(d.setUniform1i(f[b][2],b),a.bindTexture(e[b].getGLTexture(),b));a.setActiveTexture(0)};a.bindOneTexture=function(a,
d,b){d.setUniform1i(f[b][2],b);a.bindTexture(e[b].getGLTexture(),b);a.setActiveTexture(0)};a.disposeTextures=function(){for(var a=0;a<h;a++)p(c[f[a][0]],b)}};r.copyParameters=z;r.updateParameters=function(a,b){var c=!1,f;for(f in b){var p=b[f];void 0!==p&&(c=!0,Array.isArray(p)?a[f]=p.slice():a[f]=p)}return c};r.colorMixModes={multiply:1,ignore:2,replace:3,tint:4};var S={screenLength:0,perDistance:0,minWorldLength:0,maxWorldLength:0}})},"esri/views/3d/webgl-engine/parts/Model":function(){define("require exports dojo/string ../lib/ModelContentType ../lib/ModelDirtySet ../lib/RenderGeometry ../lib/Util ../lib/gl-matrix".split(" "),
function(x,r,k,a,b,c,t,n){var f=t.assert,q=n.vec3d,l=n.mat4d,y=t.logWithBase;return function(){function n(){this.dirtySet=new b(this);this._uniqueIdx=0;this._id2origin={};this.content={};for(var c in a)this.content[a[c]]={}}n.prototype.getAll=function(a){a=this.content[a];f(void 0!==a);return a};n.prototype.get=function(a,b){return this.getAll(a)[b]};n.prototype.add=function(b,c){var l=this.content[b];f(void 0!==l);var q=c.getId();f(null==l[q],"Model/Stage already contains object to be added");l[q]=
c;b===a.LAYER&&this.notifyDirty(b,c,"layerAdded")};n.prototype.remove=function(b,c){var l=this.content[b];f(void 0!==l);var q=l[c];f(void 0!==q,"Model/Stage doesn't contain object to be removed");delete l[c];b===a.TEXTURE&&q.unload();b===a.LAYER&&this.notifyDirty(b,q,"layerRemoved");return q};n.prototype.getDirtySet=function(){return this.dirtySet};n.prototype.notifyDirty=function(a,b,c,f){this.dirtySet.handleUpdate(b,c,f)};n.prototype.getOrigin=function(a,b,c){void 0===c&&(c=10);var f=0;b=b*c/1E4;
1<b&&(f=Math.ceil(y(b,2)));b=1E4*Math.pow(2,f);c=Math.round(a[0]/b);var l=Math.round(a[1]/b);a=Math.round(a[2]/b);var f=f+"_"+c+"_"+l+"_"+a,p=this._id2origin[f];null==p&&(p={vec3:q.createFrom(c*b,l*b,a*b),id:f},this._id2origin[f]=p);return p};n.prototype.getGeometryRenderGeometries=function(a,b,f){var q=a.getId(),n=b.geometry,p=n.getData(),k=!!n.singleUse,t=b.materials,v=b.instanceParameters,w=a.getCombinedStaticTransformation(b),y=l.maxScale(w),B=b.origin,n=n.getBoundingInfo(),D=b.getId(),r=this._uniqueIdx++;
a=new c(p,n,t[0],w,b.customTransformation,y,a.getCastShadow(),k,q,D,r);a.origin=B||this.getOrigin(a.center,a.bsRadius);a.instanceParameters=v;f.push(a)};n.prototype.updateRenderGeometryTransformation=function(a,b,c){a.getCombinedStaticTransformation(b,c.transformation);c.updateTransformation(c.transformation)};n.prototype.formatDebugInfo=function(b){var c=[];if(b){c[0]="\x3ctable\x3e";for(var f in a)b=a[f],c[0]+="\x3ctr\x3e\x3ctd\x3e"+b+'\x3c/td\x3e\x3ctd style\x3d"text-align: right"\x3e'+Object.keys(this.getAll(b)).length+
"\x3c/td\x3e\x3c/tr\x3e";c[0]+="\x3c/table\x3e";c[1]=this.dirtySet.formatDebugInfo(!0)}else{c[0]="";for(f in a)b=a[f],c[0]+=k.pad(String(Object.keys(this.getAll(b)).length),6," ")+" "+b+", ";c[1]=this.dirtySet.formatDebugInfo(!1)}return c};n.prototype.validateContent=function(){var b=this.getAll(a.OBJECT),c;for(c in b)this.validateObject(b[c]);var b=this.getAll(a.LAYER),f;for(f in b)this.validateLayer(b[f]);f=this.getAll(a.MATERIAL);for(var l in f)this.validateMaterial(f[l])};n.prototype.validateObject=
function(b){b=b.geometryRecords;for(var c=0;c<b.length;++c){var l=b[c];f(null!=this.get(a.GEOMETRY,l.geometry.id));f(1===l.materials.length,"object materials do not match geometry groups");f(null!=this.get(a.MATERIAL,l.materials[0].getId()))}};n.prototype.validateLayer=function(b){b=b.getObjects();for(var c=0;c<b.length;++c){var l=this.get(a.OBJECT,b[c].getId());f(null!=l)}};n.prototype.validateMaterial=function(b){b=b.getAllTextureIds();for(var c=0;c<b.length;++c){var l=this.get(a.TEXTURE,b[c]);
f(null!=l)}};n.ContentType=a;return n}()})},"esri/views/3d/webgl-engine/lib/ModelDirtySet":function(){define(["require","exports","./ModelContentType","./ModelDirtyTypesTs","./Util"],function(x,r,k,a,b){var c=b.objectEmpty,t=b.assert;return function(){function a(a){this._residentGeomRecords={};this._dirtyGeomRecords={};this._dirtyMaterials={};this._model=a}Object.defineProperty(a.prototype,"residentLayerCount",{get:function(){return Object.keys(this._residentGeomRecords).length},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"residentObjectCount",{get:function(){var a=0,b;for(b in this._residentGeomRecords)a+=Object.keys(this._residentGeomRecords[b]).length;return a},enumerable:!0,configurable:!0});a.prototype._getResidentGeometryRecords=function(){return this._residentGeomRecords};a.prototype._getDirtyGeometryRecords=function(){return this._dirtyGeomRecords};a.prototype.getDirtyMaterials=function(){return c(this._dirtyMaterials)?null:this._dirtyMaterials};a.prototype.clearDirtyMaterials=
function(){this._dirtyMaterials={}};a.prototype.hasDirtyGeometryRecords=function(){for(var a in this._dirtyGeomRecords)for(var b in this._dirtyGeomRecords[a]){var l=this._dirtyGeomRecords[a][b];if(l&&!c(l))return!0}return!1};a.prototype.handleUpdate=function(a,b,c){t(this[b],"ModelDirtySet doesn't know how to process "+b);return this[b](a,c)};a.prototype.shaderTransformationChanged=function(a){if(a=this._residentGeomRecords[a.getId()])for(var b in a){var c=this._model.content[k.OBJECT][b];if(c&&c.hasVolativeTransformation()){var c=
a[b],f;for(f in c)for(var n=0,t=c[f][1];n<t.length;n++)t[n].shaderTransformationChanged()}}};a.prototype.getAddRemoveUpdateList=function(a){return this.getAddRemoveUpdateListFilteredByLayers(Object.keys(this._dirtyGeomRecords),a)};a.prototype.getAddRemoveUpdateListFilteredByLayers=function(a,b){for(var f=[],q=[],n=[],v=0;v<a.length;v++){var w=a[v];if(w in this._dirtyGeomRecords){for(var D in this._dirtyGeomRecords[w]){var F=this._dirtyGeomRecords[w][D];if(F){var r=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,
w,D),p;for(p in F){var z=F[p],A=z[0],J=z[1],z=z[2],I=J&2&&z&1;if(J&4||I){var K=r[p];K?q.push.apply(q,K[1]):4===J&&t(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid remove");b&&K&&delete r[p]}if(J&1||I){var K=[A,[]],L=this._model.get(k.OBJECT,D);this._model.getGeometryRenderGeometries(L,A,K[1]);f.push.apply(f,K[1]);b&&(r[p]=K)}if(J&2&&!I)if(K=r[p],L=this._model.get(k.OBJECT,D),K){J=K[1];I=J.length;if(z&16)for(K=0;K<I;K++){var O=J[K];this._model.updateRenderGeometryTransformation(L,A,O)}for(K=
0;K<I;K++)O=J[K],n.push({renderGeometry:O,updateType:z})}else t(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid update")}c(r)&&delete this._residentGeomRecords[w][D]}}c(this._residentGeomRecords[w])&&delete this._residentGeomRecords[w]}b&&delete this._dirtyGeomRecords[w]}return[f,q,n]};a.prototype.getResidentRenderGeometries=function(){return this.getResidentRenderGeometriesFilteredByLayers(Object.keys(this._residentGeomRecords))};a.prototype.getResidentRenderGeometriesFilteredByLayers=
function(a){for(var b=[],c=0;c<a.length;c++){var f=a[c];if(f in this._residentGeomRecords)for(var n in this._residentGeomRecords[f]){var k=this._residentGeomRecords[f][n];if(k)for(var t in k)b.push.apply(b,k[t][1])}}return b};a.prototype.componentVisibilityChanged=function(a,b,c){if(null!=b)this._componentPropertyChanged(a,b,c,2);else{b=0;for(var f=a.getGeometryRecords();b<f.length;b++)this._componentPropertyChanged(a,f[b],c,2)}};a.prototype.componentHighlightChanged=function(a,b,c){if(null!=b)this._componentPropertyChanged(a,
b,c,32);else{b=0;for(var f=a.getGeometryRecords();b<f.length;b++)this._componentPropertyChanged(a,f[b],c,32)}};a.prototype.vertexAttrsUpdated=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,2,0,0,2,5,4)};a.prototype.colorAttrsUpdated=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,2,0,0,2,5,8)};a.prototype.matChanged=function(a){this._dirtyMaterials[a.getId()]=!0};a.prototype.layerAdded=function(a){for(var b=a.getObjects(),c=0;c<b.length;c++)this.layObjectAdded(a,b[c])};a.prototype.layerRemoved=
function(a){for(var b=a.getObjects(),c=0;c<b.length;c++)this.layObjectRemoved(a,b[c])};a.prototype.layObjectAdded=function(a,b){a=a.getId();for(var c=b.getGeometryRecords(),f=0;f<c.length;f++)this.objGeometryAdded(b,c[f],a)};a.prototype.layObjectRemoved=function(a,b){a=a.getId();for(var c=b.getGeometryRecords(),f=0;f<c.length;f++)this.objGeometryRemoved(b,c[f],a)};a.prototype.layObjectReplaced=function(a,b){this.layObjectRemoved(a,b[0]);this.layObjectAdded(a,b[1])};a.prototype.objDirty=function(a,
b){b=b||this._getParentLayerId(a);var c=a.getId(),c=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,b,c),f;for(f in c)this._updateOrCreateDirtyRecord(a,c[f][0],b,2,0,2,0,5,1)};a.prototype.objTransformation=function(a,b){b=b||this._getParentLayerId(a);var c=a.getId(),c=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,b,c),f;for(f in c)this._updateOrCreateDirtyRecord(a,c[f][0],b,2,0,0,2,5,16)};a.prototype.objGeometryAdded=function(a,b,c){this._updateOrCreateDirtyRecord(a,
b,c,1,4,0,0,0)};a.prototype.objGeometryRemoved=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,4,1,2,0,0)};a.prototype.objGeometryReplaced=function(a,b){this.objGeometryRemoved(a,b[0]);this.objGeometryAdded(a,b[1])};a.prototype.objGeometryTransformation=function(a,b){this.objGeometryReplaced(a,b)};a.prototype._componentPropertyChanged=function(a,b,c,n){this._updateOrCreateDirtyRecord(a,b,c,2,0,0,2,5,n)};a.prototype._updateOrCreateDirtyRecord=function(a,b,c,n,k,v,w,D,F){c=c||this._getParentLayerId(a);
var f=a.getId();a=b.getId();c=this._createObjectRecordObjIfNonexistent(this._dirtyGeomRecords,c,f);(f=c[a])?(b=f[1],b&k?delete c[a]:b&v?(f[1]=n,f[2]=F):b&w?f[2]|=F:b&D||t(!1,"ModelDirtySet.objGeometryAdded: inconsistent state")):c[a]=[b,n,F]};a.prototype._createObjectRecordObjIfNonexistent=function(a,b,c){a[b]||(a[b]={});a[b][c]||(a[b][c]={});return a[b][c]};a.prototype._getParentLayerId=function(a){return a.parentLayer.id};a.prototype.formatDebugInfo=function(a){var b=["ADD","UPD",void 0,"REM"];
if(a)return"";a="";for(var c in this._dirtyGeomRecords)for(var f in this._dirtyGeomRecords[c]){var n=this._dirtyGeomRecords[c][f];if(n){0<a.length&&(a+="\n");a+=c+"."+f;var k=[],t;for(t in n){var D=n[t][1];k[D]||(k[D]=[]);k[D].push(n[t][0].geometry.id)}for(n=0;n<k.length;n++)if(k[n])for(a+=" "+b[n-1]+": ",D=0;D<k[n].length;D++)a+=k[n][D]+", "}}return a};return a}()})},"esri/views/3d/webgl-engine/lib/ModelDirtyTypesTs":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",
{value:!0})})},"esri/views/3d/webgl-engine/lib/RenderGeometry":function(){define(["require","exports","./gl-matrix"],function(x,r,k){var a=k.vec3d,b=k.mat4d;return function(){function c(b,c,f,q,l,k,B,v,w,D,F){this.shaderTransformationDirty=!0;this.data=b.toRenderData();this.componentOffsets=b.componentOffsets;this.boundingInfo=c;this.material=f;this.origin=null;this.center=a.create();this.bsRadius=0;this.transformation=null;this.calculateShaderTransformation=l;q&&this.updateTransformation(q,k);this.castShadow=
B;this.singleUse=v;this.name=w;this.uniqueName=D;this.idx=F;this.canBeMerged=!0;this.instanceParameters={}}c.prototype.updateTransformation=function(a,b){this.transformation=a;this.shaderTransformationDirty=!0;this.bsRadius=this.getBoundingSphere(a,b,this.center)};c.prototype.shaderTransformationChanged=function(){this.shaderTransformationDirty=!0};c.prototype.getBoundingSphere=function(a,c,f){c=c||b.maxScale(a);b.multiplyVec3(a,this.boundingInfo.getCenter(),f);return this.boundingInfo.getBSRadius()*
c};Object.defineProperty(c.prototype,"hasShaderTransformation",{get:function(){return!!this.calculateShaderTransformation},enumerable:!0,configurable:!0});c.prototype.getShaderTransformation=function(){return this.calculateShaderTransformation?(this.shaderTransformationDirty&&(this.shaderTransformation||(this.shaderTransformation=b.create()),b.set(this.calculateShaderTransformation(this.transformation),this.shaderTransformation),this.shaderTransformationDirty=!1),this.shaderTransformation):this.transformation};
return c}()})},"esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":function(){define(["require","exports","./Util"],function(x,r,k){function a(a){return Math.abs(a*a*a)}function b(b,c,f,q){void 0===q&&(q=l);var n=f.parameters;f=f.paddingPixelsOverride;q.scale=Math.min(n.divisor/(c-n.offset),1);q.factor=a(b);q.minPixelSize=n.minPixelSize;q.paddingPixels=f;return q}function c(a,b){return 0===a?b.minPixelSize:b.minPixelSize*(1+2*b.paddingPixels/a)}function t(a,b){return Math.max(k.lerp(a*b.scale,
a,b.factor),c(a,b))}function n(a,c,f){a=b(a,c,f);a.minPixelSize=0;a.paddingPixels=0;return t(1,a)}Object.defineProperty(r,"__esModule",{value:!0});r.getSettings=function(a){return new f(a,r.defaultDescription)};r.getLabelSettings=function(a){var b=r.defaultDescription.curvatureDependent;return new f(a,{curvatureDependent:{min:{curvature:b.min.curvature,tiltAngle:b.min.tiltAngle,scaleFallOffFactor:q.curvatureDependent.min.scaleFallOffFactor},max:{curvature:b.max.curvature,tiltAngle:b.max.tiltAngle,
scaleFallOffFactor:q.curvatureDependent.max.scaleFallOffFactor}},scaleStart:r.defaultDescription.scaleStart,scaleFallOffRange:r.defaultDescription.scaleFallOffRange,minPixelSize:q.minPixelSize})};r.perspectiveFactor=a;r.scaleFactor=b;r.applyScaleFactor=t;r.applyScaleFactorVec2=function(a,b,f){void 0===f&&(f=[0,0]);var l=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);f[0]=k.lerp(a[0]*l,a[0],b.factor);f[1]=k.lerp(a[1]*l,a[1],b.factor);return f};r.precomputeScale=n;r.precomputeScaleFactor=function(a,b,
c,f){f.scale=n(a,b,c);f.factor=0;f.minPixelSize=c.parameters.minPixelSize;f.paddingPixels=c.paddingPixelsOverride;return f};r.applyPrecomputedScaleFactorVec2=function(a,b,f){void 0===f&&(f=[0,0]);b=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);f[0]=a[0]*b;f[1]=a[1]*b;return f};r.scale=function(a,c,f,l){return t(a,b(c,f,l))};var f=function(){function a(a,b,c,f){void 0===c&&(c={camera:{distance:0,fovY:0},divisor:0,offset:0,minPixelSize:0,paddingPixels:0});this.viewingMode=a;this.description=b;this.parameters=
c;this._paddingPixelsOverride=f;"local"===this.viewingMode?(this.coverageCompensation=this.surfaceCoverageCompensationLocal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersLocal):(this.coverageCompensation=this.surfaceCoverageCompensationGlobal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersGlobal)}Object.defineProperty(a.prototype,"paddingPixelsOverride",{get:function(){return this._paddingPixelsOverride||this.parameters.paddingPixels},
enumerable:!0,configurable:!0});a.prototype.update=function(a){if(this.parameters&&this.parameters.camera.fovY===a.fovY&&this.parameters.camera.distance===a.distance)return!1;this.calculateParameters(a,this.parameters);return!0};a.prototype.overridePadding=function(b){return b!==this.paddingPixelsOverride?new a(this.viewingMode,this.description,this.parameters,b):this};a.prototype.calculateParameters=function(a,b){var c=this.description,f=c.scaleStart,p=c.scaleFallOffRange,c=c.minPixelSize,l=a.fovY,
q=a.distance,n=this.calculateCurvatureDependentParameters(a),k=this.coverageCompensation(a,n),t=n.tiltAngle,n=n.scaleFallOffFactor,q=Math.sin(t)*q,t=.5*Math.PI-t-l*(.5-f*k),f=q/Math.cos(t),p=(f-q/Math.cos(t+l*p*k)*n)/(1-n);b.camera.fovY=a.fovY;b.camera.distance=a.distance;b.offset=p;b.divisor=f-p;b.minPixelSize=c;return b};a.prototype.calculateCurvatureDependentParametersLocal=function(a,b){void 0===b&&(b=y);b.tiltAngle=this.description.curvatureDependent.min.tiltAngle;b.scaleFallOffFactor=this.description.curvatureDependent.min.scaleFallOffFactor;
return b};a.prototype.calculateCurvatureDependentParametersGlobal=function(a,b){void 0===b&&(b=y);var c=this.description.curvatureDependent;a=1+a.distance/B;var f=[c.min.curvature,c.max.curvature],p=f[0];a=k.clamp((Math.sqrt(a*a-1)-p)/(f[1]-p),0,1);f=[c.min,c.max];c=f[0];f=f[1];b.tiltAngle=k.lerp(c.tiltAngle,f.tiltAngle,a);b.scaleFallOffFactor=k.lerp(c.scaleFallOffFactor,f.scaleFallOffFactor,a);return b};a.prototype.surfaceCoverageCompensationLocal=function(a,b){return(a.fovY-b.tiltAngle)/a.fovY};
a.prototype.surfaceCoverageCompensationGlobal=function(a,b){var c=B*B;b=b.tiltAngle+.5*Math.PI;var f=a.fovY;a=a.distance;a=a*a+c-2*Math.cos(b)*a*B;var p=Math.sqrt(a);return(Math.acos(Math.sqrt(a-c)/p)-Math.asin(B/(p/Math.sin(b)))+.5*f)/f};return a}();r.defaultDescription={curvatureDependent:{min:{curvature:k.deg2rad(10),tiltAngle:k.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:k.deg2rad(70),tiltAngle:k.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0};var q=
{curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14};r.copyParameters=function(a,b){b.camera.distance=a.camera.distance;b.camera.fovY=a.camera.fovY;b.divisor=a.divisor;b.offset=a.offset;b.minPixelSize=a.minPixelSize;return b};var l={scale:0,factor:0,minPixelSize:0,paddingPixels:0},y={tiltAngle:0,scaleFallOffFactor:0},B=6378137})},"esri/views/webgl/Util":function(){define(["require","exports","../../core/tsSupport/assignHelper","../../core/Error"],function(x,
r,k,a){return function(){function b(){}b.vertexCount=function(a,k){return a.vertexBuffers[k].size/b.getStride(a.layout[k])};b.getStride=function(a){return a[0].stride};b.getBytesPerElement=function(a){switch(a){case 5126:return 4;case 5124:return 4;case 5125:return 4;case 5122:return 2;case 5123:return 2;case 5120:return 1;case 5121:return 1;default:throw Error("Unknown data type");}};b.addDescriptor=function(a,k,n,f,q,l){var c=b.getBytesPerElement(f);if(0<a.length){var t=a[0].stride,v=t+c*n;a.forEach(function(a){return a.stride=
v});a.push({name:k,count:n,type:f,offset:t,stride:v,normalized:q,divisor:l})}else a.push({name:k,count:n,type:f,offset:0,stride:c*n,normalized:q,divisor:l})};b.assertCompatibleVertexAttributeLocations=function(a,b){(a=a.locations===b.locations)||console.error("VertexAttributeLocations are incompatible");return a};b.hasAttribute=function(a,b){for(var c=0;c<a.length;c++)if(a[c].name===b)return!0;return!1};b.findAttribute=function(a,b){for(var c=0;c<a.length;c++)if(a[c].name===b)return a[c];return null};
b.copyFramebufferToTexture=function(a,b,n,f,q){void 0===q&&(q=0);var c=a.getBoundFramebufferObject(),k=a.getBoundTexture(0);a.bindFramebuffer(b);a.bindTexture(n,0);a.gl.copyTexImage2D(a.gl.TEXTURE_2D,q,n.descriptor.pixelFormat,f[0],f[1],f[2],f[3],0);a.gl.flush();a.bindFramebuffer(c);a.bindTexture(k,0)};b.assert=function(b,k){if(!b)throw new a(k);};b.setBaseInstanceOffset=function(a,b){var c={},f;for(f in a)c[f]=a[f].map(function(a){return a.divisor?k({},a,{baseInstance:b}):a});return c};return b}()})},
"esri/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.Default3D={position:0,normal:1,uv0:2,color:3,instanceColor:3,size:4,auxpos1:5,symbolColor:5,auxpos2:6,featureAttribute:6,instanceFeatureAttribute:6,region:7,model:8,modelNormal:12}})},"esri/views/webgl/VertexArrayObject":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c,t,n){this._locations=
this._layout=this._glName=this._context=null;this._indexBuffer=this._buffers=void 0;this._initialized=!1;this._context=a;this._layout=c;this._buffers=t;this._locations=b;n&&(this._indexBuffer=n);this._id=k._nextId++}Object.defineProperty(k.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"vertexBuffers",{get:function(){return this._buffers},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"indexBuffer",{get:function(){return this._indexBuffer},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"layout",{get:function(){return this._layout},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"locations",{get:function(){return this._locations},enumerable:!0,configurable:!0});k.prototype.dispose=function(a){void 0===a&&(a=!0);if(this._context){var b=this._context.extensions.vao;b&&this._glName&&
(b.deleteVertexArrayOES(this._glName),this._glName=null);this._context.getBoundVAO()===this&&this._context.bindVAO(null);if(a){for(var c in this._buffers)this._buffers[c].dispose(),delete this._buffers[c];this._indexBuffer&&(this._indexBuffer.dispose(),this._indexBuffer=null)}this._context=null}};k.prototype.initialize=function(){if(!this._initialized){var a=this._context.extensions.vao;if(a){var b=a.createVertexArrayOES();a.bindVertexArrayOES(b);this._bindLayout();a.bindVertexArrayOES(null);this._glName=
b}this._initialized=!0}};k.prototype.bind=function(){this.initialize();var a=this._context.extensions.vao;a?a.bindVertexArrayOES(this.glName):(this._context.bindVAO(null),this._bindLayout())};k.prototype._bindLayout=function(){var a=this._buffers,b=this._context.extensions.vao,c=this._layout,k=this._indexBuffer;a||console.error("Vertex buffer dictionary is empty!");var n=this._context.gl,f,q,l=0,y;for(y in a)for((f=a[y])||console.error("Vertex buffer is uninitialized!"),(q=c[y])||console.error("Vertex element descriptor is empty!"),
this._context.bindBuffer(f),l=0;l<q.length;++l){f=q[l];var B=this._locations[f.name],v=f.baseInstance?f.baseInstance*f.stride:0;void 0===B&&console.error("There is no location for vertex attribute '"+f.name+"' defined.");f.baseInstance&&!f.divisor&&console.error("Vertex attribute '"+f.name+"' uses baseInstanceOffset without divisor.");if(4>=f.count){if(n.enableVertexAttribArray(B),n.vertexAttribPointer(B,f.count,f.type,f.normalized,f.stride,f.offset+v),f.divisor&&0<f.divisor){var w=this._context.extensions.angleInstancedArrays;
w&&w.vertexAttribDivisorANGLE(B,f.divisor)}}else if(16===f.count&&5126===f.type)for(var D=0;4>D;D++)n.enableVertexAttribArray(B+D),n.vertexAttribPointer(B+D,4,f.type,f.normalized,f.stride,f.offset+16*D+v),f.divisor&&0<f.divisor&&(w=this._context.extensions.angleInstancedArrays)&&w.vertexAttribDivisorANGLE(B+D,f.divisor);else console.error("Unsupported vertex attribute element count: "+f.count)}k&&(b?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,k.glName):this._context.bindBuffer(k))};k.prototype.unbind=function(){this.initialize();
var a=this._context.extensions.vao;a?a.bindVertexArrayOES(null):this._unbindLayout()};k.prototype._unbindLayout=function(){var a=this._buffers,b=this._layout,c=this._locations,k=this._context;a||console.error("Vertex buffer dictionary is empty!");var n=k.gl,f,q,l,y=0,B=0,v;for(v in a){(f=a[v])||console.error("Vertex buffer is uninitialized!");q=b[v];y=0;for(B=q.length;y<B;++y)l=q[y],n.disableVertexAttribArray(c[l.name]);k.unbindBuffer(f.bufferType)}(a=this._indexBuffer)&&k.unbindBuffer(a.bufferType)};
k._nextId=0;return k}()})},"esri/views/webgl/BufferObject":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c,t,n){this._glName=this._context=null;this._bufferType=void 0;this._usage=35044;this._size=-1;this._indexType=void 0;this._context=a;this._bufferType=b;this._usage=c;this._id=k._nextId++;this._glName=this._context.gl.createBuffer();t&&this.setData(t,n)}k.createIndex=function(a,b,c,t){return new k(a,34963,b,c,t)};k.createVertex=function(a,b,c){return new k(a,
34962,b,c)};Object.defineProperty(k.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"usage",{get:function(){return this._usage},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"bufferType",{get:function(){return this._bufferType},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"indexType",{get:function(){return this._indexType},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"byteSize",{get:function(){return 34962===this._bufferType?this._size:5125===this._indexType?4*this._size:2*this._size},enumerable:!0,configurable:!0});k.prototype.dispose=function(){this._context&&(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context=null)};k.prototype.setData=
function(a,b){if(a){if("number"===typeof a){if(0>a&&console.error("Buffer size cannot be negative!"),34963===this._bufferType&&b)switch(this._indexType=b,this._size=a,b){case 5123:a*=2;break;case 5125:a*=4}}else b=a.byteLength,a instanceof Uint16Array&&(b/=2,this._indexType=5123),a instanceof Uint32Array&&(b/=4,this._indexType=5125),this._size=b;b=this._context.getBoundVAO();this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferData(this._bufferType,a,this._usage);this._context.bindVAO(b)}};
k.prototype.setSubData=function(a,b,c,k){void 0===b&&(b=0);void 0===c&&(c=0);if(a){(0>b||b>=this._size)&&console.error("offset is out of range!");var n=b,f=c,q=k,l=a.byteLength;a instanceof Uint16Array&&(l/=2,n*=2,f*=2,q*=2);a instanceof Uint32Array&&(l/=4,n*=4,f*=4,q*=4);void 0===k&&(k=l-1);c>=k&&console.error("end must be bigger than start!");b+c-k>this._size&&console.error("An attempt to write beyond the end of the buffer!");b=this._context.getBoundVAO();this._context.bindVAO(null);this._context.bindBuffer(this);
this._context.gl.bufferSubData(this._bufferType,n,(a instanceof ArrayBuffer?a:a.buffer).slice(f,q));this._context.bindVAO(b)}};k._nextId=0;return k}()})},"esri/views/webgl/enums":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.BASE_TEXTURE_UNIT=33984})},"esri/views/3d/webgl-engine/lib/GeometryUtil":function(){define(["./GeometryData","./BufferVectorMath","./Util","./gl-matrix"],function(x,r,k,a){function b(a,b,f,l,q){if(Math.abs(c.dot(b,a))>
q)return!1;c.cross(a,b,f);c.normalize(f);c.cross(f,a,l);c.normalize(l);return!0}var c=a.vec3,t=a.vec4,n=a.vec3d,f=k.VertexAttrConstants,q=r.Vec3Compact,l=n.create(),y=n.create(),B={createSphereGeometry:function(a,b,l,q,n,p,t){a=a||50;q=void 0!==q?q:-Math.PI;n=void 0!==n?n:2*Math.PI;p=void 0!==p?p:.5*-Math.PI;t=void 0!==t?t:Math.PI;var v=Math.max(3,Math.floor(b)||8),y=Math.max(2,Math.floor(l)||6),w=(v+1)*(y+1);l=new Float32Array(3*w);b=new Float32Array(3*w);var w=new Float32Array(2*w),B,z,D=[],F=c.create(),
r=0;for(z=0;z<=y;z++){var G=[],R=z/y,S=p+R*t,T=Math.cos(S);for(B=0;B<=v;B++){var V=B/v,h=q+V*n,ca=Math.cos(h)*T*a,Q=Math.sin(S)*a,h=-Math.sin(h)*T*a;l[3*r]=ca;l[3*r+1]=Q;l[3*r+2]=h;c.set3(ca,Q,h,F);c.normalize(F);b[3*r]=F[0];b[3*r+1]=F[1];b[3*r+2]=F[2];w[2*r]=V;w[2*r+1]=R;G.push(r);++r}D.push(G)}a=new Uint32Array(2*v*(y-1)*3);for(z=r=0;z<y;z++)for(B=0;B<v;B++)q=D[z][B],n=D[z][B+1],p=D[z+1][B+1],t=D[z+1][B],0===z?(a[r++]=q,a[r++]=p,a[r++]=t):z===y-1?(a[r++]=q,a[r++]=n,a[r++]=p):(a[r++]=q,a[r++]=n,
a[r++]=p,a[r++]=p,a[r++]=t,a[r++]=q);k.assert(r===a.length);v={};v[f.POSITION]=a;v[f.NORMAL]=a;v[f.UV0]=a;y={};y[f.POSITION]={size:3,data:l};y[f.NORMAL]={size:3,data:b};y[f.UV0]={size:2,data:w};return new x(y,v)},createPolySphereGeometry:function(a,b,c){function l(b,c){b>c&&(b=c+(c=b,0));var f=b.toString()+"."+c.toString();if(k[f])return k[f];var h=p.length;p.length+=3;q.add(p,3*b,p,3*c,p,h);q.scale(p,h,a/q.length(p,h));h/=3;return k[f]=h}var n,p;c?(p=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],c=[0,
1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]):(c=a*(1+Math.sqrt(5))/2,p=[-a,c,0,a,c,0,-a,-c,0,a,-c,0,0,-a,c,0,a,c,0,-a,-c,0,a,-c,c,0,-a,c,0,a,-c,0,-a,-c,0,a],c=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);for(n=0;n<p.length;n+=3)q.scale(p,n,a/q.length(p,n));var k={};for(n=0;n<b;n++){for(var t=c.length,v=new Uint32Array(4*t),y=0;y<t;y+=3){var w=c[y],B=c[y+1],D=c[y+2],r=l(w,B),U=l(B,D),N=l(D,w),R=4*y;v[R]=w;v[R+
1]=r;v[R+2]=N;v[R+3]=B;v[R+4]=U;v[R+5]=r;v[R+6]=D;v[R+7]=N;v[R+8]=U;v[R+9]=r;v[R+10]=U;v[R+11]=N}c=v;k={}}b=new Float32Array(p);for(n=0;n<b;n+=3)q.normalize(b,n);p=new Float32Array(p);n={};n[f.POSITION]=c;n[f.NORMAL]=c;c={};c[f.POSITION]={size:3,data:p};c[f.NORMAL]={size:3,data:b};return new x(c,n)},createPointGeometry:function(a,b,c,l,q,p,n){var k=new Float32Array(3);k[0]=b?b[0]:0;k[1]=b?b[1]:0;k[2]=b?b[2]:0;b=new Float32Array(3);b[0]=a?a[0]:0;b[1]=a?a[1]:0;b[2]=a?a[2]:1;if(null==p)a=new Float32Array(2),
a[0]=0,a[1]=0;else{a=new Float32Array(p.length);for(var t=0;t<p.length;t++)a[t]=p[t]}p=new Uint8Array(4);p[0]=c?255*c[0]:255;p[1]=c?255*c[1]:255;p[2]=c?255*c[2]:255;p[3]=c&&3<c.length?255*c[3]:255;c=new Float32Array(2);c[0]=null!=l&&2==l.length?l[0]:1;c[1]=null!=l&&2==l.length?l[1]:1;if(null!=q){var v=new Float32Array(4);v[0]=q[0];v[1]=q[1];v[2]=q[2];v[3]=q[3]}if(null!=n){var y=new Float32Array(4);y[0]=n[0];y[1]=n[1];y[2]=n[2];y[3]=n[3]}t=new Uint32Array(1);t[0]=0;l={};l[f.POSITION]=t;l[f.NORMAL]=
t;l[f.UV0]=t;l[f.COLOR]=t;l[f.SIZE]=t;null!=q&&(l[f.AUXPOS1]=t);null!=n&&(l[f.AUXPOS2]=t);t={};t[f.POSITION]={size:3,data:k};t[f.NORMAL]={size:3,data:b};t[f.UV0]={size:a.length,data:a};t[f.COLOR]={size:4,data:p};t[f.SIZE]={size:2,data:c};null!=q&&(t[f.AUXPOS1]={size:4,data:v});null!=n&&(t[f.AUXPOS2]={size:4,data:y});return new x(t,l,x.DefaultOffsets,"point")},createPointArrayGeometry:function(a,b){for(var c=new Float32Array(3*a.length),l=new Float32Array(b?3*a.length:3),q=new Uint32Array(a.length),
p=new Uint32Array(a.length),n=0;n<a.length;n++)c[3*n]=a[n][0],c[3*n+1]=a[n][1],c[3*n+2]=a[n][2],b&&(l[3*n]=b[n][0],l[3*n+1]=b[n][1],l[3*n+2]=b[n][2]),q[n]=n,p[n]=0;b||(l[0]=0,l[1]=1,l[2]=0);a=new Float32Array(2);a[0]=0;a[1]=0;n={};n[f.POSITION]=q;n[f.NORMAL]=b?q:p;n[f.UV0]=p;b={};b[f.POSITION]={size:3,data:c};b[f.NORMAL]={size:3,data:l};b[f.UV0]={size:2,data:a};return new x(b,n,x.DefaultOffsets,"point")},createTriangleGeometry:function(){var a=new Float32Array(9);a[0]=0;a[1]=0;a[2]=0;a[3]=0;a[4]=
0;a[5]=100;a[6]=100;a[7]=0;a[8]=0;var b=new Uint32Array(3);b[0]=0;b[1]=1;b[2]=2;var c=new Float32Array(3);c[0]=0;c[1]=1;c[2]=0;var l=new Uint32Array(3);l[0]=0;l[1]=0;l[2]=0;var n=new Float32Array(2);n[0]=0;n[1]=0;var p=new Uint32Array(3);p[0]=0;p[1]=0;p[2]=0;var q={};q[f.POSITION]=b;q[f.NORMAL]=l;q[f.UV0]=p;b={};b[f.POSITION]={size:3,data:a};b[f.NORMAL]={size:3,data:c};b[f.UV0]={size:2,data:n};return new x(b,q)},createSquareGeometry:function(a){var b,c,l=new Float32Array(12);if(a)for(b=0;4>b;b++)for(c=
0;3>c;c++)l[3*b+c]=a[b][c];else l[0]=-1,l[1]=-1,l[2]=0,l[3]=1,l[4]=-1,l[5]=0,l[6]=1,l[7]=1,l[8]=0,l[9]=-1,l[10]=1,l[11]=0;c=new Uint32Array(6);c[0]=0;c[1]=1;c[2]=2;c[3]=2;c[4]=3;c[5]=0;a=new Float32Array(3);a[0]=0;a[1]=0;a[2]=1;var n=new Uint32Array(6);for(b=0;6>b;b++)n[b]=0;b=new Float32Array(8);b[0]=0;b[1]=0;b[2]=1;b[3]=0;b[4]=1;b[5]=1;b[6]=0;b[7]=1;var p=new Uint8Array(4);p[0]=255;p[1]=255;p[2]=255;p[3]=255;var q={};q[f.POSITION]=c;q[f.NORMAL]=n;q[f.UV0]=c;q[f.COLOR]=n;c={};c[f.POSITION]={size:3,
data:l};c[f.NORMAL]={size:3,data:a};c[f.UV0]={size:2,data:b};c[f.COLOR]={size:4,data:p};return new x(c,q)},createBoxGeometry:function(){var a,b,c=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],l=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],n=[0,0,1,0,1,1,0,1],p=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],q=Array(36);for(a=0;6>a;a++)for(b=0;6>b;b++)q[6*a+b]=a;var k=Array(36);for(a=0;6>a;a++)k[6*a+0]=0,k[6*a+1]=1,k[6*a+
2]=2,k[6*a+3]=2,k[6*a+4]=3,k[6*a+5]=0;return function(a){var b;Array.isArray(a)||(a=[a,a,a]);var t=new Float32Array(24);for(b=0;8>b;b++)t[3*b]=c[b][0]*a[0],t[3*b+1]=c[b][1]*a[1],t[3*b+2]=c[b][2]*a[2];a={};a[f.POSITION]=new Uint32Array(p);a[f.NORMAL]=new Uint32Array(q);a[f.UV0]=new Uint32Array(k);b={};b[f.POSITION]={size:3,data:t};b[f.NORMAL]={size:3,data:new Float32Array(l)};b[f.UV0]={size:2,data:new Float32Array(n)};return new x(b,a)}}(),createDiamondGeometry:function(){var a=[[-.5,0,-.5],[.5,0,
-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],b=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],c=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],l=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];return function(n){var p;Array.isArray(n)||(n=[n,n,n]);var q=new Float32Array(18);for(p=0;6>p;p++)q[3*p]=a[p][0]*n[0],q[3*p+1]=a[p][1]*n[1],q[3*p+2]=a[p][2]*n[2];n={};n[f.POSITION]=new Uint32Array(c);n[f.NORMAL]=new Uint32Array(l);p={};p[f.POSITION]={size:3,data:q};p[f.NORMAL]={size:3,data:new Float32Array(b)};
return new x(p,n)}}(),createTetrahedronGeometry:function(){var a=c.createFrom(-.5,0,-.5),b=c.createFrom(.5,0,-.5),l=c.createFrom(0,0,.5),n=c.createFrom(0,.5,0),q=c.create(),p=c.create(),k=c.create(),t=c.create(),y=c.create();c.subtract(a,n,q);c.subtract(a,b,p);c.cross(q,p,k);c.normalize(k,k);c.subtract(b,n,q);c.subtract(b,l,p);c.cross(q,p,t);c.normalize(t,t);c.subtract(l,n,q);c.subtract(l,a,p);c.cross(q,p,y);c.normalize(y,y);var B=[a,b,l,n],r=[0,-1,0,k[0],k[1],k[2],t[0],t[1],t[2],y[0],y[1],y[2]],
L=[0,1,2,3,1,0,3,2,1,3,0,2],O=[0,0,0,1,1,1,2,2,2,3,3,3];return function(a){var b;Array.isArray(a)||(a=[a,a,a]);var c=new Float32Array(12);for(b=0;4>b;b++)c[3*b]=B[b][0]*a[0],c[3*b+1]=B[b][1]*a[1],c[3*b+2]=B[b][2]*a[2];a={};a[f.POSITION]=new Uint32Array(L);a[f.NORMAL]=new Uint32Array(O);b={};b[f.POSITION]={size:3,data:c};b[f.NORMAL]={size:3,data:new Float32Array(r)};return new x(b,a)}}(),createConeGeometry:function(a,b,l,n){var q=0,p=c.createFrom(0,q,0),k=c.createFrom(0,q+a,0),t=c.createFrom(0,-1,
0),v=c.createFrom(0,1,0);n&&(q=a,k=c.createFrom(0,0,0),p=c.createFrom(0,q,0),t=c.createFrom(0,1,0),v=c.createFrom(0,-1,0));var p=[k,p],t=[t,v],v=l+2,y=0,k=Math.sqrt(a*a+b*b);if(n)for(n=l-1;0<=n;n--)y=2*Math.PI/l*n,w=c.createFrom(Math.cos(y)*b,q,Math.sin(y)*b),p.push(w),y=c.createFrom(a*Math.cos(y)/k,-b/k,a*Math.sin(y)/k),t.push(y);else for(n=0;n<l;n++){var y=2*Math.PI/l*n,w=c.createFrom(Math.cos(y)*b,q,Math.sin(y)*b);p.push(w);y=c.createFrom(a*Math.cos(y)/k,b/k,a*Math.sin(y)/k);t.push(y)}a=new Uint32Array(6*
(l+2));l=new Uint32Array(6*(l+2));q=b=0;for(n=3;n<p.length;n++)a[b++]=1,a[b++]=n-1,a[b++]=n,l[q++]=0,l[q++]=0,l[q++]=0;a[b++]=p.length-1;a[b++]=2;a[b++]=1;l[q++]=0;l[q++]=0;l[q++]=0;for(n=3;n<p.length;n++)a[b++]=n,a[b++]=n-1,a[b++]=0,l[q++]=n,l[q++]=n-1,l[q++]=1;a[b++]=0;a[b++]=2;a[b++]=p.length-1;l[q++]=1;l[q++]=2;l[q++]=t.length-1;q=1;Array.isArray(q)||(q=[q,q,q]);b=new Float32Array(3*v);for(n=0;n<v;n++)b[3*n]=p[n][0]*q[0],b[3*n+1]=p[n][1]*q[1],b[3*n+2]=p[n][2]*q[2];p=new Float32Array(3*v);for(n=
0;n<v;n++)p[3*n]=t[n][0],p[3*n+1]=t[n][1],p[3*n+2]=t[n][2];t={};t[f.POSITION]=a;t[f.NORMAL]=l;v={};v[f.POSITION]={size:3,data:b};v[f.NORMAL]={size:3,data:p};return new x(v,t)},createCylinderGeometry:function(a,b,l,n,q,p){n||(n=c.createFrom(1,0,0));q||(q=c.createFrom(0,0,0));p=void 0===p?!0:p;var k=c.create();c.normalize(n,k);n=c.create();c.scale(k,Math.abs(a),n);var t=c.create();c.scale(n,-.5,t);c.add(t,q);var v=c.createFrom(0,1,0);Math.abs(.2>1-c.dot(k,v))&&c.set3(0,0,1,v);var y=c.create();c.cross(k,
v,y);c.normalize(y);c.cross(y,k,v);var w=2*l+(p?2:0),B=l+(p?2:0);q=new Float32Array(3*w);a=new Float32Array(3*B);var D=new Float32Array(2*w),r=new Uint32Array(3*l*(p?4:2)),F=new Uint32Array(3*l*(p?4:2));p&&(q[3*(w-2)+0]=t[0],q[3*(w-2)+1]=t[1],q[3*(w-2)+2]=t[2],D[2*(w-2)]=0,D[2*(w-2)+1]=0,q[3*(w-1)+0]=q[3*(w-2)+0]+n[0],q[3*(w-1)+1]=q[3*(w-2)+1]+n[1],q[3*(w-1)+2]=q[3*(w-2)+2]+n[2],D[2*(w-1)]=1,D[2*(w-1)+1]=1,a[3*(B-2)+0]=-k[0],a[3*(B-2)+1]=-k[1],a[3*(B-2)+2]=-k[2],a[3*(B-1)+0]=k[0],a[3*(B-1)+1]=k[1],
a[3*(B-1)+2]=k[2]);var k=function(a,b,c){r[a]=b;F[a]=c},G,R,S=0,T=c.create(),V=c.create();for(G=0;G<l;G++)R=2*Math.PI/l*G,c.scale(v,Math.sin(R),T),c.scale(y,Math.cos(R),V),c.add(T,V),a[3*G+0]=T[0],a[3*G+1]=T[1],a[3*G+2]=T[2],c.scale(T,b),c.add(T,t),q[3*G+0]=T[0],q[3*G+1]=T[1],q[3*G+2]=T[2],D[2*G+0]=G/l,D[2*G+1]=0,q[3*(G+l)+0]=q[3*G+0]+n[0],q[3*(G+l)+1]=q[3*G+1]+n[1],q[3*(G+l)+2]=q[3*G+2]+n[2],D[2*(G+l)+0]=G/l,D[2*G+1]=1,R=(G+1)%l,k(S++,G,G),k(S++,G+l,G),k(S++,R,R),k(S++,R,R),k(S++,G+l,G),k(S++,R+
l,R);if(p){for(G=0;G<l;G++)R=(G+1)%l,k(S++,w-2,B-2),k(S++,G,B-2),k(S++,R,B-2);for(G=0;G<l;G++)R=(G+1)%l,k(S++,G+l,B-1),k(S++,w-1,B-1),k(S++,R+l,B-1)}b={};b[f.POSITION]=r;b[f.NORMAL]=F;b[f.UV0]=r;l={};l[f.POSITION]={size:3,data:q};l[f.NORMAL]={size:3,data:a};l[f.UV0]={size:2,data:D};return new x(l,b)},createTubeGeometry:function(a,b,c,f,l){c=c||10;f=null!=f?f:!0;k.assert(1<a.length);for(var p=[],n=[],q=0;q<c;q++){p.push([0,-q-1,-((q+1)%c)-1]);var t=q/c*2*Math.PI;n.push([Math.cos(t)*b,Math.sin(t)*b])}return B.createPathExtrusionGeometry(n,
a,[[0,0,0]],p,f,l)},createPathExtrusionGeometry:function(a,l,q,y,B,p){var v,w=a.length,D=new Float32Array(l.length*w*3+(6*q.length||0)),r=new Float32Array(l.length*w+(2*q.length||0)),F=new Float32Array(l.length*w*3+(q?6:0)),G=0,O=0,P=0,U=(l.length-1)*w*6+6*y.length,N=new Uint32Array(U),U=new Uint32Array(U),R=0,S=0,T=c.create(),V=c.create(),h=c.create(),ca=c.create();c.create();var Q=c.create();c.create();c.create();var e=c.create(),d=c.create(),g=c.create(),m=c.create(),u=c.create();c.create();c.create();
var C=c.create(),M=c.create(),Y=c.create(),W=t.create();c.set3(0,1,0,m);c.subtract(l[1],l[0],V);c.normalize(V);B?(c.add(l[0],p,g),c.normalize(g,h)):c.set3(0,0,1,h);b(V,h,Q,h,.99619469809)||b(V,m,Q,h,.99619469809)||b(V,m,Q,h,.99619469809);c.set(h,ca);c.set(Q,M);for(v=0;v<q.length;v++)c.scale(Q,q[v][0],e),c.scale(h,q[v][2],g),c.add(e,g),c.add(e,l[0]),D[G++]=e[0],D[G++]=e[1],D[G++]=e[2],r[P++]=0;F[O++]=-V[0];F[O++]=-V[1];F[O++]=-V[2];for(v=0;v<y.length;v++)N[R++]=0<y[v][0]?y[v][0]:-y[v][0]-1+q.length,
N[R++]=0<y[v][1]?y[v][1]:-y[v][1]-1+q.length,N[R++]=0<y[v][2]?y[v][2]:-y[v][2]-1+q.length,U[S++]=0,U[S++]=0,U[S++]=0;var da=q.length;v=q.length-1;for(var fa,aa=0;aa<l.length;aa++){fa=!1;if(0<aa){c.set(V,T);aa<l.length-1?(c.subtract(l[aa+1],l[aa],V),c.normalize(V)):fa=!0;c.add(T,V,u);c.normalize(u);c.add(l[aa-1],ca,C);W[0]=u[0];W[1]=u[1];W[2]=u[2];W[3]=-n.dot(u,l[aa]);if(k.rayPlane(C,T,W,g))c.subtract(g,l[aa]),c.normalize(g,h),c.cross(u,h,Q),c.normalize(Q);else{var ea=u,ja=M,ga=m,la=Q,ia=h;b(ea,ca,
la,ia,.99619469809)||b(ea,ja,la,ia,.99619469809)||b(ea,ga,la,ia,.99619469809)}c.set(h,ca);c.set(Q,M)}B&&(c.add(l[aa],p,g),c.normalize(g,Y));for(ea=0;ea<w;ea++)if(c.scale(Q,a[ea][0],e),c.scale(h,a[ea][1],g),c.add(e,g),c.normalize(e,d),F[O++]=d[0],F[O++]=d[1],F[O++]=d[2],B?r[P++]=c.dot(e,Y):r[P++]=e[2],c.add(e,l[aa]),D[G++]=e[0],D[G++]=e[1],D[G++]=e[2],!fa)for(ja=(ea+1)%w,N[R++]=da+ea,N[R++]=da+w+ea,N[R++]=da+ja,N[R++]=da+ja,N[R++]=da+w+ea,N[R++]=da+w+ja,ja=0;6>ja;ja++)U[S++]=N[R-6+ja]-v;da+=w}fa=l[l.length-
1];for(v=0;v<q.length;v++)c.scale(Q,q[v][0],e),c.scale(h,q[v][1],g),c.add(e,g),c.add(e,fa),D[G++]=e[0],D[G++]=e[1],D[G++]=e[2],r[P++]=0;a=O/3;F[O++]=V[0];F[O++]=V[1];F[O++]=V[2];w=da-w;for(v=0;v<y.length;v++)N[R++]=0<=y[v][0]?da+y[v][0]:-y[v][0]-1+w,N[R++]=0<=y[v][2]?da+y[v][2]:-y[v][2]-1+w,N[R++]=0<=y[v][1]?da+y[v][1]:-y[v][1]-1+w,U[S++]=a,U[S++]=a,U[S++]=a;y={};y[f.POSITION]=N;y[f.NORMAL]=U;N={};N[f.POSITION]={size:3,data:D};N.zOffset={size:1,data:r};N[f.NORMAL]={size:3,data:F};return new x(N,y)},
createPolylineGeometry:function(a,b){k.assert(1<a.length,"createPolylineGeometry(): polyline needs at least 2 points");k.assert(3===a[0].length,"createPolylineGeometry(): malformed vertex");k.assert(void 0===b||b.length===a.length,"createPolylineGeometry: need same number of points and normals");k.assert(void 0===b||3===b[0].length,"createPolylineGeometry(): malformed normal");for(var c=new Float32Array(3*a.length),l=new Uint32Array(2*(a.length-1)),q=0,p=0,n=0;n<a.length;n++){for(var t=0;3>t;t++)c[q++]=
a[n][t];0<n&&(l[p++]=n-1,l[p++]=n)}q={};p={};q[f.POSITION]=l;p[f.POSITION]={size:3,data:c};if(b){for(var c=new Float32Array(3*b.length),v=0,n=0;n<a.length;n++)for(t=0;3>t;t++)c[v++]=b[n][t];q[f.NORMAL]=l;p[f.NORMAL]={size:3,data:c}}return new x(p,q,x.DefaultOffsets,"line")},addVertexColors:function(a,b){var c,l=b||[1,1,1,1];b=new Uint8Array(4);b[0]=255*l[0];b[1]=255*l[1];b[2]=255*l[2];b[3]=255*(3<l.length?l[3]:1);var l={},q=a.getVertexAttr();for(c in q)l[c]=q[c];l[f.COLOR]={size:4,data:b};b={};for(c in a.indices)b[c]=
a.indices[c];b[f.COLOR]=new Uint32Array(b[f.POSITION].length);return a=new x(l,b,a.componentOffsets,a.primitiveType)},addNormals:function(a){var b=a.getVertexAttr();a=a.indices;for(var c=r.Vec3Compact.subtract,f=new Float32Array(a.position.length/3*3),q=b.position.data,p=0,k=a.position,t=new Uint32Array(k.length),v=0;v<k.length;v+=3){c(q,3*k[v],q,3*k[v+2],y,0);c(q,3*k[v],q,3*k[v+1],l,0);n.cross(l,y);n.normalize(l);var B=p/3;f[p++]=l[0];f[p++]=l[1];f[p++]=l[2];t[v]=B;t[v+1]=B;t[v+2]=B}b.normal={size:3,
data:f};a.normal=t},cgToGIS:function(a){var b=a.getVertexAttr();a=b.position.data;var b=b.normal.data,c,f;if(b)for(c=0;c<b.length;c+=3)f=b[c+1],b[c+1]=-b[c+2],b[c+2]=f;if(a)for(c=0;c<a.length;c+=3)f=a[c+1],a[c+1]=-a[c+2],a[c+2]=f}};return B})},"esri/views/3d/webgl-engine/lib/GeometryData":function(){define(["require","exports","./ComponentUtils","./geometryDataUtils","./Util"],function(x,r,k,a,b){return function(){function c(t,n,f,q){void 0===n&&(n=c.DefaultIndices);void 0===f&&(f=c.DefaultOffsets);
void 0===q&&(q="triangle");this.preinterleaved=!1;var l={},y;for(y in t){var B=t[y],v=B.size;l[y]={data:B.data,size:v,offsetIdx:0,strideIdx:v}}if(n===c.DefaultIndices){n=b.getFirstObjectValue(l);t=a.generateDefaultIndexArray(n.data.length/n.size);n={};for(var w in l)n[w]=t}this._id=a.getNewId();this._vertexAttributes=l;this._indices=n;this._componentOffsets=k.createOffsets(f);this._primitiveType=q}Object.defineProperty(c.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});
Object.defineProperty(c.prototype,"vertexAttributes",{get:function(){return this._vertexAttributes},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"indices",{get:function(){return this._indices},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"componentOffsets",{get:function(){return this._componentOffsets},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"indexCount",{get:function(){return b.getFirstObjectValue(this._indices).length},enumerable:!0,
configurable:!0});Object.defineProperty(c.prototype,"primitiveType",{get:function(){return this._primitiveType},enumerable:!0,configurable:!0});c.prototype.getId=function(){return this.id};c.prototype.getVertexAttr=function(){return this.vertexAttributes};c.prototype.toRenderData=function(){return{id:this._id.toString(),preinterleaved:!1,indices:this._indices,vertexAttr:this._vertexAttributes}};c.prototype.getIndices=function(a){return this._indices[a]};c.prototype.getAttribute=function(a){return this._vertexAttributes[a]};
c.prototype.estimateGpuMemoryUsage=function(){var a=0;this._indices.position&&(a+=12*this._indices.position.length);this._indices.normal&&(a+=12*this._indices.normal.length);this._indices.uv0&&(a+=8*this._indices.uv0.length);this._indices.color&&(a+=4*this._indices.color.length);this._indices.terrain&&(a+=2*this._indices.terrain.length,a+=4*this._vertexAttributes.terrain.data.length);return a};c.DefaultIndices={};c.DefaultOffsets=new Uint32Array(0);return c}()})},"esri/views/3d/webgl-engine/lib/geometryDataUtils":function(){define(["require",
"exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});var k=1,a=null;r.generateDefaultIndexArray=function(b){if(b>k||null==a){for(;b>k;)k*=2;a=new Uint32Array(k);for(var c=0;c<k;c++)a[c]=c}return new Uint32Array(a.buffer,0,b)};var b=0;r.getNewId=function(){return b++}})},"esri/views/3d/webgl-engine/lib/Texture":function(){define("require exports ./IdGen ./Util ./DDSUtil ./gl-matrix ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/Util ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){function w(b,c,f,l,q,k,t){t=!1!==t;var p=new Image;p.onerror=function(){k(null);p.onerror=void 0;p.onload=void 0};p.onload=function(){a.assert(1<=p.width&&1<=p.height);f.samplingMode=t?9987:9729;f.hasMipmap=t;if(!t&&33071===f.wrapMode||a.isPowerOfTwo(p.width)&&a.isPowerOfTwo(p.height))f.width=p.width,f.height=p.height,c=new n(b,f,p);else var c=D(b,p,f,l,q);b.bindTexture(c);k(c);p.onerror=void 0;p.onload=void 0};p.src=c}function D(b,c,k,y,w){var p=a.nextHighestPowerOfTwo(c.width),
z=a.nextHighestPowerOfTwo(c.height);a.assert(p!==c.width||z!==c.height);k.width=p;k.height=z;var A=new n(b,k),r=t.createWithAttachments(b,A,{colorTarget:0,depthStencilTarget:0});c=new n(b,{target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9728,flipped:!!k.flipped,maxAnisotropy:8,preMultiplyAlpha:k.preMultiplyAlpha},c);b.bindFramebuffer(r);void 0===w&&(w=b.getViewport(),w=[w.x,w.y,w.width,w.height]);b.setViewport(0,0,p,z);y=y.get("texOnly");p=F.identity();b.bindProgram(y);y.setUniformMatrix4fv("model",
p);y.setUniformMatrix4fv("view",p);y.setUniformMatrix4fv("proj",p);y.setUniform4f("color",1,1,1,1);y.setUniform1i("tex",0);y=new q(b,v.Default3D,{geometry:B.Pos3Tex},{geometry:l.createVertex(b,35044,a.createQuadVertexUvBuffer())});b.bindTexture(c,0);b.bindVAO(y);b.setDepthTestEnabled(!1);b.setBlendingEnabled(!1);b.drawArrays(5,0,f.vertexCount(y,"geometry"));b.setDepthTestEnabled(!0);b.bindFramebuffer(null);b.setViewport(w[0],w[1],w[2],w[3]);y.dispose(!0);c.dispose();b.bindFramebuffer(null);r.detachColorTexture();
r.dispose();k.hasMipmap&&A.generateMipmap();return A}var F=c.mat4d;return function(){function c(a,b,f){this.data=a;this.id=c.idGen.gen(b);this.unloadFunc=void 0;this.params=f||{};this.params.wrapClamp=this.params.wrapClamp||!1;this.params.mipmap=!1!==this.params.mipmap;this.params.noUnpackFlip=this.params.noUnpackFlip||!1;this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1;this.estimatedTexMemRequiredMB=c.estimateTexMemRequiredMB(this.data,this.params)}c.estimateTexMemRequiredMB=function(a,
b){return null==a?0:a instanceof ArrayBuffer||a instanceof Uint8Array?a.byteLength/1E6:a instanceof Image||a instanceof ImageData||a instanceof HTMLCanvasElement?(b.mipmap?4/3:1)*a.width*a.height*4/1E6:(b.mipmap?4/3:1)*b.width*b.height*4/1E6||0};c.prototype.getId=function(){return this.id};c.prototype.getEstimatedTexMemRequiredMB=function(){return this.estimatedTexMemRequiredMB};c.prototype.dispose=function(){this.data=void 0};c.prototype.deferredLoading=function(){return"string"===typeof this.data};
c.prototype.getWidth=function(){return this.params.width};c.prototype.getHeight=function(){return this.params.height};c.prototype.initializeThroughUpload=function(f,l,q,k,t){var p=this.data;l.flipped=!this.params.noUnpackFlip;l.samplingMode=this.params.mipmap?9987:9729;l.hasMipmap=this.params.mipmap;l.wrapMode=this.params.wrapClamp?33071:10497;l.preMultiplyAlpha=this.params.preMultiplyAlpha;if("string"===typeof p)w(f,p,l,q,k,t,this.params.mipmap);else{if(p instanceof Image||p instanceof ImageData||
p instanceof HTMLCanvasElement)this.params.width=p.width,this.params.height=p.height,!this.params.mipmap&&this.params.wrapClamp||a.isPowerOfTwo(p.width)&&a.isPowerOfTwo(p.height)?(l.width=p.width,l.height=p.height,l=new n(f,l,p)):l=D(f,p,l,q,k);else if(p instanceof ArrayBuffer&&this.params.encoding===c.DDS_ENCODING)l=b.createDDSTexture(f,l,p,this.params.mipmap);else if(p instanceof Uint8Array&&this.params.encoding===c.DDS_ENCODING)l=b.createDDSTexture(f,l,p.buffer,this.params.mipmap);else if(p instanceof
Uint8Array)a.assert(0<this.params.width&&0<this.params.height),l.pixelFormat=1===this.params.components?6409:6408,l.width=this.params.width,l.height=this.params.height,l=new n(f,l,p);else{if(null!==p)throw console.warn("Unsupported image data"),Error("Unsupported image data");l=new n(f,l,null)}f.bindTexture(l);t(l)}this.data=void 0};c.prototype.setUnloadFunc=function(a){this.unloadFunc=a};c.prototype.unload=function(){void 0!==this.unloadFunc&&(this.unloadFunc(this.id),this.unloadFunc=void 0)};c.idGen=
new k;c.DDS_ENCODING="image/vnd-ms.dds";return c}()})},"esri/views/3d/webgl-engine/lib/DDSUtil":function(){define(["require","exports","../../../webgl/Texture","../../../webgl/enums"],function(x,r,k,a){function b(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}Object.defineProperty(r,"__esModule",{value:!0});var c=b("DXT1"),t=b("DXT3"),n=b("DXT5");r.createDDSTexture=function(a,b,l,y){var f=new Int32Array(l,0,31);if(542327876!==f[0])return console.error("Invalid magic number in DDS header"),
null;if(!(f[20]&4))return console.error("Unsupported format, must contain a FourCC code"),null;var q=f[21],w;switch(q){case c:q=8;w=33776;break;case t:q=16;w=33778;break;case n:q=16;w=33779;break;default:return console.error("Unsupported FourCC code:",String.fromCharCode(q&255,q>>8&255,q>>16&255,q>>24&255)),null}var r=1;f[2]&131072&&!1!==y&&(r=Math.max(1,f[7]));y=f[4];var F=f[3],G=f[1]+4,p,z;b.samplingMode=1<r?9987:9729;b.hasMipmap=1<r;b.width=f[4];b.height=f[3];b=new k(a,b);a.bindTexture(b);for(f=
0;;++f){f<r&&(z=Math.floor((y+3)/4)*Math.floor((F+3)/4)*q,p=new Uint8Array(l,G,z));a.gl.compressedTexImage2D(a.gl.TEXTURE_2D,f,w,y,F,0,p);G+=z;if(1===y&&1===F||1===r)break;y=Math.max(1,y>>1);F=Math.max(1,F>>1)}return b}})},"esri/views/webgl/Texture":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c){this._glName=this._context=null;this._id=-1;this._desc=void 0;this._wrapModeDirty=this._samplingModeDirty=!1;this._boundToUnits=new Set;this._context=a;this._desc=
{pixelFormat:b.pixelFormat,internalFormat:b.internalFormat,dataType:b.dataType,target:b.target?b.target:3553,samplingMode:b.samplingMode?b.samplingMode:9729,wrapMode:b.wrapMode?b.wrapMode:10497,maxAnisotropy:b.maxAnisotropy,flipped:void 0!==b.flipped?b.flipped:!1,hasMipmap:void 0!==b.hasMipmap?b.hasMipmap:!1,level:void 0!==b.level?b.level:0,unpackAlignment:b.unpackAlignment?b.unpackAlignment:4,width:b.width,height:b.height,preMultiplyAlpha:void 0!==b.preMultiplyAlpha?b.preMultiplyAlpha:!1};this._id=
++k._nextId;this.setData(c)}Object.defineProperty(k.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});k.prototype.dispose=function(){var a=this;if(this._context){if(this._glName){var b=this._context.gl;this._boundToUnits.forEach(function(b){a._context.bindTexture(null,
b)});b.deleteTexture(this._glName);this._glName=null}this._context=null}};k.prototype.resize=function(a,b){var c=this._desc;if(c.width!==a||c.height!==b)c.width=a,c.height=b,this.setData(null)};k.prototype.setData=function(a){var b=this._context.gl;this._glName||(this._glName=b.createTexture());void 0===a&&(a=null);null===a&&(this._desc.width=this._desc.width||4,this._desc.height=this._desc.height||4);var c=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var t=this._desc;k._validateTexture(t);
b.pixelStorei(b.UNPACK_ALIGNMENT,t.unpackAlignment);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,t.flipped?1:0);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.preMultiplyAlpha);a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement?(t.width&&t.height&&console.assert(a.width===t.width&&a.height===t.height),b.texImage2D(b.TEXTURE_2D,t.level,t.internalFormat?t.internalFormat:t.pixelFormat,t.pixelFormat,t.dataType,a),void 0===this._desc.width&&(this._desc.width=
a.width),void 0===this._desc.height&&(this._desc.height=a.height)):(null!=t.width&&null!=t.height||console.error("Width and height must be specified!"),b.texImage2D(b.TEXTURE_2D,t.level,t.internalFormat?t.internalFormat:t.pixelFormat,t.width,t.height,0,t.pixelFormat,t.dataType,a));t.hasMipmap&&this.generateMipmap();k._applySamplingMode(b,this._desc);k._applyWrapMode(b,this._desc);k._applyAnisotropicFilteringParameters(this._context,this._desc);this._context.bindTexture(c,0)};k.prototype.updateData=
function(a,b,c,k,n,f){f||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var q=this._context.gl,l=this._desc,t=this._context.getBoundTexture(0);this._context.bindTexture(this,0);(0>b||0>c||k>l.width||n>l.height||b+k>l.width||c+n>l.height)&&console.error("An attempt to update out of bounds of the texture!");f instanceof ImageData||f instanceof HTMLImageElement||f instanceof HTMLCanvasElement||f instanceof HTMLVideoElement?
(console.assert(f.width===k&&f.height===n),q.texSubImage2D(q.TEXTURE_2D,a,b,c,l.pixelFormat,l.dataType,f)):q.texSubImage2D(q.TEXTURE_2D,a,b,c,k,n,l.pixelFormat,l.dataType,f);this._context.bindTexture(t,0)};k.prototype.generateMipmap=function(){var a=this._desc;a.hasMipmap||(a.hasMipmap=!0,k._validateTexture(a));9729===a.samplingMode?(this._samplingModeDirty=!0,a.samplingMode=9985):9728===a.samplingMode&&(this._samplingModeDirty=!0,a.samplingMode=9984);a=this._context.getBoundTexture(0);this._context.bindTexture(this,
0);var b=this._context.gl;b.generateMipmap(b.TEXTURE_2D);this._context.bindTexture(a,0)};k.prototype.setSamplingMode=function(a){a!==this._desc.samplingMode&&(this._desc.samplingMode=a,k._validateTexture(this._desc),this._samplingModeDirty=!0)};k.prototype.setWrapMode=function(a){a!==this._desc.wrapMode&&(this._desc.wrapMode=a,k._validateTexture(this._desc),this._wrapModeDirty=!0)};k.prototype.applyChanges=function(){var a=this._context.gl,b=this._desc;this._samplingModeDirty&&(k._applySamplingMode(a,
b),this._samplingModeDirty=!1);this._wrapModeDirty&&(k._applyWrapMode(a,b),this._wrapModeDirty=!1)};k.prototype.setBoundToUnit=function(a,b){b?this._boundToUnits.add(a):this._boundToUnits.delete(a)};k._isPowerOfTwo=function(a){return 0===(a&a-1)};k._validateTexture=function(a){(0>a.width||0>a.height)&&console.error("Negative dimension parameters are not allowed!");k._isPowerOfTwo(a.width)&&k._isPowerOfTwo(a.height)||(33071!==a.wrapMode&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),
a.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))};k._applySamplingMode=function(a,b){var c=b.samplingMode;if(9985===c||9987===c)c=9729;else if(9984===c||9986===c)c=9728;a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,c);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,b.samplingMode)};k._applyWrapMode=function(a,b){a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,b.wrapMode);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,b.wrapMode)};k._applyAnisotropicFilteringParameters=
function(a,b){if(null!=b.maxAnisotropy){var c=a.extensions.textureFilterAnisotropic;c&&(a=a.gl,a.texParameterf(a.TEXTURE_2D,c.TEXTURE_MAX_ANISOTROPY_EXT,b.maxAnisotropy))}};k._nextId=0;return k}()})},"esri/views/webgl/FramebufferObject":function(){define(["require","exports","./Texture"],function(x,r,k){return function(){function a(b,c,t,n){this._colorAttachment=this._stencilAttachment=this._depthAttachment=this._glName=this._context=null;this._initialized=!1;this._context=b;this._desc={colorTarget:c.colorTarget,
depthStencilTarget:c.depthStencilTarget,width:c.width,height:c.height,multisampled:c.multisampled};this._id=a._nextId++;t&&(b=void 0,t instanceof k?(this._colorAttachment=t,b=t.descriptor):(b=t,this._colorAttachment=new k(this._context,b)),0!==this._desc.colorTarget&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),a._validateTextureDimensions(b,this._desc));n&&(this._context.extensions.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),
t=void 0,n instanceof k?(this._depthStencilTexture=n,t=this._depthStencilTexture.descriptor):(t=n,this._depthStencilTexture=new k(this._context,t)),a._validateTextureDimensions(t,this._desc))}a.create=function(b,c){return new a(b,c)};a.createWithAttachments=function(b,c,k,n){return new a(b,k,c,n)};Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colorTexture",{get:function(){return this._colorAttachment instanceof k?this._colorAttachment:null},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"depthStencilTexture",{get:function(){return this._depthStencilTexture},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._desc.width},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._desc.height},enumerable:!0,configurable:!0});a.prototype.dispose=function(){this._context&&this._glName&&(this._disposeColorAttachment(),this._disposeDepthStencilAttachments(),this._context.gl.deleteFramebuffer(this._glName),this._glName=null)};a.prototype.attachColorTexture=function(b){if(b){a._validateTextureDimensions(b.descriptor,this._desc);this._disposeColorAttachment();if(this._initialized){this._context.bindFramebuffer(this);
var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,b.glName,0)}this._colorAttachment=b}};a.prototype.detachColorTexture=function(){var a=void 0;if(this._colorAttachment instanceof k){a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,null,0)}this._colorAttachment=null}return a};a.prototype.attachDepthStencilTexture=function(b){if(b){var c=
b.descriptor;34041!==c.pixelFormat&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");34042!==c.dataType&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8_WEBGL!");this._context.extensions.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!");a._validateTextureDimensions(c,this._desc);4!==this._desc.depthStencilTarget&&(this._desc.depthStencilTarget=4);this._disposeDepthStencilAttachments();
this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,b.glName,0));this._depthStencilTexture=b}};a.prototype.detachDepthStencilTexture=function(){var a=this._depthStencilTexture;if(a&&this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,null,0)}this._depthStencilTexture=null;return a};
a.prototype.copyToTexture=function(a,c,k,n,f,q,l){(0>a||0>c||0>f||0>q)&&console.error("Offsets cannot be negative!");(0>=k||0>=n)&&console.error("Copy width and height must be greater than zero!");var b=this._desc,t=l.descriptor;3553!==l.descriptor.target&&console.error("Texture target must be TEXTURE_2D!");(a+k>b.width||c+n>b.height||f+k>t.width||q+n>t.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");b=this._context;b.bindTexture(l);b.bindFramebuffer(this);
b.gl.copyTexSubImage2D(3553,0,f,q,a,c,k,n)};a.prototype.readPixels=function(a,c,k,n,f,q,l){(0>=k||0>=n)&&console.error("Copy width and height must be greater than zero!");l||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(a,c,k,n,f,q,l)};a.prototype.resize=function(b,c){var t=this._desc;if(t.width!==b||t.height!==c)if(this._initialized)t.width=b,t.height=c,this._colorAttachment instanceof k?(n=this._colorAttachment,t=n.descriptor,
t.width=b,t.height=c,this._colorAttachment.dispose(),this._colorAttachment=new k(this._context,t),a._validateTextureDimensions(n.descriptor,this._desc)):this._colorAttachment&&this._disposeColorAttachment(),null!=this._depthStencilTexture?(t=this._depthStencilTexture.descriptor,t.width=b,t.height=c,this._depthStencilTexture.dispose(),this._depthStencilTexture=new k(this._context,t)):(this._depthAttachment||this._stencilAttachment)&&this._disposeDepthStencilAttachments(),this._context.getBoundFramebufferObject()===
this&&this._context.bindFramebuffer(null),this._initialized=!1;else{t.width=b;t.height=c;if(this._colorAttachment instanceof k){var n=this._colorAttachment;n.resize(b,c)}this._depthStencilTexture&&this._depthStencilTexture.resize(b,c)}};a.prototype.initialize=function(){if(this._initialized)return!1;var a=this._context.gl;this._glName&&a.deleteFramebuffer(this._glName);var c=a.createFramebuffer(),t=this._desc;a.bindFramebuffer(a.FRAMEBUFFER,c);if(!this._colorAttachment)if(0===t.colorTarget)this._colorAttachment=
new k(this._context,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:t.width,height:t.height});else{var n=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,n);a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t.width,t.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,n);this._colorAttachment=n}this._colorAttachment instanceof k&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this._colorAttachment.glName,0);
switch(t.depthStencilTarget){case 1:case 3:n=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,n);var f=1===t.depthStencilTarget?a.DEPTH_ATTACHMENT:a.DEPTH_STENCIL_ATTACHMENT;a.renderbufferStorage(a.RENDERBUFFER,1===t.depthStencilTarget?a.DEPTH_COMPONENT16:a.DEPTH_STENCIL,t.width,t.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,f,a.RENDERBUFFER,n);this._depthAttachment=n;break;case 2:n=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,n);a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX8,
t.width,t.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.STENCIL_ATTACHMENT,a.RENDERBUFFER,n);this._stencilAttachment=n;break;case 4:this._depthStencilTexture||(this._context.extensions.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),this._depthStencilTexture=new k(this._context,{target:3553,pixelFormat:34041,dataType:34042,samplingMode:9728,wrapMode:33071,width:t.width,height:t.height})),
a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,this._depthStencilTexture.glName,0)}a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!");this._glName=c;return this._initialized=!0};a.prototype._disposeColorAttachment=function(){if(this._colorAttachment instanceof k){var a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,
c.TEXTURE_2D,null,0)}a.dispose()}else this._colorAttachment instanceof WebGLRenderbuffer&&(a=this._colorAttachment,c=this._context.gl,this._initialized&&(this._context.bindFramebuffer(this),c.framebufferRenderbuffer(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(a));this._colorAttachment=null};a.prototype._disposeDepthStencilAttachments=function(){var a=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);
var c=this._context.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,1===this._desc.depthStencilTarget?c.DEPTH_ATTACHMENT:c.DEPTH_STENCIL_ATTACHMENT,c.RENDERBUFFER,null)}a.deleteRenderbuffer(this._depthAttachment);this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferRenderbuffer(c.FRAMEBUFFER,c.STENCIL_ATTACHMENT,c.RENDERBUFFER,null)),a.deleteRenderbuffer(this._stencilAttachment),this._stencilAttachment=null);this._depthStencilTexture&&
(this._initialized&&(this._context.bindFramebuffer(this),a=this._context.gl,a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,null,0)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)};a._validateTextureDimensions=function(a,c){console.assert(0<=a.width&&0<=a.height);3553!==a.target&&console.error("Texture type must be TEXTURE_2D!");void 0!==c.width&&0<=c.width&&void 0!==c.height&&0<=c.height?c.width===a.width&&c.height===a.height||console.error("Color attachment texture must match the framebuffer's!"):
(c.width=a.width,c.height=a.height)};a._nextId=0;return a}()})},"esri/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.Pos3=[{name:"position",count:3,type:5126,offset:0,stride:12,normalized:!1}];r.Pos3Tex=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:20,normalized:!1}];r.Pos3Col=[{name:"position",count:3,type:5126,offset:0,
stride:16,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:16,normalized:!1}];r.Pos3TexCol=[{name:"position",count:3,type:5126,offset:0,stride:24,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:24,normalized:!1},{name:"color",count:4,type:5121,offset:20,stride:24,normalized:!1}];r.Pos3TexRegion=[{name:"position",count:3,type:5126,offset:0,stride:28,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:28,normalized:!1},{name:"region",count:4,type:5123,offset:20,
stride:28,normalized:!1}];r.Pos3TexRegionCol=[{name:"position",count:3,type:5126,offset:0,stride:44,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:44,normalized:!1},{name:"region",count:4,type:5123,offset:32,stride:44,normalized:!1},{name:"color",count:4,type:5121,offset:40,stride:44,normalized:!1}];r.Pos3Norm=[{name:"position",count:3,type:5126,offset:0,stride:24,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:24,normalized:!1}];r.Pos3NormTex=[{name:"position",count:3,
type:5126,offset:0,stride:32,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:32,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:32,normalized:!1}];r.Pos3NormCol=[{name:"position",count:3,type:5126,offset:0,stride:28,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:28,normalized:!1},{name:"color",count:4,type:5121,offset:24,stride:28,normalized:!1}];r.Pos3NormTexCol=[{name:"position",count:3,type:5126,offset:0,stride:36,normalized:!1},{name:"normal",count:3,
type:5126,offset:12,stride:36,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:36,normalized:!1},{name:"color",count:4,type:5121,offset:32,stride:36,normalized:!1}];r.Pos3NormTexRegion=[{name:"position",count:3,type:5126,offset:0,stride:40,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:40,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:40,normalized:!1},{name:"region",count:4,type:5123,offset:32,stride:40,normalized:!1}];r.Pos3NormTexRegionCol=[{name:"position",
count:3,type:5126,offset:0,stride:44,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:44,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:44,normalized:!1},{name:"region",count:4,type:5123,offset:32,stride:44,normalized:!1},{name:"color",count:4,type:5121,offset:40,stride:44,normalized:!1}];r.Pos3NormSymcol=[{name:"position",count:3,type:5126,offset:0,stride:28,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:28,normalized:!1},{name:"symbolColor",count:4,
type:5121,offset:24,stride:28,normalized:!1}];r.Pos3NormTexSymcol=[{name:"position",count:3,type:5126,offset:0,stride:36,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:36,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:36,normalized:!1},{name:"symbolColor",count:4,type:5121,offset:32,stride:36,normalized:!1}];r.Pos3NormColSymcol=[{name:"position",count:3,type:5126,offset:0,stride:32,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:32,normalized:!1},
{name:"color",count:4,type:5121,offset:24,stride:32,normalized:!1},{name:"symbolColor",count:4,type:5121,offset:28,stride:32,normalized:!1}];r.Pos3NormTexColSymcol=[{name:"position",count:3,type:5126,offset:0,stride:40,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:40,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:40,normalized:!1},{name:"color",count:4,type:5121,offset:32,stride:40,normalized:!1},{name:"symbolColor",count:4,type:5121,offset:36,stride:40,normalized:!1}];
r.Pos3NormTexRegionSymcol=[{name:"position",count:3,type:5126,offset:0,stride:44,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:44,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:44,normalized:!1},{name:"region",count:4,type:5123,offset:32,stride:44,normalized:!1},{name:"symbolColor",count:4,type:5121,offset:40,stride:44,normalized:!1}];r.Pos3NormTexRegionColSymcol=[{name:"position",count:3,type:5126,offset:0,stride:48,normalized:!1},{name:"normal",count:3,type:5126,
offset:12,stride:48,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:48,normalized:!1},{name:"region",count:4,type:5123,offset:32,stride:48,normalized:!1},{name:"color",count:4,type:5121,offset:40,stride:48,normalized:!1},{name:"symbolColor",count:4,type:5121,offset:44,stride:48,normalized:!1}];r.Pos2=[{name:"position",count:2,type:5126,offset:0,stride:8,normalized:!1}];r.Pos2Tex=[{name:"position",count:2,type:5126,offset:0,stride:16,normalized:!1},{name:"uv0",count:2,type:5126,offset:8,
stride:16,normalized:!1}];r.Model=[{name:"model",count:16,type:5126,offset:0,stride:128,normalized:!1,divisor:1},{name:"modelNormal",count:16,type:5126,offset:64,stride:128,normalized:!1,divisor:1}];r.ModelCol=[{name:"model",count:16,type:5126,offset:0,stride:144,normalized:!1,divisor:1},{name:"modelNormal",count:16,type:5126,offset:64,stride:144,normalized:!1,divisor:1},{name:"instanceColor",count:4,type:5126,offset:128,stride:144,normalized:!1,divisor:1}]})},"esri/views/3d/webgl-engine/lib/GLTextureRep":function(){define("require exports ./Util ../../../../core/Logger ../../../webgl/Texture ../../../webgl/enums".split(" "),
function(x,r,k,a,b,c){var t=a.getLogger("esri.views.3d.webgl-engine.lib.GLTextureRep"),n=function(){function a(a){this._glTexture=null;this._refCount=0;this._glTexture=a}a.prototype.incRefCnt=function(){++this._refCount};a.prototype.decRefCnt=function(){--this._refCount;k.assert(0<=this._refCount)};a.prototype.getRefCnt=function(){return this._refCount};a.prototype.setGLTexture=function(a){this._glTexture=a};a.prototype.getGLTexture=function(){return this._glTexture};return a}();return function(){function a(a,
b,c,f){this.NUM_PARALLEL=8;this.textures=a;this._programRepository=b;this.getViewportToRestore=c;this._rctx=f;this.NUM_PARALLEL=8;this.id2textureRef={};this.loading={};this._queue=[];this.listeners=[];this.maxMaxAnisotropy=(this.afExt=f.extensions.textureFilterAnisotropic)?f.parameters.maxMaxAnisotropy:1;this.maxAnisotropy=Math.min(8,this.maxMaxAnisotropy);this._needsRender=!0;this._fallbackTextureData=new Uint8Array(256);this._fallbackTextureTransparentData=new Uint8Array(256);for(a=0;a<this._fallbackTextureData.length;++a)this._fallbackTextureData[a]=
255,this._fallbackTextureTransparentData[a]=0!==(a+1)%4?255:0;this._fallbackTextureDesc={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:8,height:8,maxAnisotropy:8}}a.prototype.resetNeedsRender=function(){this._needsRender=!1};a.prototype.needsRender=function(){return this._needsRender};a.prototype.aquire=function(a,c,f,B){var l=this,q=this.id2textureRef[a];if(null==q){c=this.textures[a];k.assert(void 0!==c);c.setUnloadFunc(this._unload.bind(this));f=!0===f;var y=this._createGLTextureDescription(c),
q=new n(null);k.assert(null==this.id2textureRef[a]);this.id2textureRef[a]=q;if(c.initializeThroughRender)a=c.initializeThroughRender(this._rctx,y),q.setGLTexture(a),B&&B(q);else if(c.deferredLoading())this.getLoadingCount()<this.NUM_PARALLEL?this._loadImage(a,y,B):this._queue.push([a,y,B]);else try{c.initializeThroughUpload(this._rctx,y,this._programRepository,this.getViewportToRestore(),function(a){q.setGLTexture(a);l._needsRender=!0;B&&B(q)})}catch(F){t.error("#aquire","Error loading texture: "+
F.toString())}null==q.getGLTexture()&&q.setGLTexture(f?new b(this._rctx,this._fallbackTextureDesc,this._fallbackTextureTransparentData):new b(this._rctx,this._fallbackTextureDesc,this._fallbackTextureData));this._needsRender=!0}q.incRefCnt();return q};a.prototype.release=function(a){a=this.id2textureRef[a];void 0!==a&&(a.decRefCnt(),k.assert(0<=a.getRefCnt()))};a.prototype.getLoadingCount=function(){return Object.keys(this.loading).length};a.prototype.getIsLoaded=function(a){if(null==this.id2textureRef[a]||
void 0!==this.loading[a])return!1;for(var b=0;b<this._queue.length;++b)if(this._queue[b][0]===a)return!1;return!0};a.prototype.addTextureListener=function(a){k.assert(-1===this.listeners.indexOf(a));this.listeners.push(a)};a.prototype.removeTextureListener=function(a){a=this.listeners.indexOf(a);k.assert(-1!==a);this.listeners.splice(a,1)};a.prototype.getTexture=function(a){return this.textures[a]};a.prototype.getMaxAnisotropy=function(){return this.maxAnisotropy};a.prototype._unload=function(a){var b=
this.id2textureRef[a];void 0!==b&&(b.getGLTexture().dispose(),delete this.id2textureRef[a]);this.next(a)};a.prototype._createGLTextureDescription=function(a){return{target:3553,pixelFormat:6408,dataType:5121,maxAnisotropy:this.afExt&&a.params&&a.params.mipmap&&!a.params.disableAnisotropy?this.maxAnisotropy:void 0,wrapMode:a.params&&a.params.wrapClamp?33071:void 0}};a.prototype.next=function(a){if(a in this.loading){delete this.loading[a];var b=Object.keys(this.id2textureRef),c=Object.keys(this.loading);
this.listeners.forEach(function(f){f(a,b,c)});this.processQueue()}};a.prototype._loadImage=function(a,b,c){var f=this;k.assert(null==this.loading[a]);this.loading[a]=!0;var l=this.textures[a];k.assert(void 0!==l);setTimeout(function(){var n=f.id2textureRef[a];n&&n.getRefCnt()&&l.initializeThroughUpload(f._rctx,b,f._programRepository,f.getViewportToRestore(),function(b){f.next(a);f._needsRender=!0;n&&n.getRefCnt()&&(n.setGLTexture(b),c&&c(n))})},0)};a.prototype.processQueue=function(){for(var a=[],
b=0;b<this._queue.length;++b){var c=this._queue[b][0],f=this.id2textureRef[c];void 0!==f&&(0===f.getRefCnt()?(f.getGLTexture().dispose(),delete this.id2textureRef[c]):a.push(this._queue[b]))}this._queue=a;a=Math.min(this.NUM_PARALLEL-Object.keys(this.loading).length,this._queue.length);for(b=0;b<a;++b)this._loadImage(this._queue[b][0],this._queue[b][1],this._queue[b][2]);this._queue.splice(0,a)};return a}()})},"esri/views/3d/webgl-engine/lib/RenderPass":function(){define(["require","exports"],function(x,
r){var k;x=k||(k={});x[x.MATERIAL=0]="MATERIAL";x[x.MATERIAL_DEPTH=1]="MATERIAL_DEPTH";x[x.MATERIAL_NORMAL=2]="MATERIAL_NORMAL";x[x.MATERIAL_DEPTH_SHADOWMAP=3]="MATERIAL_DEPTH_SHADOWMAP";x[x.MATERIAL_HIGHLIGHT=4]="MATERIAL_HIGHLIGHT";x[x.MAX_PASS=5]="MAX_PASS";return k})},"esri/views/3d/webgl-engine/lib/RenderSlot":function(){define(["require","exports"],function(x,r){var k;x=k||(k={});x[x.BACKGROUND=0]="BACKGROUND";x[x.INTERNAL_MATERIAL=1]="INTERNAL_MATERIAL";x[x.STENCIL_MATERIAL=2]="STENCIL_MATERIAL";
x[x.OPAQUE_TERRAIN=3]="OPAQUE_TERRAIN";x[x.OPAQUE_MATERIAL=4]="OPAQUE_MATERIAL";x[x.OPAQUE_EXTERNAL=5]="OPAQUE_EXTERNAL";x[x.TRANSPARENT_MATERIAL=6]="TRANSPARENT_MATERIAL";x[x.TRANSPARENT_EXTERNAL=7]="TRANSPARENT_EXTERNAL";x[x.TRANSPARENT_TERRAIN=8]="TRANSPARENT_TERRAIN";x[x.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS";x[x.POSTPROCESSING_HIGHLIGHT=10]="POSTPROCESSING_HIGHLIGHT";x[x.POSTPROCESSING_ATMOSPHERE=11]="POSTPROCESSING_ATMOSPHERE";x[x.POSTPROCESSING_EXTERNAL=12]="POSTPROCESSING_EXTERNAL";x[x.HUDMATERIAL1=
13]="HUDMATERIAL1";x[x.HUDMATERIAL2=14]="HUDMATERIAL2";x[x.LINE_CALLOUTS=15]="LINE_CALLOUTS";x[x.LINE_CALLOUTS_HUD_DEPTH=16]="LINE_CALLOUTS_HUD_DEPTH";x[x.MAX_SLOTS=17]="MAX_SLOTS";return k})},"esri/views/3d/environment/resources/SimpleAtmosphereTexture":function(){define([],function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAIACAYAAABD1gYFAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7AAAAOwAFq1okJAAAAB3RJTUUH4QkLDx4bnqU2+QAAAd1JREFUSMd9lkmWxDAIQ/Xluv+V0wuDjaeuhV+IGQUoJUnNwGfAVvx+lsBCWJIsCaMpQn8nuhgqyyEzbAX1Ih0oHaQZN5X5jul581diaDVbSgAdZv1YLoCLyn/RruCsOdcqR7RS/jXkLMa9UddcDn9O7G8gwprzs6xbQl/Fns3BE90r9veQ/wzNrTM5p1yDF1yokLCosDX5kik1lxeSWxfWsihN/lZcHuPIOuhccZ4Ovt74qQK3USkFzsQx7Ki5NgqoMI1J5ILztr9UrGoGHN2qnSEwOHiD97ByDghs/KIVYp9DfdIIoJPcBkWWnM2O2s5ru3su+8GdPLhM5048r/09UDsZmJ3HRwe5MT/aA9Ul4cG74+lIvICYlZcFY42B6vAzuz/HEVn5VbP3DDgQ7xuAGZtnI76cEkbPczDDgSMDR8iFkfBMTQV728mnsx84GopNWZxQsWJxbI9pD0hmNAzWB8bun41hRk+3mNlRFvbY86mcMEVCWWAX+xJbERJHWVPP3Wkq91uyDtuKDLrYNKLl7bww6rZulo3jnafyePJ64ZZi67aEl0MkbJtTbE1h+2vIzVOU3JwWISrNyNtfi+9xqECIXZk87ODcEMeBhjj41GN1Xf+DzP9c9UmPd39C1BID2rDpAwAAAABJRU5ErkJggg\x3d\x3d"})},
"esri/views/webgl/Program":function(){define(["require","exports","dojo/has"],function(x,r,k){return function(){function a(b,c,k,n,f){void 0===f&&(f={});this._glName=this._context=null;this._locations={};this._id=void 0;this._initialized=!1;this._fShader=this._vShader=null;this._defines={};this._nameToUniformLocation={};this._nameToAttribLocation={};this._nameToUniform1={};this._nameToUniform2={};this._nameToUniform3={};this._nameToUniform4={};this._nameToUniformMatrix3={};this._nameToUniformMatrix4=
{};b||console.error("RenderingContext isn't initialized!");0===c.length&&console.error("Shaders source should not be empty!");this._context=b;this._vertexShaderSource=c;this._fragmentShaderSource=k;if(Array.isArray(f))for(b=0;b<f.length;b++)this._defines[f[b]]="1";else this._defines=f;this._id=a._nextId++;this._locations=n}Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"glName",{get:function(){return this._glName},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"locations",{get:function(){return this._locations},enumerable:!0,configurable:!0});a.prototype.getDefine=function(a){return this._defines[a]};a.prototype.dispose=function(){if(this._context){var a=this._context.gl;this._vShader&&(a.deleteShader(this._vShader),this._vShader=null);this._fShader&&(a.deleteShader(this._fShader),this._fShader=null);this._glName&&(a.deleteProgram(this._glName),this._glName=null);this._context=null}};a.prototype.initialize=
function(){if(!this._initialized){this._vShader=this._loadShader(35633);this._fShader=this._loadShader(35632);this._vShader&&this._fShader||console.error("Error loading shaders!");var a=this._context.gl,c=a.createProgram();a.attachShader(c,this._vShader);a.attachShader(c,this._fShader);for(var k in this._locations)a.bindAttribLocation(c,this._locations[k],k);a.linkProgram(c);a.getProgramParameter(c,a.LINK_STATUS)||console.error("Could not initialize shader\nVALIDATE_STATUS: "+a.getProgramParameter(c,
a.VALIDATE_STATUS)+", gl error ["+a.getError()+"]infoLog: "+a.getProgramInfoLog(c));this._glName=c;this._initialized=!0}};a.prototype.getUniformLocation=function(a){this.initialize();void 0===this._nameToUniformLocation[a]&&(this._nameToUniformLocation[a]=this._context.gl.getUniformLocation(this._glName,a));return this._nameToUniformLocation[a]};a.prototype.hasUniform=function(a){return null!==this.getUniformLocation(a)};a.prototype.getAttribLocation=function(a){this.initialize();void 0===this._nameToAttribLocation[a]&&
(this._nameToAttribLocation[a]=this._context.gl.getAttribLocation(this._glName,a));return this._nameToAttribLocation[a]};a.prototype.setUniform1i=function(a,c){var b=this._nameToUniform1[a];if(void 0===b||c!==b)this._context.bindProgram(this),this._context.gl.uniform1i(this.getUniformLocation(a),c),this._nameToUniform1[a]=c};a.prototype.setUniform1f=function(a,c){var b=this._nameToUniform1[a];if(void 0===b||c!==b)this._context.bindProgram(this),this._context.gl.uniform1f(this.getUniformLocation(a),
c),this._nameToUniform1[a]=c};a.prototype.setUniform1fv=function(b,c){var k=this._nameToUniform2[b];void 0!==k&&a._arraysEqual(c,k)||(this._context.bindProgram(this),this._context.gl.uniform1fv(this.getUniformLocation(b),c),void 0===k?this._nameToUniform2[b]=new Float32Array(c):k.set(c))};a.prototype.setUniform2f=function(a,c,k){var b=this._nameToUniform2[a];if(void 0===b||c!==b[0]||k!==b[1])this._context.bindProgram(this),this._context.gl.uniform2f(this.getUniformLocation(a),c,k),void 0===b?this._nameToUniform2[a]=
new Float32Array([c,k]):(b[0]=c,b[1]=k)};a.prototype.setUniform2fv=function(b,c){var k=this._nameToUniform2[b];void 0!==k&&a._arraysEqual(c,k)||(this._context.bindProgram(this),this._context.gl.uniform2fv(this.getUniformLocation(b),c),void 0===k?this._nameToUniform2[b]=new Float32Array(c):k.set(c))};a.prototype.setUniform3f=function(a,c,k,n){var b=this._nameToUniform3[a];if(void 0===b||c!==b[0]||k!==b[1]||n!==b[2])this._context.bindProgram(this),this._context.gl.uniform3f(this.getUniformLocation(a),
c,k,n),void 0===b?this._nameToUniform3[a]=new Float32Array([c,k,n]):(b[0]=c,b[1]=k,b[2]=n)};a.prototype.setUniform3fv=function(b,c){var k=this._nameToUniform3[b];void 0!==k&&a._arraysEqual(c,k)||(this._context.bindProgram(this),this._context.gl.uniform3fv(this.getUniformLocation(b),c),void 0===k?this._nameToUniform3[b]=new Float32Array(c):k.set(c))};a.prototype.setUniform4f=function(a,c,k,n,f){var b=this._nameToUniform4[a];if(void 0===b||c!==b[0]||k!==b[1]||n!==b[2]||f!==b[3])this._context.bindProgram(this),
this._context.gl.uniform4f(this.getUniformLocation(a),c,k,n,f),void 0===b?this._nameToUniform4[a]=new Float32Array([c,k,n,f]):(b[0]=c,b[1]=k,b[2]=n,b[3]=f)};a.prototype.setUniform4fv=function(b,c){var k=this._nameToUniform4[b];void 0!==k&&a._arraysEqual(c,k)||(this._context.bindProgram(this),this._context.gl.uniform4fv(this.getUniformLocation(b),c),void 0===k?this._nameToUniform4[b]=new Float32Array(c):k.set(c))};a.prototype.setUniformMatrix3fv=function(b,c,k){void 0===k&&(k=!1);var n=this._nameToUniformMatrix3[b];
void 0!==n&&(9===n.length?a._matrix3Equal(n,c):a._arraysEqual(c,n))||(this._context.bindProgram(this),this._context.gl.uniformMatrix3fv(this.getUniformLocation(b),k,c),void 0===n?this._nameToUniformMatrix3[b]=new Float32Array(c):n.set(c))};a.prototype.setUniformMatrix4fv=function(b,c,k){void 0===k&&(k=!1);var n=this._nameToUniformMatrix4[b];void 0!==n&&(16===n.length?a._matrix4Equal(n,c):a._arraysEqual(c,n))||(this._context.bindProgram(this),this._context.gl.uniformMatrix4fv(this.getUniformLocation(b),
k,c),void 0===n?this._nameToUniformMatrix4[b]=new Float32Array(c):n.set(c))};a._padToThree=function(a){var b=a.toString();1E3>a&&(b=(" "+a).slice(-3));return b};a.prototype._addLineNumbers=function(b){var c=2;return b.replace(/\n/g,function(){return"\n"+a._padToThree(c++)+":"})};a.prototype._loadShader=function(a){var b=35633===a?this._vertexShaderSource:this._fragmentShaderSource,k="",n;for(n in this._defines)k+="#define "+n+" "+this._defines[n]+"\n";b=k+b;k=this._context.gl;a=k.createShader(a);
k.shaderSource(a,b);k.compileShader(a);k.getShaderParameter(a,k.COMPILE_STATUS)||(console.error(k.getShaderInfoLog(a)),console.error(this._addLineNumbers(b)));return a};a._matrix4Equal=function(a,c){return a[0]===c[0]&&a[1]===c[1]&&a[2]===c[2]&&a[3]===c[3]&&a[4]===c[4]&&a[5]===c[5]&&a[6]===c[6]&&a[7]===c[7]&&a[8]===c[8]&&a[9]===c[9]&&a[10]===c[10]&&a[11]===c[11]&&a[12]===c[12]&&a[13]===c[13]&&a[14]===c[14]&&a[15]===c[15]};a._matrix3Equal=function(a,c){return a[0]===c[0]&&a[1]===c[1]&&a[2]===c[2]&&
a[3]===c[3]&&a[4]===c[4]&&a[5]===c[5]&&a[6]===c[6]&&a[7]===c[7]&&a[8]===c[8]};a._arraysEqual=function(a,c){if(a.length!==c.length)return!1;for(var b=0;b<a.length;++b)if(a[b]!==c[b])return!1;return!0};a._nextId=0;return a}()})},"esri/views/3d/environment/RealisticAtmosphere":function(){define("dojo/text!./materials/RealisticAtmosphereMaterial.xml ../../../core/watchUtils ../../../core/HandleRegistry ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/OffscreenRenderingHelper ../support/earthUtils ../../webgl/Program ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){var w=l.earthRadius,D=b.vec3d,F=b.vec2d,G=b.vec4d;b=.02*Math.PI;l=.004*Math.PI;var p=D.createFrom(1/Math.pow(.65,4),1/Math.pow(.57,4),1/Math.pow(.475,4)),z=D.create(p);D.scale(z,b);D.add(z,D.createFrom(l,l,l));var A=(1- -.99999*-.99999)/(2+-.99999*-.99999)*1.5;a=a.createSubclass({declaredClass:"esri.views.3d.environment.RealisticAtmosphere",properties:{view:{},planar:{value:!1,set:function(a){a=!!a;a!==this.planar&&this._update();this._set("planar",a)}},needsRender:{value:!1}},
constructor:function(){this._handles=new k;this._lowerElevationBoundRadius=0;this._earthRadius=w;this._renderer=this._skyPlanarProgram=this._skyProgram=this._hazePlanarProgram=this._hazeProgram=null;this._renderData={texDepth:F.create(),v3CameraPos:D.create(),v3CameraUp:D.create(),v3CameraRight:D.create(),v3CameraDir:D.create(),halfSizeNearPlane:F.create(),v2CameraCenterOffset:F.create(),v4SphereComp:G.create(),v4AtmosParams1:G.create(),v4AtmosParams2:G.create(),v4AtmosParams3:G.create(),v3InvWavelength:p,
v3InvWavelengthScaled:z,v4Radii:G.create(),fScale:0,fScaleDepth:.25,fLowerAlphaBlendBound:0,fScaleOverScaleDepth:0,fOneOverScaleDepth:0,fScaleDepthBlue:.05,fOneOverScaleDepthBlue:20,fScaleOverScaleDepthBlue:0,g:-.99999,g2:-.99999*-.99999,fMiePhaseCoefficients:A,showTest:0,nearFar:F.create()};this._updateRadius(w);this._hazeSlot=f.POSTPROCESSING_ATMOSPHERE;this._skySlot=f.BACKGROUND},destroy:function(){this._handles&&(this._handles.destroy(),this._handles=null);this._hazeProgram&&(this._hazeProgram.dispose(),
this._hazeProgram=null);this._hazePlanarProgram&&(this._hazePlanarProgram.dispose(),this._hazePlanarProgram=null);this._skyProgram&&(this._skyProgram.dispose(),this._skyProgram=null);this._skyPlanarProgram&&(this._skyPlanarProgram.dispose(),this._skyPlanarProgram=null)},setup:function(a){var b=t.createSquareGeometry().toRenderData(),f=this.renderContext.rctx;this._renderer=new c(b,B.Pos3Tex,null,f);b=this._update.bind(this);this._handles.add(r.init(this,"view.state.camera",b,!0));var b=this._updateElevation.bind(this),
l=function(){this._updateElevation({tile:this.view.basemapTerrain.rootTiles[0]})}.bind(this),p=this._updateVisibleElevationBounds.bind(this);this._handles.add(r.on(this,"view.basemapTerrain","elevation-change",b,l));this._handles.add(r.on(this,"view.basemapTerrain","elevation-bounds-change",p,p));a.shaderSnippets.fsRealisticAtmosphere||a.shaderSnippets._parse(x);this._hazeProgram=new y(f,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,v.Default3D,["HAZE"]);this._skyProgram=
new y(f,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,v.Default3D);this._hazePlanarProgram=new y(f,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,v.Default3D,["HAZE","PLANAR"]);this._skyPlanarProgram=new y(f,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,v.Default3D,["PLANAR"])},render:function(a){if(!(a.slot!=this._hazeSlot&&a.slot!=this._skySlot||a.pass!=n.MATERIAL||a.slot==this._hazeSlot&&a.options.earlyOcclusionPixelDraw)){var b,
c=this.renderContext.rctx,f=c.gl,l=a.offscreenRenderingHelper,p=!1;if(a.slot==this._hazeSlot){b=this.planar?this._hazePlanarProgram:this._hazeProgram;c.bindProgram(b);c.setBlendFunctionSeparate(f.ONE,f.ONE_MINUS_SRC_COLOR,f.ZERO,f.ONE);l.detachDepthTextureFromBuffer();var p=!0,q=l.getDepthTexture();c.bindTexture(q,0);b.setUniform1i("tDepth",0);b.setUniform4fv("v4SphereComp",this._renderData.v4SphereComp)}a.slot==this._skySlot&&(b=this.planar?this._skyPlanarProgram:this._skyProgram,c.bindProgram(b),
c.setBlendFunctionSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA),b.setUniform4fv("v4SphereComp",this._renderData.v4SphereComp),b.setUniform4fv("v4AtmosParams3",this._renderData.v4AtmosParams3));b.setUniform3fv("v3InvWavelength",this._renderData.v3InvWavelength);b.setUniform3fv("v3InvWavelengthScaled",this._renderData.v3InvWavelengthScaled);b.setUniform3fv("v3LightDir",a.lightingData.direction);b.setUniform3fv("v3CameraPos",this._renderData.v3CameraPos);b.setUniform3fv("v3CameraUp",
this._renderData.v3CameraUp);b.setUniform3fv("v3CameraRight",this._renderData.v3CameraRight);b.setUniform3fv("v3CameraDir",this._renderData.v3CameraDir);b.setUniform2fv("nearFar",this._renderData.nearFar);b.setUniform2fv("halfSizeNearPlane",this._renderData.halfSizeNearPlane);b.setUniform2fv("v2CameraCenterOffset",this._renderData.v2CameraCenterOffset);b.setUniform4fv("v4Radii",this._renderData.v4Radii);b.setUniform4fv("v4AtmosParams1",this._renderData.v4AtmosParams1);b.setUniform4fv("v4AtmosParams2",
this._renderData.v4AtmosParams2);b.setUniform1f("showTest",this._renderData.showTest);c.setDepthTestEnabled(!1);c.setBlendingEnabled(!0);this._renderer.render(b);c.setBlendingEnabled(!1);c.setDepthTestEnabled(!0);c.setBlendFunctionSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA);p&&l.restoreDepthTextureToBuffer();return!0}},_setEnableTestImage:function(a){this._renderData.showTest=a?1:0;this.needsRender=!0},_adjustRadiusForTesselation:function(a){return a*Math.cos(Math.PI/Math.pow(2,
4)/16)},_normalizeRadius:function(a){a=this._adjustRadiusForTesselation(a);return Math.max(w-1E4,Math.min(a,w))},_updateElevation:function(a){0===a.tile.lij[0]&&(a=this._adjustRadiusForTesselation(w+a.tile.elevationBounds[0]),a!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=a,this._earthRadius=-1,this._updateVisibleElevationBounds()))},_updateVisibleElevationBounds:function(){var a=this._adjustRadiusForTesselation(w+this.view.basemapTerrain.getElevationBounds()[0]);return 0>this._earthRadius||
a<this._earthRadius?this._updateRadius(a):!1},_updateRadius:function(a){this._earthRadius=a;var b=a*a,c=a/10*10.25,f=c*c,l=1/(c-a),p=l/.25,n=l/.05,q=.3*(c-a)+a,k=1/(c-q),t=this._renderData;G.set4(l,.25,p,4,t.v4AtmosParams1);G.set4(-.99999,.05,n,20,t.v4AtmosParams2);G.set4(-.99999*-.99999,A,q,k,t.v4AtmosParams3);G.set4(a,b,c,f,t.v4Radii);t.fScale=l;t.fLowerAlphaBlendBound=q;t.fScaleOverScaleDepth=p;t.fScaleOverScaleDepthBlue=n;this._update();return!0},_update:function(a){if(a=a||this.get("view.state.camera")){D.negate(a.viewForward,
this._renderData.v3CameraDir);D.set(a.viewUp,this._renderData.v3CameraUp);D.set(a.viewRight,this._renderData.v3CameraRight);if(this.planar){var b=this.view.renderCoordsHelper;this._renderData.fCameraHeight=b.getAltitude(a.eye)/b.unitInMeters+w}else this._renderData.fCameraHeight=D.length(a.eye);this._renderData.fCameraHeight2=this._renderData.fCameraHeight*this._renderData.fCameraHeight;this._renderData.fC=this._renderData.fCameraHeight2-this._renderData.v4Radii[3];this._renderData.fCSur=this._renderData.fCameraHeight2-
this._renderData.v4Radii[1];this._renderData.v4SphereComp=G.createFrom(this._renderData.fCameraHeight,this._renderData.fCameraHeight2,this._renderData.fC,this._renderData.fCSur);D.set(a.eye,this._renderData.v3CameraPos);F.set2(Math.tan(a.fovX/2)/(a.width/a.fullWidth),Math.tan(a.fovY/2)/(a.height/a.fullHeight),this._renderData.halfSizeNearPlane);F.set2((a.padding[3]+a.width/2)/a.fullWidth-.5,(a.padding[2]+a.height/2)/a.fullHeight-.5,this._renderData.v2CameraCenterOffset);F.set2(a.near,a.far,this._renderData.nearFar);
this.needsRender=!0}}});a.isSupported=function(a){return q.supportsDepthTexture(a.rctx.extensions)};return a})},"esri/views/3d/webgl-engine/lib/OffscreenRenderingHelper":function(){define("require exports ./Util dojo/text!../materials/internal/offscreen.xml ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Program ../../../webgl/Util ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){var v={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,height:0},w={target:3553,pixelFormat:6408,dataType:32819,samplingMode:9729,wrapMode:33071,width:0,height:0};return function(){function l(a,b){this._hudVisibilityTexture=null;this._enabled=!1;this.height=this.width=0;this._programRep=a;this._rctx=b;this.height=this.width=null}l.prototype.enable=function(){if(!this.getEnableState()){var a=this._rctx;this._enabled=!0;this.framebuffer=
b.createWithAttachments(a,v,{colorTarget:0,depthStencilTarget:a.extensions.depthTexture?4:3});this.quadVAO=this.createQuadVAO(a)}};l.prototype.disable=function(){this.getEnableState()&&(this._enabled=!1,this.framebuffer.dispose(),this.quadVAO.dispose(!0),this._depthStencilTextureCached=this.quadVAO=this.framebuffer=null)};l.prototype.createQuadVAO=function(a){var b=new Float32Array([-1,-1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,1,1,1]);return new t(a,B.Default3D,{geometry:y.Pos2Tex},{geometry:n.createVertex(a,
35044,b)})};l.prototype.setEnableState=function(a){a?this.enable():this.disable()};l.prototype.getEnableState=function(){return this._enabled};l.prototype.getColorTexture=function(){return this.framebuffer.colorTexture};l.prototype.getDepthTexture=function(){return l.supportsDepthTexture(this._rctx.extensions)?this.framebuffer.depthStencilTexture||this._depthStencilTextureCached:null};l.prototype.getHUDVisibilityTexture=function(){return this._hudVisibilityTexture};l.supportsDepthTexture=function(a){return!!a.depthTexture};
l.prototype.initializeFrame=function(a){k.assert(this.getEnableState());var b=this._rctx,c=b.gl;a=a.fullViewport;this.width=a[2];this.height=a[3];this.framebuffer.resize(this.width,this.height);b.bindFramebuffer(this.framebuffer);b.setClearStencil(0);b.setClearColor(0,0,0,1);b.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT|c.STENCIL_BUFFER_BIT)};l.prototype.renderHUDVisibility=function(a){var b=this._rctx,f=b.gl;this._hudVisibilityTexture||(this._hudVisibilityTexture=new c(b,w));this._hudVisibilityTexture.resize(this.width,
this.height);var l=this.framebuffer.detachColorTexture();this.framebuffer.attachColorTexture(this._hudVisibilityTexture);b.bindFramebuffer(this.framebuffer);b.setClearColor(0,0,0,1);b.clear(f.COLOR_BUFFER_BIT);a();f.flush();this.framebuffer.detachColorTexture();this.framebuffer.attachColorTexture(l)};l.prototype.bindFramebuffer=function(){this._rctx.bindFramebuffer(this.framebuffer)};l.prototype.getFramebuffer=function(){return this.framebuffer};l.prototype.detachDepthTextureFromBuffer=function(){this._depthStencilTextureCached=
this.framebuffer.depthStencilTexture;this.framebuffer.detachDepthStencilTexture()};l.prototype.restoreDepthTextureToBuffer=function(){this.framebuffer.attachDepthStencilTexture(this._depthStencilTextureCached);this._depthStencilTextureCached=null};l.prototype.drawQuad=function(a){k.assert(this.getEnableState());a=this._rctx;var b=a.gl,c=this._programRep.get("offscreenProgram");a.bindFramebuffer();a.setDepthTestEnabled(!1);a.clear(b.COLOR_BUFFER_BIT);a.bindProgram(c);c.setUniform1i("tex",1);a.bindTexture(this.framebuffer.colorTexture,
1);a.bindVAO(this.quadVAO);a.drawArrays(5,0,q.vertexCount(this.quadVAO,"geometry"));a.setDepthTestEnabled(!0)};l.loadShaders=function(b,c,l,n){b._parse(a);b=new f(n,b.vsOffscreenRenderer,b.fsOffscreenRenderer,B.Default3D);l.add("offscreenProgram",b)};return l}()})},"esri/views/3d/environment/SimpleAtmosphere":function(){define("dojo/text!./materials/SimpleAtmosphereMaterial.xml dojo/Deferred ../../../core/watchUtils ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/GLTextureRep ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ./resources/SimpleAtmosphereTexture ../support/earthUtils ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){var D=B.earthRadius,F=b.vec3d,G=b.vec2d,p=b.mat4d,z=n.VertexAttrConstants,A=(D-1E4)/D,J=(D+3E5)/D,I=-1E4/3E5,K=1-I;return a.createSubclass({declaredClass:"esri.views.3d.environment.SimpleAtmosphere",properties:{view:{},needsRender:{value:!1},slot:{value:l.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={texV:G.create(),silCircleCenter:F.create(),silCircleV1:F.create(),silCircleV2:F.create()};this._textureRep=
this._texture=null},initialize:function(){this._textureDfd=new r;this.addResolvingPromise(this._textureDfd.promise)},destroy:function(){this._currentViewChangedHandle&&(this._currentViewChangedHandle.remove(),this._currentViewChangedHandle=null);this._textureRep&&(this._texture&&(this._textureRep.release("SimpleAtmosphere"),this._textureRep.getTexture("SimpleAtmosphere").unload()),this._textureRep=null);this._program&&(this._program.dispose(),this._program=null);this._textureDfd&&(this._textureDfd.cancel(),
this._textureDfd=null)},initializeRenderContext:function(a){this._textureRep=new f({SimpleAtmosphere:new t(y,"SimpleAtmosphere",{wrapClamp:!0})},a.programRep,function(){return this.view.state.camera.viewport}.bind(this),a.rctx);this._texture=this._textureRep.aquire("SimpleAtmosphere",void 0,void 0,function(a){this._texture=a.getGLTexture();this._textureDfd.resolve();this._textureDfd=null}.bind(this))},setup:function(a){var b=this._createRibbonGeometryData();this._renderer=new c(b,[{name:"position",
count:3,type:5126,offset:0,stride:12,normalized:!1}],null,a.rctx);this._currentViewChangedHandle=k.init(this,"view.state.camera",this._update.bind(this),!0);a.shaderSnippets.vsSimpleAtmosphere||a.shaderSnippets._parse(x);this._program=new v(a.rctx,a.shaderSnippets.vsSimpleAtmosphere,a.shaderSnippets.fsSimpleAtmosphere,w.Default3D)},render:function(a){if(a.slot!==this.slot||a.pass!==q.MATERIAL)return!1;var b=this.renderContext.rctx,c=b.gl,f=this._program;b.bindProgram(f);f.setUniform4f("color",1,1,
1,1);f.setUniformMatrix4fv("proj",a.camera.projectionMatrix);f.setUniformMatrix4fv("view",a.camera.viewMatrix);f.setUniform3fv("silCircleCenter",this._renderData.silCircleCenter);f.setUniform3fv("silCircleV1",this._renderData.silCircleV1);f.setUniform3fv("silCircleV2",this._renderData.silCircleV2);f.setUniform2fv("texV",this._renderData.texV);b.bindTexture(this._texture,0);f.setUniform1i("tex",0);f.setUniform3fv("lightDirection",a.lightingData.direction);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);
b.setDepthWriteEnabled(!1);this._renderer.render(f);b.setBlendingEnabled(!1);b.setDepthWriteEnabled(!0);b.setDepthFunction(c.LESS);return!0},_update:function(a){var b=F.create(),c=F.create(),f=F.create(),l=this.view.renderCoordsHelper.getAltitude(a.eye);F.scale(a.eye,(D+50)/F.length(a.eye),f);this._computeSilhouetteCircle(f,a.center,a.up,D);F.add(this._renderData.silCircleCenter,this._renderData.silCircleV2,b);F.scale(b,J,c);var f=this._computeScreenRimWidth(f,a.up,b,c),p=0,q=1,k=1;50>l?(p=.001953125,
q=.1015625):500>l?(k=(l-50)/450,p=.001953125*(1-k)+.001953125*k,q=.1015625*(1-k)+.21875*k):5E3>l?(k=(l-500)/4500,p=.001953125*(1-k)+.001953125*k,q=.21875*(1-k)+.51171875*k):5E4>l&&(k=(l-5E3)/45E3,p=.001953125*(1-k)+.001953125*k,q=.51171875*(1-k)+.4140625*k);l=I+p*K;k=I+f*q*K;50<F.length(a.eye)-D&&(this._computeSilhouetteCircle(a.eye,a.center,a.up,D),F.add(this._renderData.silCircleCenter,this._renderData.silCircleV2,b),F.scale(b,J,c),a=this._computeScreenRimWidth(a.eye,a.up,b,c),a=n.clamp((a-1.5)/
(f-1.5),0,1),l=I+a*p*K,k=I+n.lerp(1,f*q,a)*K);G.set2(l,k,this._renderData.texV);this.needsRender=!0},_computeSilhouetteCircle:function(a,b,c,f){var l=F.length(a),p=f*Math.sqrt(l*l-f*f)/l,n=this._renderData.silCircleV1,q=this._renderData.silCircleV2;F.scale(a,Math.sqrt(f*f-p*p)/l,this._renderData.silCircleCenter);F.cross(a,b,n);1>F.length2(n)&&F.cross(a,c,n);F.scale(n,p/F.length(n));F.cross(n,a,q);F.scale(q,p/F.length(q));return p},_computeScreenRimWidth:function(a,b,c,f){var l=p.create();p.lookAt(a,
c,b,l);a=this.view.state.camera;n.project(c,l,a.projectionMatrix,a.viewport);n.project(f,l,a.projectionMatrix,a.viewport);return F.dist(c,f)/a.height},_createRibbonGeometryData:function(){for(var a=new Float32Array(768),b=new Uint32Array(768),c=0;128>c;c++){var f=6*c;a[f+0]=c;a[f+1]=A;a[f+2]=0;a[f+3]=c;a[f+4]=J;a[f+5]=1;var l=2*c,p=127===c?0:l+2;b[f+0]=l;b[f+1]=l+1;b[f+2]=p+1;b[f+3]=p+1;b[f+4]=p;b[f+5]=l}c={};c[z.POSITION]=b;b={};b[z.POSITION]={size:3,data:a};return{indices:c,vertexAttr:b}}})})},
"esri/views/3d/environment/Stars":function(){define("dojo/text!./materials/StarMaterial.xml require ../../../request ../../../core/watchUtils ../../../core/promiseUtils ../../../core/Error ../../../core/Logger ../lib/glMatrix ../support/ExternalRenderer ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/Util ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F){var G=n.mat4d;n=n.mat3d;var p=l.VertexAttrConstants,z="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"),A=t.getLogger("esri.views.3d.environment.Stars"),J=n.toMat4(n.createFrom(1,0,0,0,.9174771405229186,.39778850739794974,0,-.39778850739794974,.9174771405229186)),I=n.toMat4(n.createFrom(1,0,0,0,.9174771405229186,-.39778850739794974,
0,.39778850739794974,.9174771405229186)),K=null;return f.createSubclass({properties:{view:{},numBinaryFloats:{value:2},numBinaryUInt8:{value:1},bytesPerStar:{value:9},needsRender:{value:!1},slot:{value:v.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={model:G.identity()};this.slot=v.BACKGROUND;this._vertexBufferLayout=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:20,
normalized:!1},{name:"size",count:1,type:5126,offset:16,stride:20,normalized:!1}]},initialize:function(){this._loadDataPromise=this._loadBrightStarCatalogue();this.addResolvingPromise(this._loadDataPromise)},destroy:function(){this._loadDataPromise.isFulfilled()||this._loadDataPromise.cancel("Atmosphere has been removed.");this._dateHandle&&(this._dateHandle.remove(),this._dateHandle=null);this._program&&(this._program.dispose(),this._program=null)},setup:function(b){this._numStars=this._starData.byteLength/
this.bytesPerStar;var c=new Float32Array(this._starData,0,this._numStars*this.numBinaryFloats),f=new Uint8Array(this._starData,this._numStars*this.numBinaryFloats*4,this._numStars*this.numBinaryUInt8),c=this._createStarGeometryData(c,f);this._renderer=new q(c,this._vertexBufferLayout,this._fillInterleaved,b.rctx);this._renderer.enablePointRendering(!0);this._dateHandle=a.init(this,"view.environment.lighting.date",this._update.bind(this));b.shaderSnippets.vertexShaderStar||b.shaderSnippets._parse(x);
this._program=new w(b.rctx,b.shaderSnippets.vertexShaderStar,b.shaderSnippets.fragmentShaderStar,D.Default3D)},render:function(a){if(a.slot!==this.slot||a.pass!==B.MATERIAL)return!1;var b=this.renderContext.rctx,c=b.gl,f=this._program;b.bindProgram(f);f.setUniformMatrix4fv("view",a.camera.viewMatrix);f.setUniformMatrix4fv("proj",a.camera.projectionMatrix);f.setUniform4fv("viewport",a.camera.fullViewport);f.setUniformMatrix4fv("model",this._renderData.model);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);
b.setBlendFunctionSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);b.setDepthWriteEnabled(!1);this._renderer.render(f);b.setBlendingEnabled(!1);b.setDepthWriteEnabled(!0);b.setDepthFunction(c.LESS);return!0},_fillInterleaved:function(a,b,c,f,l,n,q){var k=F.getStride(l);c=k/4;var t=y.fill,h=a.indices[p.POSITION],v=a.vertexAttr[p.POSITION].data;f=q+F.findAttribute(l,"position").offset/4;for(var w=0;w<h.length;++w){var e=3*h[w];t(v,e,n,f,b,3);f+=c}b=a.indices[p.COLOR];h=a.vertexAttr[p.COLOR].data;
f=q+F.findAttribute(l,"color").offset;v=new Uint8Array(n.buffer);for(w=0;w<b.length;++w)e=4*b[w],t(h,e,v,f,null,4),f+=k;k=a.indices[p.SIZE];a=a.vertexAttr[p.SIZE].data;f=q+F.findAttribute(l,"size").offset/4;for(w=0;w<k.length;++w)n[f]=a[k[w]],f+=c},_computeDayDuration:function(a){var b=new Date(a.getFullYear(),0,1,11,58,56),c=new Date(a.getFullYear()+1,0,1,11,58,55);return(a-b)/(c-b)},_update:function(a){if(a){var b=a.getHours()/12,c=a.getMinutes()/60*(2/24),f=a.getSeconds()/60*(2/1440),b=(b+c+f-
.9972222)%2;a=2*this._computeDayDuration(a);c=G.create(I);G.rotateZ(c,-a*Math.PI);G.multiply(J,c,c);G.rotateZ(c,-b*Math.PI);this._renderData.model=c;this.needsRender=!0}},_hexToRGB:function(a){return[parseInt(a.substring(0,2),16),parseInt(a.substring(2,4),16),parseInt(a.substring(4,6),16)]},_unpackUint8Attributes:function(a){return 192<=a?[2.9,a-192]:160<=a?[2.5,a-160]:128<=a?[2,a-128]:96<=a?[1.5,a-96]:64<=a?[1,a-64]:32<=a?[.7,a-32]:[.4,a]},_createStarGeometryData:function(a,b){for(var c=new Float32Array(3*
this._numStars),f=new Uint8Array(4*this._numStars),l=new Float32Array(this._numStars),n=new Uint32Array(this._numStars),q=0;q<this._numStars;q++){var k=2*q,t=3*q,h=4*q,v=a[k+0],k=a[k+1];c[t+0]=-Math.cos(v)*Math.sin(k);c[t+1]=-Math.sin(v)*Math.sin(k);c[t+2]=-Math.cos(k);t=this._unpackUint8Attributes(b[q]);v=this._hexToRGB(z[t[1]]);f[h+0]=255*v[0];f[h+1]=255*v[1];f[h+2]=255*v[2];f[h+3]=255;l[q]=t[0];n[q]=q}a={};a[p.POSITION]=n;a[p.NORMAL]=n;a[p.UV0]=n;a[p.COLOR]=n;a[p.SIZE]=n;n={};n[p.POSITION]={size:3,
data:c};n[p.COLOR]={size:4,data:f};n[p.SIZE]={size:1,data:l};return{indices:a,vertexAttr:n}},_verifyStartData:function(a){if(!a)throw new c("stars:no-data-received","Failed to create stars because star catalogue is missing");a=a.byteLength/this.bytesPerStar;if(0!==a%1||5E4<a||5E3>a)throw new c("stars:invalid-data","Failed to create stars because star catalogue data is invalid");},_loadBrightStarCatalogue:function(){return K?(this._starData=K,b.resolve()):k(r.toUrl("./resources/stars.wsv"),{responseType:"array-buffer",
failOk:!0}).then(function(a){a=a.data;this._verifyStartData(a);this._starData=K=a}.bind(this)).otherwise(function(a){A.error("loadBrightStarCatalogue",a.message);throw a;})}})})},"esri/views/3d/webgl-engine/lighting/Lightsources":function(){define(["require","exports","../../lib/glMatrix"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});var a=k.vec3d;x=function(){return function(b,c,k){void 0===b&&(b=a.create());void 0===c&&(c=a.createFrom(.57735,.57735,.57735));void 0===k&&(k=!0);
this.intensity=b;this.direction=c;this.castShadows=k}}();r.MainLight=x;x=function(){return function(b,c){void 0===b&&(b=a.create());void 0===c&&(c=a.createFrom(.57735,.57735,.57735));this.intensity=a.create();this.direction=a.create();this.intensity=b;this.direction=c}}();r.FillLight=x;x=function(){return function(b){void 0===b&&(b=a.create());this.intensity=b}}();r.AmbientLight=x;x=function(){return function(){this.sh={r:[0],g:[0],b:[0]}}}();r.SphericalHarmonicsLight=x})},"esri/views/3d/constraints/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ./AltitudeConstraint ./ClipDistanceConstraint ./TiltConstraint ./CollisionConstraint".split(" "),
function(x,r,k,a,b,c,t,n,f,q){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function l(){var a=null!==c&&c.apply(this,arguments)||this;a.tilt=new f.default;a.altitude=new t.default;a.clipDistance=new n.default;a.collision=new q.default;return a}k(l,c);a([b.property({type:f.default})],l.prototype,"tilt",void 0);a([b.property({type:t.default})],l.prototype,"altitude",void 0);a([b.property({type:n.default})],l.prototype,"clipDistance",void 0);a([b.property({type:q.default})],l.prototype,
"collision",void 0);return l=a([b.subclass("esri.views.3d.constraints.Constraints")],l)}(b.declared(c));r.Constraints=x;r.default=x})},"esri/views/3d/constraints/AltitudeConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor dojo/_base/kernel ../state/Constraints".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function f(){var a=
null!==c&&c.apply(this,arguments)||this;a.min=n.AltitudeDefault.min;a.max=n.AltitudeDefault.max;return a}k(f,c);Object.defineProperty(f.prototype,"mode",{get:function(){t.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.","","4.6");return"manual"},set:function(a){t.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.",
"","4.6")},enumerable:!0,configurable:!0});a([b.property({type:Number})],f.prototype,"min",void 0);a([b.property({type:Number})],f.prototype,"max",void 0);return f=a([b.subclass("esri.views.3d.constraints.AltitudeConstraint")],f)}(b.declared(c));r.AltitudeConstraint=x;r.default=x})},"esri/views/3d/constraints/ClipDistanceConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor".split(" "),
function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function n(){var a=null!==c&&c.apply(this,arguments)||this;a.mode="auto";return a}k(n,c);Object.defineProperty(n.prototype,"near",{get:function(){return this._get("near")},set:function(a){this._set("near",a);a>=this._get("far")&&(this.far=a+1E-9);this.mode="manual"},enumerable:!0,configurable:!0});n.prototype.castNear=function(a){return Math.max(1E-8,a)};Object.defineProperty(n.prototype,"far",{get:function(){return this._get("far")},
set:function(a){this._set("far",a);a<=this._get("near")&&(this.near=a-1E-9);this.mode="manual"},enumerable:!0,configurable:!0});n.prototype.castFar=function(a){return Math.max(1E-8,a)};n.prototype.autoUpdate=function(a,b){"auto"===this.mode&&(this._get("near")!==a&&this._set("near",a),this._get("far")!==b&&this._set("far",b))};a([b.property({type:Number,value:1E-8})],n.prototype,"near",null);a([b.cast("near")],n.prototype,"castNear",null);a([b.property({type:Number,value:1E-8})],n.prototype,"far",
null);a([b.cast("far")],n.prototype,"castFar",null);a([b.property({type:String})],n.prototype,"mode",void 0);return n=a([b.subclass("esri.views.3d.constraints.ClipDistanceConstraint")],n)}(b.declared(c));r.ClipDistanceConstraint=x;r.default=x})},"esri/views/3d/constraints/TiltConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../support/mathUtils ../state/Constraints".split(" "),
function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});var f=t.rad2deg(n.TiltDefault.min),q=t.rad2deg(n.TiltDefault.max);x=function(c){function l(){var a=null!==c&&c.apply(this,arguments)||this;a.mode="auto";return a}k(l,c);Object.defineProperty(l.prototype,"max",{get:function(){return this._get("max")},set:function(a){this._set("max",a);this.mode="manual"},enumerable:!0,configurable:!0});l.prototype.castMax=function(a){return t.clamp(a,f,q)};l.prototype.autoUpdate=function(a){"auto"===
this.mode&&this._get("max")!==a&&this._set("max",a)};a([b.property({type:String})],l.prototype,"mode",void 0);a([b.property({type:Number,value:q})],l.prototype,"max",null);a([b.cast("max")],l.prototype,"castMax",null);return l=a([b.subclass("esri.views.3d.constraints.TiltConstraint")],l)}(b.declared(c));r.TiltConstraint=x;r.default=x})},"esri/views/3d/constraints/CollisionConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor".split(" "),
function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function n(){var a=null!==c&&c.apply(this,arguments)||this;a.enabled=!0;return a}k(n,c);a([b.property()],n.prototype,"enabled",void 0);return n=a([b.subclass("esri.views.3d.constraints.CollisionConstraint")],n)}(b.declared(c));r.CollisionConstraint=x;r.default=x})},"esri/views/3d/input/SceneInputManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/watchUtils ../../../core/Accessor ../../../core/HandleRegistry ../../../core/accessorSupport/decorators ../../input/InputManager ../../input/BrowserEventSource ../../input/ViewEvents ../../input/handlers/PreventContextMenu ./handlers/DoubleClickZoom ./handlers/DragRotate ./handlers/DragZoom ./handlers/KeyPan ./handlers/MouseWheelZoom ./handlers/SingleKeyResetHeading ./handlers/SingleKeyResetTilt ./handlers/PointerDownCancelAnimation ./handlers/TwoFingerTilt ./handlers/PinchAndPanNavigation".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J){x=function(c){function r(){var a=null!==c&&c.apply(this,arguments)||this;a._handles=new t;return a}k(r,c);r.prototype.initialize=function(){var a=this;this.viewEvents=new l.ViewEvents(this.view);this._handles.add([b.whenNot(this.view,"ready",function(){return a._disconnect()}),b.when(this.view,"ready",function(){return a._connect()})])};r.prototype.destroy=function(){this._handles&&(this._handles.removeAll(),this._handles=null);this._disconnect()};
Object.defineProperty(r.prototype,"primaryDragAction",{get:function(){return this._get("primaryDragAction")},set:function(a){"pan"!==a&&"rotate"!==a||a===this._get("primaryDragAction")||(this._set("primaryDragAction",a),this._updateMode())},enumerable:!0,configurable:!0});Object.defineProperty(r.prototype,"mode",{get:function(){return this._get("mode")},set:function(a){"default"!==a&&"pro"!==a||a===this._get("mode")||(this._set("mode",a),this._updateMode())},enumerable:!0,configurable:!0});r.prototype._disconnect=
function(){this.viewEvents.disconnect();this._source&&(this._source.destroy(),this._source=null);this._inputManager&&(this._inputManager.destroy(),this._inputManager=null)};r.prototype._connect=function(){var a=this.view;this._source=new q.BrowserEventSource(this.view.canvas);var b=new f.InputManager(this._source);this._inputManager=b;b.installHandlers("prevent-context-menu",[new y.PreventContextMenu]);this._modeDragPan=new J.PinchAndPanNavigation(a,"primary");this._modeDragRotate=new v.DragRotate(a,
"secondary","center");this._modeDragZoom=new w.DragZoom(a,"tertiary");b.installHandlers("navigation",[new z.PointerDownCancelAnimation(a),new B.DoubleClickZoom(a),new D.KeyPan(a,{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j"}),new F.MouseWheelZoom(a),new p.SingleKeyResetTilt(a,"p"),new G.SingleKeyResetHeading(a,"n"),new v.DragRotate(a,"primary","eye",["b"]),new v.DragRotate(a,"secondary","center",["b"]),new J.PinchAndPanNavigation(a,"tertiary",["b"]),this._modeDragRotate,
this._modeDragZoom,this._modeDragPan,new A.TwoFingerTilt(a)]);this.viewEvents.connect(b);this._updateMode()};r.prototype._updateMode=function(){var a=this.primaryDragAction,a=I.get(this.mode).get(a);this._modeDragPan&&(this._modeDragPan.pointerType=a.pan);this._modeDragRotate&&(this._modeDragRotate.pointerType=a.rotate);this._modeDragZoom&&(this._modeDragZoom.pointerType=a.zoom)};a([n.property()],r.prototype,"view",void 0);a([n.property({value:"pan"})],r.prototype,"primaryDragAction",null);a([n.property({value:"default"})],
r.prototype,"mode",null);a([n.property({readOnly:!0,aliasOf:"_inputManager.latestPointerType"})],r.prototype,"latestPointerType",void 0);a([n.property()],r.prototype,"_inputManager",void 0);return r=a([n.subclass("esri.views.3d.input.SceneInputManager")],r)}(n.declared(c));var I=new Map;r=new Map;c=new Map;r.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"});r.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"});c.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"});
c.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"});I.set("default",r);I.set("pro",c);return x})},"esri/views/input/InputManager":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor ../../core/now dojo/has ./keys ./recognizers ../../core/Logger ./handlers/LatestPointerType".split(" "),function(x,r,k,a,b,c,t,n,f,q,l,y){Object.defineProperty(r,"__esModule",{value:!0});
var B=l.getLogger("esri.views.input.InputManager");x=function(c){function l(a,b){a=c.call(this)||this;a._pointerCaptures=new Map;a._nameToGroup={};a._handlers=[];a._currentPropagation=null;a._sourceEvents=new Set;a._keyModifiers=new Set;a._activeKeyModifiers=new Set;a.primaryKey=f.primaryKey;a.latestPointerType="mouse";a._installRecognizers();return a}k(l,c);l.prototype.normalizeCtorArgs=function(a,b){this._browserEvents=a;this._browserEvents.onEventReceived=this._onEventReceived.bind(this);this._recognizers=
b;this._recognizers||(this._recognizers=q.defaults.map(function(a){return new a}));return{}};l.prototype.destroy=function(){for(var a=0,b=Object.keys(this._nameToGroup);a<b.length;a++)this.uninstallHandlers(b[a])};l.prototype.installHandlers=function(a,b){var c=this;if(this._nameToGroup[a])B.error("There is already an InputHandler group registered under the name `"+a+"`");else if(0===b.length)B.error("Can't register a group of zero handlers");else{var f={name:a,handlers:b.map(function(a,b){return{handler:a,
active:!0,removed:!1,priorityIndex:0,eventCallback:null,uninstallCallback:null}})};this._nameToGroup[a]=f;a=function(a){var b=f.handlers[a];l._handlers.push(b);b.handler.onInstall({updateDependencies:function(){c.updateDependencies()},emit:function(a,f,l,p){c._emitInputEvent(b.priorityIndex,a,f,l,p)},setPointerCapture:function(a,l){c._setPointerCapture(f,b,a,l)},setEventCallback:function(a){b.eventCallback=a},setUninstallCallback:function(a){b.uninstallCallback=a}})};var l=this;for(b=f.handlers.length-
1;0<=b;b--)a(b);this.updateDependencies()}};l.prototype.uninstallHandlers=function(a){var b=this._nameToGroup[a];b?(b.handlers.forEach(function(a){a.removed=!0;a.uninstallCallback()}),delete this._nameToGroup[a],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):B.error("There is no InputHandler group registered under the name `"+a+"`")};l.prototype.hasHandlers=function(a){return void 0!==this._nameToGroup[a]};l.prototype.updateDependencies=
function(){var a=new Set,b=new Set;this._handlersPriority=[];for(var c=this._handlers.length-1;0<=c;c--){var l=this._handlers[c];l.priorityIndex=c;this._handlersPriority.push(l)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(c=this._handlersPriority.length-1;0<=c;c--){l=this._handlersPriority[c];l.priorityIndex=c;var n=l.handler.hasSideEffects;if(!n)for(var q=0,k=l.handler.outgoingEventTypes;q<k.length;q++)if(a.has(k[q])){n=!0;break}if(n)for(q=0,k=l.handler.incomingEventMatches;q<
k.length;q++){var t=k[q];a.add(t.eventType);for(var v=0,t=t.keyModifiers;v<t.length;v++){var y=t[v];f.isSystemModifier(y)||b.add(y)}}l.active=n}this._sourceEvents=a;this._keyModifiers=b;0<this._pointerCaptures.size&&this._sourceEvents.add("pointer-capture-lost");0<this._keyModifiers.size&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up"));this._browserEvents&&(this._browserEvents.activeEvents=this._sourceEvents)};l.prototype._setLatestPointerType=function(a){this._set("latestPointerType",
a)};l.prototype._onEventReceived=function(a,b){"pointer-capture-lost"===a&&this._pointerCaptures.delete(b.native.pointerId);this._updateKeyModifiers(a,b);this._emitInputEventFromSource(a,b,b.native.timestamp)};l.prototype._updateKeyModifiers=function(a,b){var c=this;if(b){var f=!1,l=function(){if(!f){var a=new Set;c._activeKeyModifiers.forEach(function(b){a.add(b)});c._activeKeyModifiers=a;f=!0}},n=function(a,b){b&&!c._activeKeyModifiers.has(a)?(l(),c._activeKeyModifiers.add(a)):!b&&c._activeKeyModifiers.has(a)&&
(l(),c._activeKeyModifiers.delete(a))};if("key-down"===a||"key-up"===a){var q=b.key;this._keyModifiers.has(q)&&n(q,"key-down"===a)}a=b.native;n("Alt",!(!a||!a.altKey));n("Ctrl",!(!a||!a.ctrlKey));n("Shift",!(!a||!a.shiftKey));n("Meta",!(!a||!a.metaKey));n("Primary",this._activeKeyModifiers.has(this.primaryKey))}};l.prototype._installRecognizers=function(){var a=this;this._latestPointerTypeHandler=new y.LatestPointerType(function(b){return a._setLatestPointerType(b)});0<this._recognizers.length&&this.installHandlers("default",
this._recognizers);this.installHandlers("input-manager-logic",[this._latestPointerTypeHandler])};l.prototype.allowPointerCapture=function(a){return 2!==a.button?!0:!n("chrome")};l.prototype._setPointerCapture=function(a,b,c,f){a=a.name+"-"+b.priorityIndex;b=this._pointerCaptures.get(c.pointerId)||new Set;this._pointerCaptures.set(c.pointerId,b);f&&this.allowPointerCapture(c)?(b.add(a),1===b.size&&this._browserEvents&&this._browserEvents.setPointerCapture(c,!0)):!f&&b.has(a)&&(b.delete(a),0===b.size&&
(this._pointerCaptures.delete(c.pointerId),this._browserEvents&&this._browserEvents.setPointerCapture(c,!1)))};l.prototype._garbageCollectRemovedHandlers=function(){this._handlers=this._handlers.filter(function(a){return!a.removed});this.updateDependencies()};l.prototype._emitInputEventFromSource=function(a,b,c){this._emitInputEvent(0,a,b,c)};l.prototype._emitInputEvent=function(a,b,c,f,l){f=void 0!==f?f:this._currentPropagation?this._currentPropagation.timestamp:t();b=new v(b,c,f,l||this._activeKeyModifiers);
this._currentPropagation?this._currentPropagation.addedEvents.push(b):this._doNewPropagation(a,b)};l.prototype._doNewPropagation=function(a,b){for(a=this._currentPropagation={events:[b],addedEvents:[],currentHandler:this._handlersPriority[a],needsHandlerGarbageCollect:!1,timestamp:b.timestamp};a.currentHandler;){if(a.currentHandler.removed)a.needsHandlerGarbageCollect=!0;else{b=a.events;var c=[];a.addedEvents=[];for(var f=0;f<b.length;f++){var l=b[f];a.currentHandler.active&&a.currentHandler.eventCallback(l);
l.shouldStopPropagation()||c.push(l)}a.events=c.concat(a.addedEvents)}a.currentHandler=this._handlersPriority[a.currentHandler.priorityIndex+1]}a.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers();this._currentPropagation=null};l.prototype._compareHandlerPriority=function(a,b){if(a.handler.hasSideEffects!==b.handler.hasSideEffects)return a.handler.hasSideEffects?1:-1;for(var c=0,f=a.handler.incomingEventMatches;c<f.length;c++)for(var l=f[c],n=function(a){if(l.eventType!==a.eventType)return"continue";
var b=l.keyModifiers.filter(function(b){return-1!==a.keyModifiers.indexOf(b)});if(b.length===l.keyModifiers.length!==(b.length===a.keyModifiers.length))return{value:l.keyModifiers.length>a.keyModifiers.length?-1:1}},q=0,k=b.handler.incomingEventMatches;q<k.length;q++){var t=n(k[q]);if("object"===typeof t)return t.value}return a.priorityIndex>b.priorityIndex?-1:1};l.prototype._sortHandlersPriority=function(a){for(var b=[],c=0;c<a.length;c++){for(var f=a[c],l=0;l<b.length&&0<=this._compareHandlerPriority(f,
b[l]);)l++;b.splice(l,0,f)}return b};a([b.property({readOnly:!0})],l.prototype,"latestPointerType",void 0);return l=a([b.subclass("esri.views.input.InputManager")],l)}(b.declared(c));r.InputManager=x;var v=function(){function a(a,b,c,f){this.type=a;this.data=b;this.timestamp=c;this.modifiers=f;this._stopPropagation=!1}a.prototype.stopPropagation=function(){this._stopPropagation=!0};a.prototype.shouldStopPropagation=function(){return this._stopPropagation};return a}()})},"esri/views/input/keys":function(){define(["require",
"exports","../../core/sniff"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.primaryKey="Meta";var a={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(x=48;58>x;x++)a[x]=String.fromCharCode(x);for(x=1;25>x;x++)a[111+x]="F"+x;for(x=65;91>x;x++)a[x]=[String.fromCharCode(x+32),String.fromCharCode(x)];var b={Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",
Down:"ArrowDown",Esc:"Escape"};r.eventKey=function(c){if(void 0!==c.key)return b[c.key]||c.key;var k=a[c.keyCode];return Array.isArray(k)?c.shiftKey?k[1]:k[0]:k};r.isSystemModifier=function(a){switch(a){case "Ctrl":case "Alt":case "Shift":case "Meta":case "Primary":return!0}}})},"esri/views/input/recognizers":function(){define("require exports ./recognizers/Drag ./recognizers/PointerClickHoldAndDrag ./recognizers/SingleAndDoubleClick ./recognizers/VerticalTwoFingerDrag".split(" "),function(x,r,k,
a,b,c){Object.defineProperty(r,"__esModule",{value:!0});r.defaults=[a.PointerClickHoldAndDrag,b.SingleAndDoubleClick,k.Drag,c.VerticalTwoFingerDrag]})},"esri/views/input/recognizers/Drag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function c(){var b=a.call(this,!1)||this;b._startStateModifiers=new Set;b._activePointers=[];b._activePointerMap=new Map;
b._isDragging=!1;b._drag=b.registerOutgoing("drag");b.registerIncoming("pointer-drag",b._handlePointerDrag.bind(b));b.registerIncoming("pointer-down",b._handlePointerDown.bind(b));b.registerIncoming("pointer-up",b._handlePointerUpAndPointerLost.bind(b));b.registerIncoming("pointer-capture-lost",b._handlePointerUpAndPointerLost.bind(b));return b}k(c,a);c.prototype._createPayload=function(a,b){return{action:a,pointers:this._activePointers.map(function(a){return a.data}),startState:this._startState,
previousState:this._previousState,currentState:b}};c.prototype._fitCircleLSQ=function(){var a=this._activePointers.map(function(a){return a.data.currentEvent});return b.fitCircleLSQ(a)};c.prototype._createDragState=function(a){for(var b=this._fitCircleLSQ(),c=0,l=0,n=this._activePointers;l<n.length;l++){for(var k=n[l],t=this._pointerAngle(k,b),t=t-k.lastAngle;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;t=k.lastAngle+t;k.lastAngle=t;c+=t-k.initialAngle}c/=this._activePointers.length;return{angle:c,
radius:b.radius,center:b.center,timestamp:a}};c.prototype._updateMultiPointer=function(a,b){var c=a.startEvent.native.pointerId,f=this._activePointerMap.get(c),n=!f;n?(f={data:null,initialAngle:0,lastAngle:0},this._activePointers.push(f),this._activePointerMap.set(c,f),f.data={startEvent:a.startEvent,previousEvent:a.previousEvent,currentEvent:a.currentEvent},a=this._fitCircleLSQ(),f.initialAngle=this._pointerAngle(f,a),f.lastAngle=f.initialAngle):f.data={startEvent:f.data.startEvent,previousEvent:a.previousEvent,
currentEvent:a.currentEvent};n&&this._isDragging&&this._updateInitialAngles(b);return f};c.prototype._pointerAngle=function(a,b){a=a.data.currentEvent;return Math.atan2(a.y-b.center.y,a.x-b.center.x)};c.prototype._updateInitialAngles=function(a){a=this._createDragState(a);for(var b=0,c=this._activePointers;b<c.length;b++){var l=c[b];l.initialAngle=this._pointerAngle(l,a)}};c.prototype._emitStart=function(a){this._updateInitialAngles(a.timestamp);var b=this._createDragState(a.timestamp);this._previousState=
this._startState=b;this._startStateModifiers=a.modifiers;this._isDragging=!0;for(var c=0,l=this._activePointers;c<l.length;c++){var n=l[c];n.data={previousEvent:n.data.currentEvent,startEvent:n.data.currentEvent,currentEvent:n.data.currentEvent}}this._drag.emit(this._createPayload("start",b),a.timestamp)};c.prototype._emitUpdate=function(a){a=this._createDragState(a.timestamp);this._drag.emit(this._createPayload("update",a),void 0,this._startStateModifiers);this._previousState=a};c.prototype._emitEnd=
function(a){a=this._createDragState(a);this._drag.emit(this._createPayload("end",a),void 0,this._startStateModifiers);this._startState=this._previousState=null;this._isDragging=!1};c.prototype._handlePointerDown=function(a){var b=a.data;this._isDragging&&this._emitEnd(a.timestamp);this._updateMultiPointer({startEvent:b,previousEvent:b,currentEvent:b},a.timestamp)};c.prototype._removeMultiPointer=function(a,b){var c=a.native.pointerId,f=this._activePointerMap.get(c);f&&(this._isDragging&&(this._updateMultiPointer({startEvent:f.data.startEvent,
previousEvent:f.data.currentEvent,currentEvent:a},b),this._emitEnd(b)),this._activePointerMap.delete(c),a=this._activePointers.indexOf(f),this._activePointers.splice(a,1),this._isDragging&&this._updateInitialAngles(b))};c.prototype._handlePointerUpAndPointerLost=function(a){this._removeMultiPointer(a.data,a.timestamp)};c.prototype._handlePointerDrag=function(a){var b=a.data;switch(b.action){case "start":this._isDragging||this._emitStart(a);break;case "update":this._isDragging||this._emitStart(a),
this._updateMultiPointer(b,a.timestamp),this._emitUpdate(a)}};return c}(a.InputHandler);r.Drag=x})},"esri/views/input/InputHandler":function(){define(["require","exports","./EventMatch","../../core/Logger"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});var b=a.getLogger("esri.views.input.InputHandler");x=function(){function a(a){this._manager=null;this._incoming={};this._outgoing={};this._outgoingEventTypes=this._incomingEventTypes=this._incomingEventMatches=null;this._hasSideEffects=
a}Object.defineProperty(a.prototype,"incomingEventMatches",{get:function(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(var a in this._incoming)for(var b=0,c=this._incoming[a];b<c.length;b++)this._incomingEventMatches.push(c[b].match)}return this._incomingEventMatches},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"incomingEventTypes",{get:function(){this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(function(a){return a.eventType}));
return this._incomingEventTypes},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"outgoingEventTypes",{get:function(){this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing));return this._outgoingEventTypes},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasSideEffects",{get:function(){return this._hasSideEffects},enumerable:!0,configurable:!0});a.prototype.onInstall=function(a){var c=this;this._manager?b.error("This InputHandler has already been registered with an InputManager"):
(a.setEventCallback(function(a){return c._handleEvent(a)}),a.setUninstallCallback(function(){return c._onUninstall()}),this._manager=a)};a.prototype.onUninstall=function(){};a.prototype.registerIncoming=function(a,b,l){var f=this;"function"===typeof b?(l=b,b=[]):b=b||[];a="string"===typeof a?new k.EventMatch(a,b):a;var n=function(){f._incomingEventTypes=null;f._incomingEventMatches=null};b=function(a){var b=f._incoming[a.match.eventType];b&&(a=b.indexOf(a),b.splice(a,1),n(),f._manager&&f._manager.updateDependencies())};
l=new c(a,l,{onPause:b,onRemove:b,onResume:function(a){var b=f._incoming[a.match.eventType];b&&-1===b.indexOf(a)&&(b.push(a),n(),f._manager&&f._manager.updateDependencies())}});b=this._incoming[a.eventType];b||(b=[],this._incoming[a.eventType]=b);b.push(l);n();this._manager&&this._manager.updateDependencies();return l};a.prototype.registerOutgoing=function(a){var b=this;if(this._outgoing[a])throw Error("There is already a callback registered for this outgoing InputEvent: "+a);var c=new t(a,{onEmit:function(a,
c,f,l){b._manager.emit(a.eventType,c,f,l)},onRemove:function(a){delete b._outgoing[a.eventType];b._manager.updateDependencies()}});this._outgoing[a]=c;this._outgoingEventTypes=null;this._manager&&this._manager.updateDependencies();return c};a.prototype.startCapturingPointer=function(a){this._manager.setPointerCapture(a,!0)};a.prototype.stopCapturingPointer=function(a){this._manager.setPointerCapture(a,!1)};a.prototype._onUninstall=function(){this._manager?(this.onUninstall(),this._manager=null):b.error("This InputHandler is not registered with an InputManager")};
a.prototype._handleEvent=function(a){var b=this._incoming[a.type];if(b)for(var c=0;c<b.length;c++){var f=b[c];if(f.match.matches(a)&&(f.callback(a),a.shouldStopPropagation()))break}};return a}();r.InputHandler=x;var c=function(){function a(a,b,c){this.match=a;this._callback=b;this._handler=c}a.prototype.pause=function(){this._handler.onPause(this)};a.prototype.resume=function(){this._handler.onResume(this)};a.prototype.remove=function(){this._handler.onRemove(this)};Object.defineProperty(a.prototype,
"callback",{get:function(){return this._callback},enumerable:!0,configurable:!0});return a}(),t=function(){function a(a,b){this.eventType=a;this._removed=!1;this._handler=b}a.prototype.emit=function(a,b,c){if(!this._removed)this._handler.onEmit(this,a,b,c)};a.prototype.remove=function(){this._removed=!0;this._handler.onRemove(this)};return a}()})},"esri/views/input/EventMatch":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(a,
b){void 0===b&&(b=[]);this.eventType=a;this.keyModifiers=b}k.prototype.matches=function(a){if(a.type!==this.eventType)return!1;if(0===this.keyModifiers.length)return!0;a=a.modifiers;for(var b=0,c=this.keyModifiers;b<c.length;b++)if(!a.has(c[b]))return!1;return!0};return k}();r.EventMatch=x})},"esri/views/input/recognizers/support":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.manhattanDistance=function(k,a){return Math.abs(a.x-k.x)+Math.abs(a.y-
k.y)};r.euclideanDistance=function(k,a){var b=a.x-k.x;k=a.y-k.y;return Math.sqrt(b*b+k*k)};r.fitCircleLSQ=function(k,a){a?(a.radius=0,a.center.x=0,a.center.y=0):a={radius:0,center:{x:0,y:0}};if(0===k.length)return a;if(1===k.length)return a.center.x=k[0].x,a.center.y=k[0].y,a;if(2===k.length){var b=k[0];k=k[1];var c=[k.x-b.x,k.y-b.y],t=c[0],c=c[1];a.radius=Math.sqrt(t*t+c*c)/2;a.center.x=(b.x+k.x)/2;a.center.y=(b.y+k.y)/2;return a}for(var n=0,f=0,q=0;q<k.length;q++)n+=k[q].x,f+=k[q].y;for(var n=n/
k.length,f=f/k.length,l=k.map(function(a){return a.x-n}),y=k.map(function(a){return a.y-f}),B=b=a=0,v=0,w=t=0,q=c=0;q<l.length;q++){var r=l[q],F=y[q],G=r*r,p=F*F;a+=G;b+=p;B+=r*F;v+=G*r;t+=p*F;w+=r*p;c+=F*G}q=a;l=B;y=b;v=.5*(v+w);t=.5*(t+c);c=q*y-B*l;w=(v*y-t*l)/c;t=(q*t-B*v)/c;return{radius:Math.sqrt(w*w+t*t+(a+b)/k.length),center:{x:w+n,y:t+f}}}})},"esri/views/input/recognizers/PointerClickHoldAndDrag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler",
"./support"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});r.DefaultParameters={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilTouchDrag:6,holdDelay:500};x=function(a){function c(b,c,q,l){void 0===b&&(b=r.DefaultParameters.maximumClickDelay);void 0===c&&(c=r.DefaultParameters.movementUntilMouseDrag);void 0===q&&(q=r.DefaultParameters.movementUntilTouchDrag);void 0===l&&(l=r.DefaultParameters.holdDelay);var f=a.call(this,!1)||this;f.maximumClickDelay=b;f.movementUntilMouseDrag=
c;f.movementUntilTouchDrag=q;f.holdDelay=l;f._pointerState=new Map;f._modifiers=new Set;f._pointerDrag=f.registerOutgoing("pointer-drag");f._pointerClick=f.registerOutgoing("pointer-click");f._pointerHold=f.registerOutgoing("hold");f.registerIncoming("pointer-down",f._handlePointerDown.bind(f));f.registerIncoming("pointer-up",f._handlePointerUpOrLost.bind(f));f.registerIncoming("pointer-capture-lost",f._handlePointerUpOrLost.bind(f));f._moveHandle=f.registerIncoming("pointer-move",f._handlePointerMove.bind(f));
f._moveHandle.pause();return f}k(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.holdTimeout&&(clearTimeout(a.holdTimeout),a.holdTimeout=0)});a.prototype.onUninstall.call(this)};c.prototype._handlePointerDown=function(a){var b=this,c=a.data,l=c.native.pointerId,n=0;0===this._pointerState.size&&(n=setTimeout(function(){var c=b._pointerState.get(l);c&&(c.isDragging||(b._pointerHold.emit(c.previousEvent,void 0,a.modifiers),c.holdEmitted=!0),c.holdTimeout=0)},this.holdDelay));
1===this._pointerState.size&&this._pointerState.forEach(function(a){0!==a.holdTimeout&&(clearTimeout(a.holdTimeout),a.holdTimeout=0)});this._pointerState.set(l,{startEvent:c,previousEvent:c,startTimestamp:a.timestamp,isDragging:!1,downButton:c.native.button,holdTimeout:n});this.startCapturingPointer(c.native);this._moveHandle.resume()};c.prototype._createPointerDragData=function(a,b,c){return{action:a,startEvent:b.startEvent,previousEvent:b.previousEvent,currentEvent:c}};c.prototype._handlePointerMove=
function(a){var c=a.data,n=this._pointerState.get(c.native.pointerId);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,c),void 0,this._modifiers):b.euclideanDistance(c,n.startEvent)>("touch"===c.native.pointerType?this.movementUntilTouchDrag:this.movementUntilMouseDrag)&&(n.isDragging=!0,n.previousEvent=n.startEvent,this._modifiers=a.modifiers,0!==n.holdTimeout&&clearTimeout(n.holdTimeout),this._pointerDrag.emit(this._createPointerDragData("start",n,n.startEvent),n.startTimestamp),
this._pointerDrag.emit(this._createPointerDragData("update",n,c))),n.previousEvent=c)};c.prototype._handlePointerUpOrLost=function(a){var b=a.data,c=b.native.pointerId,l=this._pointerState.get(c);l&&(0!==l.holdTimeout&&clearTimeout(l.holdTimeout),l.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",l,b),void 0,this._modifiers):l.downButton===b.native.button&&a.timestamp-l.startTimestamp<=this.maximumClickDelay&&!l.holdEmitted&&this._pointerClick.emit(b),this._pointerState.delete(c),
this.stopCapturingPointer(b.native),0===this._pointerState.size&&this._moveHandle.pause())};return c}(a.InputHandler);r.PointerClickHoldAndDrag=x})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});r.DefaultParameters={maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};
x=function(a){function c(b,c,q,l){void 0===b&&(b=r.DefaultParameters.maximumDoubleClickDelay);void 0===c&&(c=r.DefaultParameters.maximumDoubleClickDistance);void 0===q&&(q=r.DefaultParameters.maximumDoubleTouchDelay);void 0===l&&(l=r.DefaultParameters.maximumDoubleTouchDistance);var f=a.call(this,!1)||this;f.maximumDoubleClickDelay=b;f.maximumDoubleClickDistance=c;f.maximumDoubleTouchDelay=q;f.maximumDoubleTouchDistance=l;f._pointerState=new Map;f._click=f.registerOutgoing("click");f._doubleClick=
f.registerOutgoing("double-click");f._firstClick=f.registerOutgoing("first-click");f.registerIncoming("pointer-click",f._handlePointerClick.bind(f));return f}k(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.doubleClickTimeout&&(clearTimeout(a.doubleClickTimeout),a.doubleClickTimeout=0)})};c.prototype._pointerId=function(a){a=a.native;return"mouse"===a.pointerType?a.pointerId+":"+a.button:""+a.pointerType};c.prototype._handlePointerClick=function(a){var c=a.data,
n=this._pointerId(c),l=this._pointerState.get(n);if(l){clearTimeout(l.doubleClickTimeout);l.doubleClickTimeout=0;var k="touch"===c.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;b.manhattanDistance(l.event.data,c)>k?(this._doubleClickTimeoutExceeded(n),this._startClick(a)):(this._doubleClick.emit(c,void 0,l.event.modifiers),this._pointerState.delete(n))}else this._startClick(a)};c.prototype._startClick=function(a){var b=this,c=a.data,l=this._pointerId(a.data);this._pointerState.set(l,
{event:a,doubleClickTimeout:setTimeout(function(){return b._doubleClickTimeoutExceeded(l)},"touch"===c.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay)});this._firstClick.emit(a.data,void 0,a.modifiers)};c.prototype._doubleClickTimeoutExceeded=function(a){var b=this._pointerState.get(a);this._click.emit(b.event.data,void 0,b.event.modifiers);b.doubleClickTimeout=0;this._pointerState.delete(a)};return c}(a.InputHandler);r.SingleAndDoubleClick=x})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["require",
"exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c){void 0===b&&(b=20);void 0===c&&(c=40);var f=a.call(this,!1)||this;f._threshold=b;f._maxDelta=c;f._failed=!1;f._active=!1;f._vertical=f.registerOutgoing("vertical-two-finger-drag");f._artificalDragEnd=f.registerOutgoing("drag");f.registerIncoming("drag",f._handleDrag.bind(f));return f}k(b,a);Object.defineProperty(b.prototype,"failed",
{get:function(){return this._failed},enumerable:!0,configurable:!0});b.prototype._handleDrag=function(a){if(2===a.data.pointers.length)switch(a.data.action){case "start":this._handleDragStart(a);break;case "update":this._handleDragUpdate(a);break;case "end":this._handleDragEnd(a)}};b.prototype._handleDragStart=function(a){this._failed=!1};b.prototype._handleDragUpdate=function(a){this._failed||(this._active?(this._vertical.emit({delta:a.data.currentState.center.y-this._thresholdReachedCenter.y,action:"update"}),
a.stopPropagation()):(this._failed=!this._checkDeltaConstraint(a.data),!this._failed&&this._checkThresholdReached(a.data)&&(this._active=!0,this._thresholdReachedCenter=a.data.currentState.center,this._artificalDragEnd.emit({action:"end",currentState:a.data.currentState,previousState:a.data.previousState,startState:a.data.startState,pointers:a.data.pointers}),this._vertical.emit({delta:a.data.currentState.center.y-this._thresholdReachedCenter.y,action:"begin"}),a.stopPropagation())))};b.prototype._handleDragEnd=
function(a){this._active&&(this._vertical.emit({delta:a.data.currentState.center.y-this._thresholdReachedCenter.y,action:"end"}),a.stopPropagation());this._active=!1};b.prototype._checkDeltaConstraint=function(a){var b=Math.abs(a.pointers[0].startEvent.x-a.pointers[1].startEvent.x),c=Math.abs(a.pointers[0].startEvent.y-a.pointers[1].startEvent.y),q=Math.abs(a.pointers[0].currentEvent.y-a.pointers[1].currentEvent.y),l=Math.abs(a.pointers[0].currentEvent.x-a.pointers[1].currentEvent.x);return Math.abs(a.currentState.center.x-
a.startState.center.x)<this._threshold&&Math.abs(l-b)<=this._maxDelta&&Math.abs(q-c)<=this._maxDelta};b.prototype._checkThresholdReached=function(a){return Math.min(Math.abs(a.pointers[0].currentEvent.y-a.pointers[0].startEvent.y),Math.abs(a.pointers[1].currentEvent.y-a.pointers[1].startEvent.y),Math.abs(a.currentState.center.y-a.startState.center.y))>=this._threshold};return b}(a.InputHandler);r.VerticalTwoFingerDrag=x})},"esri/views/input/handlers/LatestPointerType":function(){define(["require",
"exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b){var c=a.call(this,!0)||this;c._onChange=b;c._value="mouse";c.registerIncoming("pointer-down",function(a){c._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});c._moveHandler=c.registerIncoming("pointer-move",function(a){c._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});c._moveHandler.pause();return c}k(b,a);
b.prototype._setValue=function(a){a!==this._value&&("touch"===a?this._moveHandler.resume():this._moveHandler.pause(),this._value=a,this._onChange(a))};return b}(a.InputHandler);r.LatestPointerType=x})},"esri/views/input/BrowserEventSource":function(){define(["require","exports","./keys","../../core/libs/pep/pep","dojo/sniff"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});var c=b("trident"),t=b("edge"),n=b("chrome"),f=b("ff"),q=b("safari");x=function(){function b(b){this._active=
{};this._activePointerCaptures=new Set;this._keyDownState=new Set;this._element=b;a.applyLocal(b);b.getAttribute("tabindex")||b.setAttribute("tabindex","0");this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost};
this._initialCssTouchAction=b.style.touchAction;b.style.touchAction="none"}b.prototype.destroy=function(){var a=this;this.activeEvents=this._callback=null;this._activePointerCaptures.forEach(function(b){a._element.releasePointerCapture(b)});this._activePointerCaptures=null;this._element.style.touchAction=this._initialCssTouchAction};Object.defineProperty(b.prototype,"onEventReceived",{set:function(a){this._callback=a},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"activeEvents",
{set:function(a){var b=this,c;for(c in this._active)a&&a.has(c)||(this._element.removeEventListener(l[c],this._active[c]),delete this._active[c]);a&&a.forEach(function(a){if(!b._active[a]&&l[a]){var c=(b._eventHandlers[a]||b._handleDefault).bind(b,a);b._element.addEventListener(l[a],c);b._active[a]=c}})},enumerable:!0,configurable:!0});b.prototype.setPointerCapture=function(a,b){b?(this._element.setPointerCapture(a.pointerId),this._activePointerCaptures.add(a.pointerId)):(this._element.releasePointerCapture(a.pointerId),
this._activePointerCaptures.delete(a.pointerId))};b.prototype._updateNormalizedPointerLikeEvent=function(a,b){var c=this._element.getBoundingClientRect();b.x=a.clientX-Math.round(c.left);b.y=a.clientY-Math.round(c.top);return b};b.prototype._handleKey=function(a,b){var c=k.eventKey(b);c&&"key-up"===a&&this._keyDownState.delete(c);b={native:b,key:c,repeat:c&&this._keyDownState.has(c)};c&&"key-down"===a&&this._keyDownState.add(b.key);this._callback(a,b)};b.prototype._handlePointer=function(a,b){b=this._updateNormalizedPointerLikeEvent(b,
{native:b,x:0,y:0});this._callback(a,b)};b.prototype._handlePointerPreventDefault=function(a,b){var c=this._updateNormalizedPointerLikeEvent(b,{native:b,x:0,y:0});b.preventDefault();this._callback(a,c)};b.prototype._handleMouseWheel=function(a,b){b.preventDefault();var l=b.deltaY;switch(b.deltaMode){case 0:if(c||t)l=l/document.documentElement.clientHeight*600;break;case 1:l*=30;break;case 2:l*=900}c||t?l*=.7:n||q?l*=.6:f&&(l*=1.375);var k=Math.abs(l);100<k&&(l=l/k*200/(1+Math.exp(-.02*(k-100))));
b=this._updateNormalizedPointerLikeEvent(b,{native:b,x:0,y:0,deltaY:l});this._callback(a,b)};b.prototype._handlePointerCaptureLost=function(a,b){this._activePointerCaptures.delete(b.pointerId);this._handleDefault(a,b)};b.prototype._handleDefault=function(a,b){var c={native:b};b.preventDefault();this._callback(a,c)};return b}();r.BrowserEventSource=x;var l={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel",
"pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave"}})},"esri/core/libs/pep/pep":function(){define(function(){function x(a,b){b=b||Object.create(null);var d=document.createEvent("Event");d.initEvent(a,b.bubbles||!1,b.cancelable||!1);a=2;for(var e;a<q.length;a++)e=q[a],d[e]=b[e]||l[a];d.buttons=b.buttons||0;a=0;a=b.pressure?b.pressure:d.buttons?.5:0;d.x=d.clientX;d.y=d.clientY;
d.pointerId=b.pointerId||0;d.width=b.width||0;d.height=b.height||0;d.pressure=a;d.tiltX=b.tiltX||0;d.tiltY=b.tiltY||0;d.pointerType=b.pointerType||"";d.hwTimestamp=b.hwTimestamp||0;d.isPrimary=b.isPrimary||!1;return d}function r(){this.array=[];this.size=0}function k(a,b,d,e){this.addCallback=a.bind(e);this.removeCallback=b.bind(e);this.changedCallback=d.bind(e);I&&(this.observer=new I(this.mutationWatcher.bind(this)))}function a(a){return"body /shadow-deep/ "+b(a)}function b(a){return'[touch-action\x3d"'+
a+'"]'}function c(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; touch-action-delay: none; }"}function t(){if(P){L.forEach(function(d){String(d)===d?(O+=b(d)+c(d)+"\n",U&&(O+=a(d)+c(d)+"\n")):(O+=d.selectors.map(b)+c(d.rule)+"\n",U&&(O+=d.selectors.map(a)+c(d.rule)+"\n"))});var d=document.createElement("style");d.textContent=O;document.head.appendChild(d)}}function n(a){if(!F.pointermap.has(a))throw a=Error("InvalidPointerId"),a.name="InvalidPointerId",a;}function f(a){if(!a.ownerDocument.contains(a))throw a=
Error("InvalidStateError"),a.name="InvalidStateError",a;}var q="bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedTarget pageX pageY".split(" "),l=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],y=window.Map&&window.Map.prototype.forEach?Map:r;r.prototype={set:function(a,b){if(void 0===b)return this.delete(a);this.has(a)||this.size++;this.array[a]=b},has:function(a){return void 0!==this.array[a]},delete:function(a){this.has(a)&&(delete this.array[a],
this.size--)},get:function(a){return this.array[a]},clear:function(){this.size=this.array.length=0},forEach:function(a,b){return this.array.forEach(function(d,e){a.call(b,d,e,this)},this)}};var B="bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedTarget buttons pointerId width height pressure tiltX tiltY pointerType hwTimestamp isPrimary type target currentTarget which pageX pageY timeStamp".split(" "),v=[!1,!1,null,null,0,0,0,0,!1,!1,!1,
!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],w={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},D="undefined"!==typeof SVGElementInstance,F={pointermap:new y,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(a,b){var d=b.events;d&&(d.forEach(function(a){b[a]&&(this.eventMap[a]=b[a].bind(b))},this),this.eventSources[a]=b,this.eventSourceList.push(b))},register:function(a){for(var b=this.eventSourceList.length,
d=0,e;d<b&&(e=this.eventSourceList[d]);d++)e.register.call(e,a)},unregister:function(a){for(var b=this.eventSourceList.length,d=0,e;d<b&&(e=this.eventSourceList[d]);d++)e.unregister.call(e,a)},contains:function(a,b){try{return a.contains(b)}catch(fa){return!1}},down:function(a){a.bubbles=!0;this.fireEvent("pointerdown",a)},move:function(a){a.bubbles=!0;this.fireEvent("pointermove",a)},up:function(a){a.bubbles=!0;this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1;this.fireEvent("pointerenter",
a)},leave:function(a){a.bubbles=!1;this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0;this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0;this.fireEvent("pointerout",a)},cancel:function(a){a.bubbles=!0;this.fireEvent("pointercancel",a)},leaveOut:function(a){this.out(a);this.propagate(a,this.leave,!1)},enterOver:function(a){this.over(a);this.propagate(a,this.enter,!0)},eventHandler:function(a){if(!a._handledByPE){var b=a.type;(b=this.eventMap&&this.eventMap[b])&&b(a);a._handledByPE=
!0}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){this.captureInfo[b.pointerId]&&(b.relatedTarget=null);a=new x(a,b);b.preventDefault&&(a.preventDefault=b.preventDefault);a._target=a._target||b.target;return a},fireEvent:function(a,b){a=this.makeEvent(a,
b);return this.dispatchEvent(a)},cloneEvent:function(a){for(var b=Object.create(null),d,e=0;e<B.length;e++)d=B[e],b[d]=a[d]||v[e],D&&("target"===d||"relatedTarget"===d)&&b[d]instanceof SVGElementInstance&&(b[d]=b[d].correspondingUseElement);a.preventDefault&&(b.preventDefault=function(){a.preventDefault()});return b},getTarget:function(a){var b=this.captureInfo[a.pointerId];if(!b)return a._target;if(a._target===b||!(a.type in w))return b},propagate:function(a,b,d){for(var e=a.target,c=[];!e.contains(a.relatedTarget)&&
e!==document;)c.push(e),e=e.parentNode;d&&c.reverse();c.forEach(function(d){a.target=d;b.call(this,a)},this)},setCapture:function(a,b){this.captureInfo[a]&&this.releaseCapture(a);this.captureInfo[a]=b;var d=new x("gotpointercapture");d.pointerId=a;this.implicitRelease=this.releaseCapture.bind(this,a);document.addEventListener("pointerup",this.implicitRelease);document.addEventListener("pointercancel",this.implicitRelease);d._target=b;this.asyncDispatchEvent(d)},releaseCapture:function(a){var b=this.captureInfo[a];
if(b){var d=new x("lostpointercapture");d.pointerId=a;this.captureInfo[a]=void 0;document.removeEventListener("pointerup",this.implicitRelease);document.removeEventListener("pointercancel",this.implicitRelease);d._target=b;this.asyncDispatchEvent(d)}},dispatchEvent:function(a){var b=this.getTarget(a);if(b)return b.dispatchEvent(a)},asyncDispatchEvent:function(a){requestAnimationFrame(this.dispatchEvent.bind(this,a))}};F.boundHandler=F.eventHandler.bind(F);var G={shadow:function(a){if(a)return a.shadowRoot||
a.webkitShadowRoot},canTarget:function(a){return a&&!!a.elementFromPoint},targetingShadow:function(a){a=this.shadow(a);if(this.canTarget(a))return a},olderShadow:function(a){var b=a.olderShadowRoot;!b&&(a=a.querySelector("shadow"))&&(b=a.olderShadowRoot);return b},allShadows:function(a){var b=[];for(a=this.shadow(a);a;)b.push(a),a=this.olderShadow(a);return b},searchRoot:function(a,b,d){if(a){var e=a.elementFromPoint(b,d),c;for(c=this.targetingShadow(e);c;){if(a=c.elementFromPoint(b,d))return e=this.targetingShadow(a),
this.searchRoot(e,b,d)||a;c=this.olderShadow(c)}return e}},owner:function(a){for(;a.parentNode;)a=a.parentNode;a.nodeType!==Node.DOCUMENT_NODE&&a.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(a=document);return a},findTarget:function(a){var b=a.clientX,d=a.clientY;a=this.owner(a.target);a.elementFromPoint(b,d)||(a=document);return this.searchRoot(a,b,d)}},p=Array.prototype.forEach.call.bind(Array.prototype.forEach),z=Array.prototype.map.call.bind(Array.prototype.map),A=Array.prototype.slice.call.bind(Array.prototype.slice),
J=Array.prototype.filter.call.bind(Array.prototype.filter),I=window.MutationObserver||window.WebKitMutationObserver,K={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};k.prototype={watchSubtree:function(a){this.observer&&G.canTarget(a)&&this.observer.observe(a,K)},enableOnSubtree:function(a){this.watchSubtree(a);a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){p(this.findElements(a),
this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll("[touch-action]"):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(A(b))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(a){return a.nodeType===
Node.ELEMENT_NODE},flattenMutationTree:function(a){var b=z(a,this.findElements,this);b.push(J(a,this.isElement));return b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){"childList"===a.type?(this.flattenMutationTree(a.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(a.removedNodes).forEach(this.removeElement,this)):"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}};var L=["none","auto","pan-x",
"pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],O="",P=window.PointerEvent||window.MSPointerEvent,U=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,N=F.pointermap,R=[1,4,2,8,16],S=!1;try{S=1===(new MouseEvent("test",{buttons:1})).buttons}catch(W){}var T={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){F.listen(a,this.events)},unregister:function(a){F.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){var b=
this.lastTouches,d=a.clientX;a=a.clientY;for(var e=0,c=b.length,g;e<c&&(g=b[e]);e++){var h=Math.abs(a-g.y);if(25>=Math.abs(d-g.x)&&25>=h)return!0}},prepareEvent:function(a){var b=F.cloneEvent(a),d=b.preventDefault;b.preventDefault=function(){a.preventDefault();d()};b.pointerId=this.POINTER_ID;b.isPrimary=!0;b.pointerType=this.POINTER_TYPE;return b},prepareButtonsForMove:function(a,b){var d=N.get(this.POINTER_ID);a.buttons=0!==b.which&&d?d.buttons:0;b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=
N.get(this.POINTER_ID),d=this.prepareEvent(a);S||(d.buttons=R[d.button],b&&(d.buttons|=b.buttons),a.buttons=d.buttons);N.set(this.POINTER_ID,a);b&&0!==b.buttons?F.move(d):F.down(d)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);S||this.prepareButtonsForMove(b,a);b.button=-1;N.set(this.POINTER_ID,a);F.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=N.get(this.POINTER_ID),d=this.prepareEvent(a);if(!S){var e=R[d.button];d.buttons=
b?b.buttons&~e:0;a.buttons=d.buttons}N.set(this.POINTER_ID,a);d.buttons&=~R[d.button];0===d.buttons?F.up(d):F.move(d)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);S||this.prepareButtonsForMove(b,a);b.button=-1;N.set(this.POINTER_ID,a);F.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);S||this.prepareButtonsForMove(b,a);b.button=-1;F.leaveOut(b)}},cancel:function(a){a=this.prepareEvent(a);F.cancel(a);
this.deactivateMouse()},deactivateMouse:function(){N.delete(this.POINTER_ID)}},V=F.captureInfo,h=G.findTarget.bind(G),ca=G.allShadows.bind(G),Q=F.pointermap,e,d={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){e.enableOnSubtree(a)},unregister:function(a){},elementAdded:function(a){var b=a.getAttribute("touch-action"),d=this.touchActionToScrollType(b);d&&(a._scrollType=d,F.listen(a,this.events),ca(a).forEach(function(a){a._scrollType=d;F.listen(a,this.events)},this))},
elementRemoved:function(a){a._scrollType=void 0;F.unlisten(a,this.events);ca(a).forEach(function(a){a._scrollType=void 0;F.unlisten(a,this.events)},this)},elementChanged:function(a,b){var d=a.getAttribute("touch-action"),e=this.touchActionToScrollType(d);b=this.touchActionToScrollType(b);e&&b?(a._scrollType=e,ca(a).forEach(function(a){a._scrollType=e},this)):b?this.elementRemoved(a):e&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},
touchActionToScrollType:function(a){var b=this.scrollTypes;if("none"===a)return"none";if(a===b.XSCROLLER)return"X";if(a===b.YSCROLLER)return"Y";if(b.SCROLLER.exec(a))return"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){if(0===Q.size||1===Q.size&&Q.has(1))this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount()},removePrimaryPointer:function(a){a.isPrimary&&
(this.firstXY=this.firstTouch=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0;this.resetId=null}.bind(this);this.resetId=setTimeout(a,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;if("touchstart"===a||"touchmove"===a)b=1;return b},touchToPointer:function(a){var b=this.currentTouchEvent,d=F.cloneEvent(a),e=d.pointerId=a.identifier+2;d.target=V[e]||h(d);d.bubbles=
!0;d.cancelable=!0;d.detail=this.clickCount;d.button=0;d.buttons=this.typeToButtons(b.type);d.width=a.radiusX||a.webkitRadiusX||0;d.height=a.radiusY||a.webkitRadiusY||0;d.pressure=a.force||a.webkitForce||.5;d.isPrimary=this.isPrimaryTouch(a);d.pointerType=this.POINTER_TYPE;d.altKey=b.altKey;d.ctrlKey=b.ctrlKey;d.metaKey=b.metaKey;d.shiftKey=b.shiftKey;var c=this;d.preventDefault=function(){c.scrolling=!1;c.firstXY=null;b.preventDefault()};return d},processTouches:function(a,b){var d=a.changedTouches;
this.currentTouchEvent=a;a=0;for(var e;a<d.length;a++)e=d[a],b.call(this,this.touchToPointer(e))},shouldScroll:function(a){if(this.firstXY){var b;b=a.currentTarget._scrollType;if("none"===b)b=!1;else if("XY"===b)b=!0;else{a=a.changedTouches[0];var d="Y"===b?"X":"Y";b=Math.abs(a["client"+b]-this.firstXY[b])>=Math.abs(a["client"+d]-this.firstXY[d])}this.firstXY=null;return b}},findTouch:function(a,b){for(var d=0,e=a.length,c;d<e&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=
a.touches;if(Q.size>=b.length){var d=[];Q.forEach(function(a,e){1===e||this.findTouch(b,e-2)||d.push(a.out)},this);d.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a);this.setPrimaryTouch(a.changedTouches[0]);this.dedupSynthMouse(a);this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){Q.set(a.pointerId,{target:a.target,out:a,outTarget:a.target});F.enterOver(a);F.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?
(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=Q.get(a.pointerId);if(b){var d=b.out,e=b.outTarget;F.move(a);d&&e!==a.target&&(d.relatedTarget=a.target,a.relatedTarget=e,d.target=e,a.target?(F.leaveOut(d),F.enterOver(a)):(a.target=e,a.relatedTarget=null,this.cancelOut(a)));b.out=a;b.outTarget=a.target}},touchend:function(a){this.dedupSynthMouse(a);this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||
(F.up(a),F.leaveOut(a));this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){F.cancel(a);F.leaveOut(a);this.cleanUpPointer(a)},cleanUpPointer:function(a){Q.delete(a.pointerId);this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=T.lastTouches;a=a.changedTouches[0];this.isPrimaryTouch(a)&&(a={x:a.clientX,y:a.clientY},b.push(a),b=function(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}.bind(null,b,a),setTimeout(b,2500))}};e=new k(d.elementAdded,
d.elementRemoved,d.elementChanged,d);var g=F.pointermap,m=window.MSPointerEvent&&"number"===typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,u={events:"MSPointerDown MSPointerMove MSPointerUp MSPointerOut MSPointerOver MSPointerCancel MSGotPointerCapture MSLostPointerCapture".split(" "),register:function(a){F.listen(a,this.events)},unregister:function(a){F.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;m&&(b=F.cloneEvent(a),b.pointerType=
this.POINTER_TYPES[a.pointerType]);return b},cleanup:function(a){g.delete(a)},MSPointerDown:function(a){g.set(a.pointerId,a);a=this.prepareEvent(a);F.down(a)},MSPointerMove:function(a){a=this.prepareEvent(a);F.move(a)},MSPointerUp:function(a){var b=this.prepareEvent(a);F.up(b);this.cleanup(a.pointerId)},MSPointerOut:function(a){a=this.prepareEvent(a);F.leaveOut(a)},MSPointerOver:function(a){a=this.prepareEvent(a);F.enterOver(a)},MSPointerCancel:function(a){var b=this.prepareEvent(a);F.cancel(b);this.cleanup(a.pointerId)},
MSLostPointerCapture:function(a){a=F.makeEvent("lostpointercapture",a);F.dispatchEvent(a)},MSGotPointerCapture:function(a){a=F.makeEvent("gotpointercapture",a);F.dispatchEvent(a)}},C,M;window.navigator.msPointerEnabled?(C=function(a){n(a);f(this);0!==F.pointermap.get(a).buttons&&this.msSetPointerCapture(a)},M=function(a){n(a);this.msReleasePointerCapture(a)}):(C=function(a){n(a);f(this);0!==F.pointermap.get(a).buttons&&F.setCapture(a,this)},M=function(a){n(a);F.releaseCapture(a,this)});var Y=window.PointerEvent||
window.MSPointerEvent;return{dispatcher:F,Installer:k,PointerEvent:x,PointerMap:y,targetFinding:G,applyGlobal:function(){t();window.PointerEvent||(window.PointerEvent=x,window.navigator.msPointerEnabled?(Object.defineProperty(window.navigator,"maxTouchPoints",{value:window.navigator.msMaxTouchPoints,enumerable:!0}),F.registerSource("ms",u)):(F.registerSource("mouse",T),void 0!==window.ontouchstart&&F.registerSource("touch",d)),F.register(document));window.Element&&!Element.prototype.setPointerCapture&&
Object.defineProperties(Element.prototype,{setPointerCapture:{value:C},releasePointerCapture:{value:M}})},applyLocal:function(a){Y||(window.PointerEvent||(window.navigator.msPointerEnabled?F.registerSource("ms",u):(F.registerSource("mouse",T),void 0!==window.ontouchstart&&F.registerSource("touch",d)),F.register(document)),window.Element&&!Element.prototype.setPointerCapture&&(a.setPointerCapture=C.bind(a),a.releasePointerCapture=M.bind(a)),a.getAttribute("touch-action")||a.setAttribute("touch-action",
"none"))}}})},"esri/views/input/ViewEvents":function(){define(["require","exports","../../core/tsSupport/extendsHelper","./InputHandler","../../geometry/ScreenPoint"],function(x,r,k,a,b){function c(a){return!!n[a]}function t(a){for(var b=0;b<a.length;b++)if(!c(a[b]))return!1;return!0}Object.defineProperty(r,"__esModule",{value:!0});var n={click:!0,"double-click":!0,hold:!0,drag:!0,"key-down":!0,"key-up":!0,"pointer-down":!0,"pointer-move":!0,"pointer-up":!0,"mouse-wheel":!0,"pointer-enter":!0,"pointer-leave":!0},
f;(function(a){a[a.Left=0]="Left";a[a.Middle=1]="Middle";a[a.Right=2]="Right"})(f||(f={}));x=function(){function a(a){this.handlers=new Map;this.counter=0;this.view=a;this.inputManager=null}a.prototype.connect=function(a){var b=this;a&&this.disconnect();this.inputManager=a;this.handlers.forEach(function(a,c){return b.inputManager.installHandlers(c,[a])})};a.prototype.disconnect=function(){var a=this;this.inputManager&&this.handlers.forEach(function(b,c){return a.inputManager.uninstallHandlers(c)});
this.inputManager=null};a.prototype.destroy=function(){this.disconnect();this.handlers.clear();this.view=null};a.prototype.register=function(a,b,f){var l=this;a=Array.isArray(a)?a:a.split(",");if(!t(a))return a.some(c)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;var n=Array.isArray(b)?b:[];f=Array.isArray(b)?f:b;var k=this.createUniqueGroupName();b=new q(this.view,a,n,f);this.handlers.set(k,b);this.inputManager&&this.inputManager.installHandlers(k,
[b]);return{remove:function(){return l.removeHandler(k)}}};a.prototype.removeHandler=function(a){this.handlers.has(a)&&this.handlers.delete(a);this.inputManager&&this.inputManager.uninstallHandlers(a)};a.prototype.createUniqueGroupName=function(){this.counter+=1;return"viewEvents_"+this.counter};return a}();r.ViewEvents=x;var q=function(a){function c(b,c,f,l){var n=a.call(this,!0)||this;n.view=b;for(b=0;b<c.length;b++)switch(c[b]){case "click":n.registerIncoming("click",f,function(a){return l(n.wrapClick(a))});
break;case "double-click":n.registerIncoming("double-click",f,function(a){return l(n.wrapDoubleClick(a))});break;case "hold":n.registerIncoming("hold",f,function(a){return l(n.wrapHold(a))});break;case "drag":n.registerIncoming("drag",f,function(a){return l(n.wrapDrag(a))});break;case "key-down":n.registerIncoming("key-down",f,function(a){return l(n.wrapKeyDown(a))});break;case "key-up":n.registerIncoming("key-up",f,function(a){return l(n.wrapKeyUp(a))});break;case "pointer-down":n.registerIncoming("pointer-down",
f,function(a){return l(n.wrapPointer(a,"pointer-down"))});break;case "pointer-move":n.registerIncoming("pointer-move",f,function(a){return l(n.wrapPointer(a,"pointer-move"))});break;case "pointer-up":n.registerIncoming("pointer-up",f,function(a){return l(n.wrapPointer(a,"pointer-up"))});break;case "mouse-wheel":n.registerIncoming("mouse-wheel",f,function(a){return l(n.wrapMouseWheel(a))});break;case "pointer-enter":n.registerIncoming("pointer-enter",f,function(a){return l(n.wrapPointer(a,"pointer-enter"))});
break;case "pointer-leave":n.registerIncoming("pointer-leave",f,function(a){return l(n.wrapPointer(a,"pointer-leave"))})}return n}k(c,a);c.prototype.wrapClick=function(a){var c=a.data.x,f=a.data.y;return{type:"click",button:"touch"===a.data.native.pointerType?0:a.data.native.button,x:c,y:f,native:a.data.native,timestamp:a.timestamp,screenPoint:new b(c,f),mapPoint:this.view.toMap(c,f),stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapDoubleClick=function(a){var b=a.data.x,c=
a.data.y;return{type:"double-click",button:"touch"===a.data.native.pointerType?0:a.data.native.button,x:b,y:c,native:a.data.native,timestamp:a.timestamp,mapPoint:this.view.toMap(b,c),stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapHold=function(a){var b=a.data.x,c=a.data.y;return{type:"hold",button:"touch"===a.data.native.pointerType?0:a.data.native.button,x:b,y:c,native:a.data.native,timestamp:a.timestamp,mapPoint:this.view.toMap(b,c),stopPropagation:function(){return a.stopPropagation()}}};
c.prototype.wrapDrag=function(a){return{type:"drag",action:a.data.action,x:a.data.currentState.center.x,y:a.data.currentState.center.y,origin:{x:a.data.startState.center.x,y:a.data.startState.center.y},native:a.data.pointers[0].currentEvent.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapKeyDown=function(a){return{type:"key-down",key:a.data.key,repeat:a.data.repeat,native:a.data.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};
c.prototype.wrapKeyUp=function(a){return{type:"key-up",key:a.data.key,native:a.data.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapPointer=function(a,b){return{type:b,x:a.data.x,y:a.data.y,pointerId:a.data.native.pointerId,pointerType:a.data.native.pointerType,native:a.data.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapMouseWheel=function(a){return{type:"mouse-wheel",x:a.data.x,y:a.data.y,
deltaY:a.data.deltaY,native:a.data.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};return c}(a.InputHandler)})},"esri/views/input/handlers/PreventContextMenu":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(){var b=a.call(this,!0)||this;b.registerIncoming("context-menu",function(a){a.data.native.preventDefault()});return b}
k(b,a);return b}(a.InputHandler);r.PreventContextMenu=x;r.default=x})},"esri/views/3d/input/handlers/DoubleClickZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../../input/handlers/support ../../state/helpers/PickingHelper ../../state/controllers/global/ZoomStepController ../../state/controllers/local/ZoomStepController".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(b,
f){var l=a.call(this,!0)||this;l.view=b;l.pickingHelper=new c.PickingHelper(b);l.registerIncoming("double-click",f,function(a){return l.handleDoubleClick(a)});return l}k(f,a);f.prototype.handleDoubleClick=function(a){var c=a.data;if(b.eventMatchesPointerType(c.native,"primary")){var f=this.view.state.isGlobal?new t.ZoomStepController(this.view,this.pickingHelper,"animation"):new n.ZoomStepController(this.view,this.pickingHelper,"animation");this.view.state.switchCameraController(f);f.zoomStep(Math.log(.5)/
Math.log(.6),[c.x,this.view.height-c.y]);a.stopPropagation()}};return f}(a.InputHandler);r.DoubleClickZoom=x})},"esri/views/input/handlers/support":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.eventMatchesPointerType=function(k,a){switch(a){case "primary":return"touch"===k.pointerType||0===k.button;case "secondary":return"touch"!==k.pointerType&&2===k.button;case "tertiary":return"touch"!==k.pointerType&&1===k.button}};r.eventMatchesMousePointerType=
function(k,a){if("touch"===k.pointerType)return!1;switch(a){case "primary":return 0===k.button;case "secondary":return 2===k.button;case "tertiary":return 1===k.button}}})},"esri/views/3d/state/controllers/global/ZoomStepController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../PointToPointAnimationController ../../../camera/constraintUtils ../../../lib/glMatrix ../../utils/navigationUtils ../../../webgl-engine/lib/Camera ../../../../animation/easing".split(" "),
function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function l(b,f,l){f=a.call(this,b.state,f,"interaction"===l?null:void 0)||this;f.view=b;f.mode=l;f.zoomLocation=c.vec3d.create();f.tmpCamera=new n;f.panAxis=c.vec3d.create();f.tmpViewDir=c.vec3d.create();f.targetOnSphere=c.vec3d.create();f.constraintOptions={selection:7,interactionType:1,interactionFactor:null,interactionStartCamera:new n,interactionDirection:null};f.sphere={center:c.vec3d.create(),radius:0};
return f}k(l,a);Object.defineProperty(l.prototype,"isInteractive",{get:function(){return"interaction"===this.mode},enumerable:!0,configurable:!0});l.prototype.zoomStep=function(a,b){if(this.active){var f=this.view.state,l=this.constraintOptions.interactionStartCamera;this.animation.finished?l.copyFrom(f.camera):this.animation.cameraAt(1,l);l=!1;0<a&&this.pickingHelper.pickPointInScreen(b,this.zoomLocation)&&(l=!0);this.tmpCamera.copyFrom(f.camera);l||(this.pickingHelper.pickRaySegment(this.tmpCamera.eye,
this.tmpCamera.center,this.zoomLocation)?this.tmpCamera.center=this.zoomLocation:c.vec3d.set(this.tmpCamera.center,this.zoomLocation));this.updateCamera(this.tmpCamera,Math.pow(.6,a),this.zoomLocation,b);this.begin(this.tmpCamera)}};l.prototype.animationSettings=function(){return{apex:null,duration:.6,easing:f.outExpo}};l.prototype.updateCamera=function(a,f,l,n){this.sphere.radius=c.vec3d.length(l);c.vec3d.subtract(a.center,a.eye,this.tmpViewDir);var q=c.vec3d.length(this.tmpViewDir),k=q*f;1>=f&&
4>k&&(k=4,f=k/q);1E-6>Math.abs(q-k)||(q=c.vec3d.length(a.center),this.sphere.radius!==q&&c.vec3d.scale(a.center,(this.sphere.radius+f*(q-this.sphere.radius))/q),c.vec3d.scale(this.tmpViewDir,-f),c.vec3d.add(a.center,this.tmpViewDir,a.eye),b.applyAll(this.view,a,this.constraintOptions),1E-12<c.vec3d.dist2(l,a.center)&&t.intersectSphereFromScreenPoint(this.sphere,a,n,this.targetOnSphere)&&(f=t.rotationAndAxisFromPoints(l,this.targetOnSphere,this.panAxis),t.applyRotation(a,this.sphere.center,this.panAxis,
f)),b.applySurfaceCollision(this.view,a))};return l}(a.PointToPointAnimationController);r.ZoomStepController=x})},"esri/views/3d/state/utils/navigationUtils":function(){define(["require","exports","../../lib/glMatrix","./primitiveIntersectionUtils","../../support/mathUtils"],function(x,r,k,a,b){function c(b,c,f,l,p){void 0===p&&(p=!1);var n=I;a.createRay(c,f,n,p);return a.intersectSphere(b,n,l)?!0:(q(b,n,l),!1)}function t(b,c,f,l){var p=I;a.createRay(c,f,p,!0);return a.intersectSphere(b,p,l)}function n(a,
c,f){k.vec3d.cross(a,c,f);a=k.vec3d.dot(a,c)/(k.vec3d.length(a)*k.vec3d.length(c));return-b.acos(a)}function f(a,b,c,f){var l=G;k.mat4d.identity(l);k.mat4d.rotate(l,f,c);k.vec3d.subtract(a.eye,b);k.mat4d.multiplyVec3(l,a.eye,a.eye);k.vec3d.add(a.eye,b);k.vec3d.subtract(a.center,b);k.mat4d.multiplyVec3(l,a.center,a.center);k.vec3d.add(a.center,b);k.mat4d.multiplyVec3(l,a.up,a.up);a.markViewDirty()}function q(a,c,f){var l=z,p=A,n=F;k.vec3d.subtract(c.origin,a.center,p);k.vec3d.cross(p,c.direction,l);
k.vec3d.cross(l,p,f);k.vec3d.scale(f,1/k.vec3d.length(f)*a.radius);a=-b.asin(a.radius/k.vec3d.length(c.origin));k.mat4d.identity(n);k.mat4d.rotate(n,a,l);k.mat4d.multiplyVec3(n,f)}function l(a,b){k.vec3d.set3(0,0,0,b);for(var c=0;c<a.length;c++)k.vec3d.add(b,a[c]);k.vec3d.scale(b,1/a.length)}Object.defineProperty(r,"__esModule",{value:!0});r.Earth={center:k.vec3d.create(),radius:6378137};r.normalizeCoordinate=function(a,b,c){c[0]=b[0]/a.width;c[1]=b[1]/a.height;return c};r.sphereOrSilhouettePointFromScreenPoint=
c;r.intersectSphereFromScreenPoint=t;r.rotationAndAxisFromPoints=n;r.rotationFromPointsAroundAxis=function(a,b,c){var f=z,l=A,p=J;k.vec3d.set(a,l);k.vec3d.set(b,p);a=k.vec3d.dot(l,c);b=k.vec3d.dot(p,c);k.vec3d.scale(c,a,f);k.vec3d.subtract(l,f);k.vec3d.normalize(l);k.vec3d.scale(c,b,f);k.vec3d.subtract(p,f);k.vec3d.normalize(p);a=k.vec3d.dot(l,p);k.vec3d.cross(c,l,f);c=k.vec3d.dot(p,f);return Math.atan2(c,a)};r.setPlane=function(a,b,c){k.vec3d.set(b,c.normal);c.d=-k.vec3d.dot(b,a)};r.setPlaneD=function(a,
b){b.d=-k.vec3d.dot(b.normal,a)};r.normalizeRotationDelta=function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;return a};r.applyRotation=f;r.closestPointOnSphereSilhouette=q;r.intersectPlaneFromScreenPoint=function(b,c,f,l){var p=I;a.createRay(c,f,p);return a.intersectPlane(b,p,l)};r.applyZoomToPoint=function(a,b,c,f){var l=p;c=1-c;k.vec3d.subtract(b,a.eye,l);var n=k.vec3d.length(l),q=n*(1-c);0<=c&&q<f&&(q=f,c=-(q-n)/n);1E-6>Math.abs(n-q)||(k.vec3d.scale(l,c),k.vec3d.add(a.eye,l),
k.vec3d.lerp(a.center,b,c))};r.applyZoomOnSphere=function(a,b,c){k.vec2d.set2(b.width/2,b.height/2,y);t(a,b,y,b.center);k.vec3d.subtract(b.center,b.eye,p);a=k.vec3d.length(p);1E-6>Math.abs(a-a*c)||(k.vec3d.scale(p,c),k.vec3d.subtract(b.center,p,b.eye),b.markViewDirty())};var y=k.vec2d.create();r.navPointToScreenPoint=function(a,b,c){k.vec2d.set2(b.x,a.height-b.y,c)};r.centroidOnSphere=function(a,b,c){l(b,c);k.vec3d.normalize(c);k.vec3d.scale(c,a)};r.centroid=l;var B;(function(a){a[a.Vertical=0]="Vertical";
a[a.Horizontal=1]="Horizontal"})(B=r.PanMode||(r.PanMode={}));r.VerticalPanTresholds={Elevation:3E4,Angle:8/180*Math.PI};r.pickPointAndInitSphere=function(a,b,f,l){var p=k.vec3d.create(),n={center:k.vec3d.create(),radius:0},q=!0;a.pickPointInScreen(f,p)?n.radius=k.vec3d.length(p):(n.radius=k.vec3d.length(b.center),n.radius<.9*r.Earth.radius&&(n.radius=r.Earth.radius),n.radius=Math.max(k.vec3d.length(b.center),.9*r.Earth.radius),l?c(n,b,f,p):q=t(n,b,f,p));return{sphere:n,scenePickPoint:q?p:null}};
r.decidePanMode=function(a,b,c){if(k.vec3d.length(a.eye)-r.Earth.radius<r.VerticalPanTresholds.Elevation){if(b.radius>k.vec3d.length(a.eye))return B.Vertical;k.vec3d.normalize(k.vec3d.subtract(a.eye,c,v));return Math.abs(.5*Math.PI-Math.acos(k.vec3d.dot(c,v)/k.vec3d.length(c)))<r.VerticalPanTresholds.Angle?B.Vertical:B.Horizontal}return B.Horizontal};var v=k.vec3d.create();r.applyPanPlanar=function(a,b,c,f){k.vec3d.subtract(c,b,w);k.vec3d.subtract(a.eye,w);k.vec3d.subtract(a.center,w);a.markViewDirty();
f&&f.estimator.addPanValue(f.time,f.endScreenPoint,c,w)};var w=k.vec3d.create();r.applyPanSpherical=function(a,b,c,l,p){c=n(c,l,D);f(b,a.center,D,c);p&&p.estimator.addPanValue(p.time,p.endScreenPoint,l,D)};var D=k.vec3d.create(),F=k.mat4d.create(),G=k.mat4d.create(),p=k.vec3d.create(),z=k.vec3d.create(),A=k.vec3d.create(),J=k.vec3d.create(),I={origin:k.vec3d.create(),direction:k.vec3d.create()}})},"esri/views/3d/state/utils/primitiveIntersectionUtils":function(){define(["require","exports","../../lib/glMatrix"],
function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.createRay=function(b,t,n,f){void 0===f&&(f=!1);k.vec3d.set3(t[0],t[1],0,a);f?k.vec3d.set(b.eye,n.origin):k.vec3d.unproject(a,b.viewMatrix,b.projectionMatrix,b.fullViewport,n.origin);a[2]=1;k.vec3d.unproject(a,b.viewMatrix,b.projectionMatrix,b.fullViewport,n.direction);k.vec3d.subtract(n.direction,n.origin,n.direction);k.vec3d.normalize(n.direction)};r.intersectSphere=function(a,t,n){var c=k.vec3d.subtract(t.origin,a.center,b),q=k.vec3d.dot(t.direction,
t.direction),l=2*k.vec3d.dot(t.direction,c);a=k.vec3d.dot(c,c)-a.radius*a.radius;a=l*l-4*q*a;if(0>a)return!1;c=Math.sqrt(a);a=(-l-c)/(2*q);q=(-l+c)/(2*q);if(0>a||q<a&&0<q)a=q;return 0<a?(k.vec3d.add(t.origin,k.vec3d.scale(t.direction,a,n),n),!0):!1};r.intersectPlane=function(a,b,n){var c=k.vec3d.dot(a.normal,b.direction);if(0===c)return!1;a=-(k.vec3d.dot(a.normal,b.origin)+a.d)/c;if(0>a)return!1;k.vec3d.add(b.origin,k.vec3d.scale(b.direction,a,n),n);return!0};var a=k.vec3d.create(),b=k.vec3d.create()})},
"esri/views/3d/state/controllers/local/ZoomStepController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../PointToPointAnimationController ../../../camera/constraintUtils ../../../lib/glMatrix ../../../webgl-engine/lib/Camera ../../../../animation/easing".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(b,f,n){f=a.call(this,b.state,f,"interaction"===n?null:void 0)||this;f.view=b;f.mode=n;f.zoomLocation=
c.vec3d.create();f.tmpCamera=new t;f.tmpRayDir=c.vec3d.create();f.constraintOptions={selection:15,interactionType:1,interactionFactor:null,interactionStartCamera:new t,interactionDirection:null};return f}k(f,a);Object.defineProperty(f.prototype,"isInteractive",{get:function(){return"interaction"===this.mode},enumerable:!0,configurable:!0});f.prototype.zoomStep=function(a,b){if(this.active){var f=this.view.state,l=this.constraintOptions.interactionStartCamera;this.animation.finished?l.copyFrom(f.camera):
this.animation.cameraAt(1,l);this.tmpCamera.copyFrom(f.camera);0<a?this.pickingHelper.pickPointInScreen(b,this.zoomLocation)||this.pickingHelper.pickFreePointInScreen(b,this.zoomLocation):this.pickingHelper.pickRaySegment(this.tmpCamera.eye,this.tmpCamera.center,this.zoomLocation)?this.tmpCamera.center=this.zoomLocation:c.vec3d.set(this.tmpCamera.center,this.zoomLocation);this.updateCamera(this.tmpCamera,Math.pow(.6,a),this.zoomLocation,b);this.begin(this.tmpCamera)}};f.prototype.animationSettings=
function(){return{apex:null,duration:.6,easing:n.outExpo}};f.prototype.updateCamera=function(a,f,n,q){c.vec3d.subtract(n,a.eye,this.tmpRayDir);q=c.vec3d.length(this.tmpRayDir);var l=q*f;1>=f&&4>l&&(l=4,f=l/q);1E-6>Math.abs(q-l)||(c.vec3d.scale(this.tmpRayDir,f),c.vec3d.subtract(n,this.tmpRayDir,a.eye),c.vec3d.lerp(a.center,n,1-f),b.applyAll(this.view,this.tmpCamera,this.constraintOptions))};return f}(a.PointToPointAnimationController);r.ZoomStepController=x})},"esri/views/3d/input/handlers/DragRotate":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../../input/handlers/support ../../state/controllers/RotateController ../../state/helpers/PickingHelper".split(" "),
function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(b,c,f,n){var l=a.call(this,!0)||this;l.view=b;l.pointerType=c;l.pivotPoint=f;l.pickingHelper=new t.PickingHelper(b);l.registerIncoming("drag",n,function(a){return l.handleDrag(a)});return l}k(f,a);f.prototype.handleDrag=function(a){var f=a.data;if(!(1<f.pointers.length)){var n=f.pointers[0];if(b.eventMatchesMousePointerType(n.startEvent.native,this.pointerType)){n=[n.currentEvent.x,this.view.height-n.currentEvent.y];
switch(f.action){case "start":this.cameraController=new c.RotateController(this.view,this.pickingHelper,this.pivotPoint);this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(n);break;case "update":this.cameraController.update(n);break;case "end":this.cameraController.end(),this.cameraController=null}a.stopPropagation()}}};return f}(a.InputHandler);r.DragRotate=x})},"esri/views/3d/state/controllers/RotateController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../camera/constraintUtils ./InteractiveController ../../lib/glMatrix ../../support/mathUtils ../../state/utils/navigationUtils ../../state/Constraints".split(" "),
function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,"__esModule",{value:!0});x=function(b){function l(a,f,l){var n=b.call(this)||this;n.view=a;n.pickingHelper=f;n.pivot=l;n.lastPoint=c.vec2d.create();n.tmpWorldUp=c.vec3d.create();n.tmpViewDir=c.vec3d.create();n.tmpRotCurPoint=c.vec2d.create();n.tmpTransf=c.mat4d.create();n.tmpAxis=c.vec3d.create();n.pivotPos=c.vec3d.create();n.constraintOptions={selection:15,interactionType:2,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};
n.rotScale="center"===l?3:1.5;return n}k(l,b);l.prototype.begin=function(a){if(this.active){switch(this.pivot){case "eye":c.vec3d.set(this.beginCamera.eye,this.pivotPos);this.constraintOptions.interactionType=3;this.constraintOptions.selection=0;break;case "center":this.pickingHelper.pickRaySegment(this.beginCamera.eye,this.beginCamera.center,this.pivotPos)||(this.view.state.isLocal?this.pickingHelper.pickFreePointFromSegment(this.beginCamera.eye,this.beginCamera.center,this.pivotPos):c.vec3d.set(this.beginCamera.center,
this.pivotPos)),this.beginCamera.center=this.pivotPos,this.constraintOptions.interactionType=2,this.constraintOptions.selection=11}this.constraintOptions.interactionStartCamera=this.beginCamera;n.normalizeCoordinate(this.beginCamera,a,this.lastPoint)}};l.prototype.update=function(b){if(this.active){var c;switch(this.pivot){case "eye":c=this.currentCamera.center;break;case "center":this.currentCamera.center=this.pivotPos,c=this.currentCamera.eye}this.applyRotation(this.currentCamera,b,c,this.pivotPos);
a.applyAll(this.view,this.currentCamera,this.constraintOptions)}};l.prototype.end=function(){this.active&&this.finishController()};l.prototype.applyRotation=function(a,b,l,q){this.view.renderCoordsHelper.worldUpAtPosition(q,this.tmpWorldUp);n.normalizeCoordinate(a,b,this.tmpRotCurPoint);b=(this.tmpRotCurPoint[1]-this.lastPoint[1])*this.rotScale;var k=(this.tmpRotCurPoint[0]-this.lastPoint[0])*this.rotScale;c.vec3d.subtract(l,q,this.tmpViewDir);var v=c.vec3d.length(this.tmpViewDir),v=t.acos(c.vec3d.dot(this.tmpViewDir,
this.tmpWorldUp)/v);if("eye"===this.pivot){var y=.5*Math.PI-v,p=.495*Math.PI;b=y-Math.max(-p,Math.min(p,y+-.5*b))}b=Math.max(f.TiltDefault.min,b+v)-v;c.mat4d.identity(this.tmpTransf);c.vec3d.cross(a.up,this.tmpViewDir,this.tmpAxis);"center"===this.pivot&&(k=-k);c.mat4d.rotate(this.tmpTransf,k,this.tmpWorldUp);c.mat4d.rotate(this.tmpTransf,b,this.tmpAxis);c.mat4d.multiplyVec3(this.tmpTransf,this.tmpViewDir);c.vec3d.add(q,this.tmpViewDir,l);c.mat4d.multiplyVec3(this.tmpTransf,a.up);c.vec2d.set(this.tmpRotCurPoint,
this.lastPoint);a.markViewDirty()};return l}(b.InteractiveController);r.RotateController=x})},"esri/views/3d/state/controllers/InteractiveController":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./CameraController","../../webgl-engine/lib/Camera"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.beginCamera=new b;c.currentCamera=new b;return c}k(c,a);Object.defineProperty(c.prototype,
"isInteractive",{get:function(){return!0},enumerable:!0,configurable:!0});c.prototype.stepController=function(b,c){a.prototype.stepController.call(this,b,c);c.copyViewFrom(this.currentCamera);this.currentCamera.copyFrom(c)};c.prototype.onControllerStart=function(b){a.prototype.onControllerStart.call(this,b);this.beginCamera.copyFrom(b);this.currentCamera.copyFrom(b)};c.prototype.onControllerEnd=function(b){b.copyViewFrom(this.currentCamera);a.prototype.onControllerEnd.call(this,b)};return c}(a.CameraController);
r.InteractiveController=x})},"esri/views/3d/input/handlers/DragZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../../input/handlers/support ../../state/helpers/PickingHelper ../../state/controllers/global/ZoomController ../../state/controllers/local/ZoomController".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(b,f,n){var l=a.call(this,!0)||this;l.view=b;l.pointerType=f;
l.pickingHelper=new c.PickingHelper(b);l.registerIncoming("drag",n,function(a){return l.handleDrag(a)});return l}k(f,a);f.prototype.handleDrag=function(a){var c=a.data;if(!(1<c.pointers.length)){var f=c.pointers[0];if(b.eventMatchesMousePointerType(f.startEvent.native,this.pointerType)){f=[f.currentEvent.x,this.view.height-f.currentEvent.y];switch(c.action){case "start":this.cameraController=this.view.state.isGlobal?new t.ZoomController(this.view,this.pickingHelper):new n.ZoomController(this.view,
this.pickingHelper);this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(f);break;case "update":this.cameraController.update(f);break;case "end":this.cameraController.end(),this.cameraController=null}a.stopPropagation()}}};return f}(a.InputHandler);r.DragZoom=x})},"esri/views/3d/state/controllers/global/ZoomController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../InteractiveController ../../utils/navigationUtils ../../../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(b){function f(a,c){var f=b.call(this)||this;f.view=a;f.pickingHelper=c;f.pickPoint=t.vec3d.create();f.tmpP0=t.vec3d.create();f.panAxis=t.vec3d.create();f.tmpRayDir=t.vec3d.create();f.targetOnSphere=t.vec3d.create();f.dragBeginPoint=t.vec2d.create();f.normalizedAnchorPoint=t.vec2d.create();f.constraintOptions={selection:7,interactionType:1,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};f.sphere=
{center:t.vec3d.create(),radius:0};f.hasPickPoint=!1;return f}k(f,b);f.prototype.begin=function(a){this.active&&(t.vec2d.set(a,this.dragBeginPoint),c.normalizeCoordinate(this.beginCamera,a,this.normalizedAnchorPoint),a=c.pickPointAndInitSphere(this.pickingHelper,this.beginCamera,a,!1),this.hasPickPoint=!!a.scenePickPoint,this.pickPoint=a.scenePickPoint,this.sphere=a.sphere,this.constraintOptions.interactionStartCamera=this.beginCamera)};f.prototype.update=function(b){if(this.active){this.currentCamera.eye=
this.beginCamera.eye;this.currentCamera.center=this.beginCamera.center;this.currentCamera.up=this.beginCamera.up;t.vec3d.subtract(this.currentCamera.center,this.currentCamera.eye,this.tmpRayDir);var f=t.vec3d.length(this.tmpRayDir);c.normalizeCoordinate(this.currentCamera,b,this.tmpP0);var n=12*(this.tmpP0[1]-this.normalizedAnchorPoint[1]),q=f*Math.pow(2,n),k=this.view.state.constraints.minimumPoiDistance;0>n&&q<k&&(q=k);1E-6>Math.abs(f-q)||(this.hasPickPoint&&q<f&&(n=1-(1-q/f)*(1-this.sphere.radius/
t.vec3d.length(this.currentCamera.center)),t.vec3d.scale(this.currentCamera.center,n)),t.vec3d.scale(this.tmpRayDir,-q/f),t.vec3d.add(this.currentCamera.center,this.tmpRayDir,this.currentCamera.eye),this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.dragBeginPoint,b),a.applyAll(this.view,this.currentCamera,this.constraintOptions),this.hasPickPoint&&(c.sphereOrSilhouettePointFromScreenPoint(this.sphere,this.currentCamera,this.dragBeginPoint,this.targetOnSphere,!0),b=c.rotationAndAxisFromPoints(this.pickPoint,
this.targetOnSphere,this.panAxis),c.applyRotation(this.currentCamera,this.sphere.center,this.panAxis,b)),a.applySurfaceCollision(this.view,this.currentCamera))}};f.prototype.end=function(){this.active&&this.finishController()};return f}(b.InteractiveController);r.ZoomController=x})},"esri/views/3d/state/controllers/local/ZoomController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../InteractiveController ../../../lib/glMatrix ../../../support/mathUtils ../../utils/navigationUtils".split(" "),
function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(b){function f(a,f){var l=b.call(this)||this;l.view=a;l.pickingHelper=f;l.tmpP=c.vec3d.create();l.tmpN=c.vec3d.create();l.tmpP0=c.vec3d.create();l.tmpPoi=c.vec3d.create();l.tmpRayDir=c.vec3d.create();l.dragBeginPoint=c.vec2d.create();l.normalizedAnchorPoint=c.vec2d.create();l.constraintOptions={selection:15,interactionType:1,interactionFactor:0,interactionStartCamera:null,interactionDirection:c.vec3d.create()};l.plane=
{normal:c.vec3d.create(),d:0};return l}k(f,b);f.prototype.begin=function(a){this.active&&(c.vec2d.set(a,this.dragBeginPoint),n.normalizeCoordinate(this.beginCamera,a,this.normalizedAnchorPoint),this.pickingHelper.pickPointInScreen(a,this.tmpP)||this.pickingHelper.pickFreePointInScreen(a,this.tmpP),c.vec3d.normalize(c.vec3d.subtract(this.beginCamera.eye,this.beginCamera.center,this.tmpN)),0>this.tmpN[1]&&c.vec3d.negate(this.tmpN),n.setPlane(this.tmpP,this.tmpN,this.plane),this.constraintOptions.interactionStartCamera=
this.beginCamera)};f.prototype.update=function(b){if(this.active){n.intersectPlaneFromScreenPoint(this.plane,this.currentCamera,this.dragBeginPoint,this.tmpPoi)||c.vec3d.set(this.currentCamera.center,this.tmpPoi);n.normalizeCoordinate(this.currentCamera,b,this.tmpP0);var f=4*(this.normalizedAnchorPoint[1]-this.tmpP0[1]);c.vec2d.set(this.tmpP0,this.normalizedAnchorPoint);c.vec3d.subtract(this.tmpPoi,this.currentCamera.eye,this.tmpRayDir);var l=c.vec3d.length(this.tmpRayDir),q=l*(1-f);c.vec3d.set(this.tmpRayDir,
this.constraintOptions.interactionDirection);c.vec3d.scale(this.constraintOptions.interactionDirection,t.sign(f)/l);var k=this.view.state.constraints.minimumPoiDistance;0<=f&&q<k&&(q=k,f=-(q-l)/l);1E-6>Math.abs(l-q)||(c.vec3d.scale(this.tmpRayDir,f),c.vec3d.add(this.currentCamera.eye,this.tmpRayDir),c.vec3d.lerp(this.currentCamera.center,this.tmpPoi,f),this.currentCamera.center[2]=this.tmpPoi[2]>this.beginCamera.center[2]?Math.max(this.beginCamera.center[2],this.currentCamera.center[2]):Math.min(this.beginCamera.center[2],
this.currentCamera.center[2]),this.currentCamera.markViewDirty(),this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.dragBeginPoint,b),a.applyAll(this.view,this.currentCamera,this.constraintOptions))}};f.prototype.end=function(){this.active&&this.finishController()};return f}(b.InteractiveController);r.ZoomController=x})},"esri/views/3d/input/handlers/KeyPan":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../input/InputHandler",
"../../state/controllers/global/PanContinuousController"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function c(c,f,q){var l=a.call(this,!0)||this;l.view=c;l.keyToDirection=(n={},n[f.left]=b.Direction.LEFT,n[f.right]=b.Direction.RIGHT,n[f.forward]=b.Direction.FORWARD,n[f.backward]=b.Direction.BACKWARD,n[f.up]=b.Direction.UP,n[f.down]=b.Direction.DOWN,n);c.state.isGlobal&&(l.registerIncoming("key-down",q,function(a){return l.handleKeyDown(a)}),l.registerIncoming("key-up",
q,function(a){return l.handleKeyUp(a)}));return l;var n}k(c,a);c.prototype.handleKeyDown=function(a){if(!a.data.repeat){var c=this.keyToDirection[a.data.key];null!=c&&(this.cameraController&&this.cameraController.active||(this.cameraController=new b.PanContinuousController(this.view),this.view.state.switchCameraController(this.cameraController)),this.cameraController.active&&this.handleKey(a,c,!0))}};c.prototype.handleKeyUp=function(a){var b=this.keyToDirection[a.data.key];null!=b&&this.cameraController&&
this.cameraController.active&&this.handleKey(a,b,!1)};c.prototype.handleKey=function(a,b,c){c?this.cameraController.addDirection(b):this.cameraController.removeDirection(b);a.stopPropagation()};return c}(a.InputHandler);r.KeyPan=x})},"esri/views/3d/state/controllers/global/PanContinuousController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../CameraController ../../../support/earthUtils ../../../support/mathUtils ../../../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});r.Direction={LEFT:1,RIGHT:2,FORWARD:4,BACKWARD:8,UP:16,DOWN:32};var f=n.vec3d,q=n.mat4d;x=function(b){function l(a){var c=b.call(this)||this;c.view=a;c.directionStatus=0;c.direction=f.create();c.tmpAxis=f.create();c.radiusChange=0;c.velocity=0;c.tmpP1=f.create();c.tmpTransf=q.create();return c}k(l,b);Object.defineProperty(l.prototype,"isInteractive",{get:function(){return!0},enumerable:!0,configurable:!0});l.prototype.addDirection=
function(a){0===this.directionStatus&&f.set3(0,0,0,this.direction);this.directionStatus&a||(this.directionStatus|=a,a&(r.Direction.LEFT|r.Direction.RIGHT|r.Direction.FORWARD|r.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),f.add(this.direction,this.tmpAxis)):(a=this.directionStatus&(r.Direction.UP|r.Direction.DOWN),this.radiusChange=a===r.Direction.UP?1:a===r.Direction.DOWN?-1:0),this.velocity=this.computePanVelocity())};l.prototype.removeDirection=function(a){this.directionStatus&=~a;0===
this.directionStatus&&this.active?this.finishController():a&(r.Direction.LEFT|r.Direction.RIGHT|r.Direction.FORWARD|r.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),f.subtract(this.direction,this.tmpAxis),.01>f.length(this.direction)&&f.set3(0,0,0,this.direction)):(a=this.directionStatus&(r.Direction.UP|r.Direction.DOWN),this.radiusChange=a===r.Direction.UP?1:a===r.Direction.DOWN?-1:0)};l.prototype.stepController=function(c,l){b.prototype.stepController.call(this,c,l);c*=this.velocity;var n=
!1;if(0<Math.abs(this.radiusChange)){var n=1+c*this.radiusChange,k=l.viewForward,t=f.normalize(l.center,this.tmpP1);(-.999<f.dot(k,t)||0>this.radiusChange)&&f.scale(l.center,n);f.scale(l.eye,n);this.velocity=this.computePanVelocity();n=!0}.01<f.length2(this.direction)&&(q.identity(this.tmpTransf),q.rotate(this.tmpTransf,c,this.direction),q.multiplyVec3(this.tmpTransf,l.eye),q.multiplyVec3(this.tmpTransf,l.center),q.multiplyVec3(this.tmpTransf,l.up),n=!0);n&&a.applyAll(this.view,l,{selection:14,interactionType:4,
interactionStartCamera:this.view.state.camera,interactionFactor:null,interactionDirection:null})};l.prototype.computePanAxis=function(a,b){var c=this.view.state.camera;f.subtract(c.center,c.eye,b);f.cross(b,c.up);if(a===r.Direction.LEFT||a===r.Direction.RIGHT)f.normalize(b),f.cross(b,c.center);a!==r.Direction.RIGHT&&a!==r.Direction.FORWARD||f.negate(b);f.normalize(b)};l.prototype.computePanVelocity=function(){var a=.5*Math.abs(f.length(this.view.state.camera.eye)-c.earthRadius),a=t.clamp(a,1,2*c.earthRadius);
return t.acos(1-a*a/(2*c.earthRadius*c.earthRadius))};return l}(b.CameraController);r.PanContinuousController=x})},"esri/views/3d/input/handlers/MouseWheelZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../state/helpers/PickingHelper ../../state/controllers/global/ZoomStepController ../../state/controllers/local/ZoomStepController".split(" "),function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(c,
f){var l=a.call(this,!0)||this;l.view=c;l.pickingHelper=new b.PickingHelper(c);l.registerIncoming("mouse-wheel",f,function(a){return l.handleMouseWheel(a)});return l}k(f,a);f.prototype.handleMouseWheel=function(a){var b=a.data;this.cameraController&&this.cameraController.active||(this.cameraController=this.view.state.isGlobal?new c.ZoomStepController(this.view,this.pickingHelper,"interaction"):new t.ZoomStepController(this.view,this.pickingHelper,"interaction"),this.view.state.switchCameraController(this.cameraController));
this.cameraController.zoomStep(-1/60*b.deltaY,[b.x,this.view.height-b.y]);a.stopPropagation()};return f}(a.InputHandler);r.MouseWheelZoom=x})},"esri/views/3d/input/handlers/SingleKeyResetHeading":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./SingleKey"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c,f){f=a.call(this,"esri.views.3d.input.handlers.SingleKeyResetHeading",c,f)||this;f.view=b;f.key=c;return f}k(b,a);
b.prototype.activate=function(){this.view.goTo({heading:0})};return b}(a.SingleKey);r.SingleKeyResetHeading=x})},"esri/views/3d/input/handlers/SingleKey":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../input/InputHandler"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c,f){var n=a.call(this,!0)||this;n.key=c;n.registerIncoming("key-down",f,function(a){return n._handleKeyDown(a)});return n}k(b,a);b.prototype._handleKeyDown=
function(a){a.data.key===this.key&&(this.activate(),a.stopPropagation())};return b}(a.InputHandler);r.SingleKey=x})},"esri/views/3d/input/handlers/SingleKeyResetTilt":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./SingleKey"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c,f){f=a.call(this,"esri.views.3d.input.handlers.SingleKeyResetTilt",c,f)||this;f.view=b;f.key=c;return f}k(b,a);b.prototype.activate=function(){this.view.goTo({tilt:0})};
return b}(a.SingleKey);r.SingleKeyResetTilt=x})},"esri/views/3d/input/handlers/PointerDownCancelAnimation":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../input/InputHandler"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function b(b,c){var f=a.call(this,!0)||this;f.view=b;f.registerIncoming("pointer-down",c,function(a){return f.view.state.stopActiveCameraController()});return f}k(b,a);return b}(a.InputHandler);r.PointerDownCancelAnimation=
x})},"esri/views/3d/input/handlers/TwoFingerTilt":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../state/helpers/PickingHelper ../../state/controllers/RotateController".split(" "),function(x,r,k,a,b,c){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function n(c,n){void 0===n&&(n=!1);var f=a.call(this,!0)||this;f.view=c;f.invert=n;f.pickingHelper=new b.PickingHelper(c);f.registerIncoming("vertical-two-finger-drag",function(a){return f.handleTwoFinger(a)});
return f}k(n,a);n.prototype.handleTwoFinger=function(a){var b=[0,-a.data.delta*(this.invert?-1:1)];switch(a.data.action){case "begin":this.cameraController=new c.RotateController(this.view,this.pickingHelper,"center");this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(b);break;case "update":this.cameraController.update(b);break;case "end":this.cameraController.end(),this.cameraController=null}};return n}(a.InputHandler);r.TwoFingerTilt=x})},"esri/views/3d/input/handlers/PinchAndPanNavigation":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../input/InputHandler ../../../input/handlers/support ../../state/helpers/PickingHelper ../../state/controllers/global/PinchAndPanController ../../state/controllers/local/PinchAndPanController".split(" "),
function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function f(b,f,n){var l=a.call(this,!0)||this;l.view=b;l.pointerType=f;l.lastEndTimestamp=0;l.pickingHelper=new c.PickingHelper(b);l.registerIncoming("drag",n,function(a){return l.handleDrag(a)});return l}k(f,a);f.prototype.handleDrag=function(a){var c=a.data.pointers[0].startEvent.native;if("mouse"!==c.pointerType||b.eventMatchesMousePointerType(c,this.pointerType)){c=a.timestamp-this.lastEndTimestamp;c=this.momentum&&
this.momentum.active&&40>c;switch(a.data.action){case "start":case "update":if(c)break;this.controller&&this.controller.active?.002>(a.data.currentState.timestamp-a.data.previousState.timestamp)/1E3||this.controller.update(a.data.pointers,a.data.currentState,a.timestamp):(this.controller=this.view.state.isGlobal?new t.PinchAndPanController(this.view,this.pickingHelper):new n.PinchAndPanController(this.view,this.pickingHelper),this.view.state.switchCameraController(this.controller),this.controller.begin(a.data.pointers,
a.data.currentState,a.timestamp));break;case "end":this.controller&&this.controller.active&&(this.lastEndTimestamp=a.timestamp,(this.momentum=this.controller.end())&&this.view.state.switchCameraController(this.momentum),this.controller=null)}a.stopPropagation()}};return f}(a.InputHandler);r.PinchAndPanNavigation=x})},"esri/views/3d/state/controllers/global/PinchAndPanController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ../../../input/util ../../../webgl-engine/lib/Camera ../InteractiveController ./MomentumController ../../utils/navigationUtils ../../utils/navigationUtils ../../../camera/constraintUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){Object.defineProperty(r,"__esModule",{value:!0});x=function(t){function y(f,l){var k=t.call(this)||this;k.view=f;k.pickingHelper=l;k.smoothRotation=new b.ExponentialFalloff(.05);k.rotationAxis=a.vec3d.create();k.panningCenterScene=a.vec3d.create();k.panningPlane={normal:a.vec3d.create(),d:0};k.smoothScaling=new b.ExponentialFalloff(.05);k.zoomCenterScreen=a.vec2d.create();k.beginScenePoints={points:[],center:a.vec3d.create()};k.adjustedSphere={center:a.vec3d.create(),
radius:0};k.panMode=q.PanMode.Horizontal;k.tmp2d=a.vec2d.create();k.tmp3d=a.vec3d.create();k.tmpInteractionDirection=a.vec3d.create();k.beginScreenPoint=a.vec2d.create();k.screenPickPoint=a.vec2d.create();k.currentPoints=[];k.currentCenter=a.vec3d.create();k.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new c,interactionDirection:null};k.momentumController=new n.MomentumController(f);return k}k(y,t);y.prototype.begin=function(b,c,l){if(this.active){this.beginRadius=
c.radius;f.navPointToScreenPoint(this.currentCamera,c.center,this.screenPickPoint);a.vec2d.set(this.screenPickPoint,this.beginScreenPoint);l=f.pickPointAndInitSphere(this.pickingHelper,this.beginCamera,this.screenPickPoint,!0);this.scenePickPoint=l.scenePickPoint;this.sphere=l.sphere;this.panMode=f.decidePanMode(this.beginCamera,this.sphere,this.scenePickPoint);if(this.panMode===q.PanMode.Horizontal)this.computeSpherePoints(b,"startEvent",this.sphere,this.beginCamera,this.beginScenePoints.points),
f.centroidOnSphere(this.sphere.radius,this.beginScenePoints.points,this.beginScenePoints.center);else{a.vec3d.set(this.beginCamera.viewForward,this.panningPlane.normal);a.vec3d.normalize(this.panningPlane.normal);a.vec3d.negate(this.panningPlane.normal);f.setPlane(this.scenePickPoint,this.panningPlane.normal,this.panningPlane);b=a.vec3d.create();a.vec3d.set3(this.screenPickPoint[0],this.currentCamera.height,0,b);l=a.vec3d.create();var n=a.vec3d.length(this.beginCamera.eye);this.adjustedSphere.radius=
n<this.sphere.radius?n-100:this.sphere.radius;f.sphereOrSilhouettePointFromScreenPoint(this.adjustedSphere,this.beginCamera,b,l);this.beginCamera.projectPoint(l,b);this.screenPickPoint[1]=Math.min(this.screenPickPoint[1],.9*b[1]);this.pickingHelper.pickPointInScreen(this.screenPickPoint,this.scenePickPoint)&&f.setPlane(this.scenePickPoint,this.panningPlane.normal,this.panningPlane);f.navPointToScreenPoint(this.currentCamera,c.center,this.tmp2d);f.intersectPlaneFromScreenPoint(this.panningPlane,this.beginCamera,
this.tmp2d,this.panningCenterScene)}this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera)}};y.prototype.update=function(a,b,c){if(this.active){this.currentCamera.copyFrom(this.beginCamera);var f=1<a.length;this.panMode===q.PanMode.Horizontal?(f&&this.zoomSpherical(b,c),this.panningSpherical(a,b,c),f&&this.rotateSpherical(a,b,c)):(f&&this.zoomPlanar(a,b,c),this.panningPlanar(a,b,c),f&&this.rotatePlanar(a,b,c));this.currentCamera.markViewDirty()}};y.prototype.end=function(){this.panMode===
q.PanMode.Horizontal?this.momentumController.setParameters(this.sphere.radius,this.panMode,this.zoomCenterScreen,this.beginScenePoints.center):this.momentumController.setParameters(this.sphere.radius,this.panMode,this.zoomCenterScreen,this.panningCenterScene);this.finishController();return this.momentumController.initiate()?this.momentumController:null};y.prototype.computeSpherePoints=function(b,c,l,n,q){q.length=b.length;for(var p=this.tmp2d,k=0;k<q.length;k++)f.navPointToScreenPoint(n,b[k][c],p),
void 0===q[k]&&(q[k]=a.vec3d.create()),f.sphereOrSilhouettePointFromScreenPoint(l,n,p,q[k]);return q};y.prototype.zoomSpherical=function(b,c){var n=this.currentCamera.height,q=this.beginRadius/b.radius;this.smoothScaling.gain=.001875*Math.min(Math.max(b.radius,40),120);this.smoothScaling.update(q);f.applyZoomOnSphere(this.sphere,this.currentCamera,this.smoothScaling.value);a.vec2d.set2(b.center.x,n-b.center.y,this.zoomCenterScreen);this.momentumController.addScaleValue(c,this.smoothScaling.value);
this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(b.radius-this.beginRadius);l.applyAll(this.view,this.currentCamera,this.constraintOptions)};y.prototype.panningSpherical=function(a,b,c){this.currentPoints;this.computeSpherePoints(a,"currentEvent",this.sphere,this.currentCamera,this.currentPoints);f.centroidOnSphere(this.sphere.radius,this.currentPoints,this.currentCenter);f.navPointToScreenPoint(this.currentCamera,b.center,this.tmp2d);
f.applyPanSpherical(this.sphere,this.currentCamera,this.beginScenePoints.center,this.currentCenter,{estimator:this.momentumController,time:c,endScreenPoint:this.tmp2d});this.constraintOptions.interactionType=4;this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(this.screenPickPoint,this.tmp2d);l.applyAll(this.view,this.currentCamera,this.constraintOptions)};y.prototype.rotateSpherical=function(b,c,n){var q=b.length;a.vec3d.normalize(this.beginScenePoints.center,this.rotationAxis);
this.computeSpherePoints(b,"currentEvent",this.sphere,this.currentCamera,this.currentPoints);for(var k=b=0;k<q;k++)b+=f.rotationFromPointsAroundAxis(this.currentPoints[k],this.beginScenePoints.points[k],this.rotationAxis);k=this.smoothRotation.value;q=f.normalizeRotationDelta(b/q-k);b=k+q;this.smoothRotation.gain=.00125*Math.min(Math.max(c.radius,40),120);this.smoothRotation.update(b);q=this.smoothRotation.value;this.momentumController.addRotationValue(n,q);f.applyRotation(this.currentCamera,this.sphere.center,
this.rotationAxis,q);this.constraintOptions.interactionType=2;this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(c.radius*b);l.applyAll(this.view,this.currentCamera,this.constraintOptions)};y.prototype.panningPlanar=function(a,b,c){f.navPointToScreenPoint(this.currentCamera,b.center,this.tmp2d);f.intersectPlaneFromScreenPoint(this.panningPlane,this.currentCamera,this.tmp2d,this.tmp3d)&&(f.applyPanPlanar(this.currentCamera,this.panningCenterScene,this.tmp3d,{estimator:this.momentumController,
time:c,endScreenPoint:this.tmp2d}),this.constraintOptions.interactionType=4,this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(this.beginScreenPoint,this.tmp2d),this.constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this.tmpInteractionDirection),l.applyAll(this.view,this.currentCamera,this.constraintOptions),this.constraintOptions.interactionDirection=null)};y.prototype.zoomPlanar=function(a,b,c){a=this.beginRadius/
b.radius;this.smoothScaling.gain=.001875*Math.min(Math.max(b.radius,40),120);this.smoothScaling.update(a);this.momentumController.addScaleValue(c,this.smoothScaling.value);this.momentumController.setParametersVertical(this.panningCenterScene);f.applyZoomToPoint(this.currentCamera,this.panningCenterScene,this.smoothScaling.value,this.view.state.constraints.minimumPoiDistance);this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(b.radius-
this.beginRadius);l.applyAll(this.view,this.currentCamera,this.constraintOptions)};y.prototype.rotatePlanar=function(b,c,n){a.vec3d.set(this.panningCenterScene,this.rotationAxis);var q=c.angle;b=this.smoothRotation.value;q=f.normalizeRotationDelta(q-b);this.smoothRotation.gain=.00125*Math.min(Math.max(c.radius,40),120);this.smoothRotation.update(b+q);b=this.smoothRotation.value;this.momentumController.addRotationValue(n,b);f.applyRotation(this.currentCamera,this.sphere.center,this.rotationAxis,b);
this.constraintOptions.interactionType=2;this.constraintOptions.interactionFactor=l.pixelDistanceToInteractionFactor(c.radius*b);l.applyAll(this.view,this.currentCamera,this.constraintOptions)};return y}(t.InteractiveController);r.PinchAndPanController=x})},"esri/views/3d/input/util":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(a){this._gain=a}k.prototype.reset=function(a){this._value=a};Object.defineProperty(k.prototype,
"gain",{set:function(a){this._gain=a},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"value",{get:function(){return void 0===this._value?0:this._value},enumerable:!0,configurable:!0});k.prototype.update=function(a){this._value=void 0===this._value?a:this._gain*a+(1-this._gain)*this._value};return k}();r.ExponentialFalloff=x})},"esri/views/3d/state/controllers/global/MomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../AnimationController ../../../webgl-engine/lib/Camera ../../../lib/glMatrix ../../utils/navigationUtils ../../../../navigation/Momentum ../../utils/navigationUtils ../../../camera/constraintUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){Object.defineProperty(r,"__esModule",{value:!0});var l=c.vec3d.create();x=function(a){function y(f){var l=a.call(this)||this;l.view=f;l.zoom={momentum:null,estimator:new n.ZoomMomentumEstimator(.05),enabled:!0};l.rotation={momentum:null,estimator:new n.RotationMomentumEstimator(.05,3,.05,.95),enabled:!0};l.pan={momentum:null,estimator:new n.ScreenspaceMomentumEstimator(.05,500,12,.82),enabled:!0};l.elapsedTimeSec=0;l._panAxisOrDirection=c.vec3d.create();l._centerOnScreen=
c.vec2d.create();l._centerOnSphere=c.vec3d.create();l._tmpSphereCenter=c.vec3d.create();l._tmpScaleAxis=c.vec3d.create();l.sphere={center:c.vec3d.create(),radius:0};l.tmpInteractionDirection=c.vec3d.create();l._verticalCenter=c.vec3d.create();l.beginCamera=new b;l.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new b,interactionDirection:null};return l}k(y,a);y.prototype.setParameters=function(a,b,f,l){this.sphere.radius=a;f&&l?(c.vec2d.set(f,this._centerOnScreen),
c.vec3d.set(l,this._centerOnSphere)):(this.zoom.enabled=!1,this.rotation.enabled=!1);this._mode=b};y.prototype.setParametersVertical=function(a){c.vec3d.set(a,this._verticalCenter)};y.prototype.addPanValue=function(a,b,f,l){this.pan.estimator.add(b[0],b[1],f,.001*a);c.vec3d.set(l,this._panAxisOrDirection)};y.prototype.addRotationValue=function(a,b){this.rotation.estimator.add(b,.001*a)};y.prototype.addScaleValue=function(a,b){this.zoom.estimator.add(b,.001*a)};y.prototype.initiate=function(){this.zoom.enabled&&
(this.zoom.momentum=this.zoom.estimator.evaluateMomentum());!this.zoom.momentum&&this.rotation.enabled&&(this.rotation.momentum=this.rotation.estimator.evaluateMomentum());this.zoom.momentum||this.rotation.momentum||!this.pan.enabled||(this.pan.momentum=this.pan.estimator.evaluateMomentum());return null!=(this.zoom.momentum||this.rotation.momentum||this.pan.momentum)};y.prototype.onControllerStart=function(b){this.beginCamera.copyFrom(b);this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera);
a.prototype.onControllerStart.call(this,b)};Object.defineProperty(y.prototype,"steppingFinished",{get:function(){return this.momentumFinished()},enumerable:!0,configurable:!0});y.prototype.stepController=function(a,b){b.copyViewFrom(this.beginCamera);this.elapsedTimeSec+=a;var n=this._centerOnScreen;a=this._centerOnSphere;if(this.zoom.momentum){var k=this.zoom.momentum.valueDelta(0,this.elapsedTimeSec);this._mode===f.PanMode.Horizontal?(t.applyZoomOnSphere(this.sphere,b,k),this.constraintOptions.selection=
15,this.constraintOptions.interactionType=1,this.constraintOptions.interactionDirection=null,q.applyAll(this.view,b,this.constraintOptions),t.sphereOrSilhouettePointFromScreenPoint(this.sphere,b,n,this._tmpSphereCenter),n=t.rotationAndAxisFromPoints(a,this._tmpSphereCenter,this._tmpScaleAxis),t.applyRotation(b,this.sphere.center,this._tmpScaleAxis,n),this.constraintOptions.interactionType=4):(c.vec3d.set(b.eye,this.tmpInteractionDirection),t.applyZoomToPoint(b,this._verticalCenter,k,this.view.state.constraints.minimumPoiDistance),
this.constraintOptions.interactionType=1,this.constraintOptions.interactionDirection=c.vec3d.direction(this.tmpInteractionDirection,b.eye));q.applyAll(this.view,b,this.constraintOptions)}this.pan.momentum&&(this._mode===f.PanMode.Horizontal?(n=t.rotationAndAxisFromPoints(this.pan.momentum.dataOldest,this.pan.momentum.dataNewest,this._panAxisOrDirection)/this.pan.momentum.dataTimeDelta,n=this.pan.momentum.valueFromInitialVelocity(n,this.elapsedTimeSec),t.applyRotation(b,this.sphere.center,this._panAxisOrDirection,
n)):(n=c.vec3d.dist(this.pan.momentum.dataOldest,this.pan.momentum.dataNewest),n/=this.pan.momentum.dataTimeDelta,n=this.pan.momentum.valueFromInitialVelocity(n,this.elapsedTimeSec),c.vec3d.normalize(this._panAxisOrDirection),c.vec3d.scale(this._panAxisOrDirection,n),c.vec3d.subtract(b.eye,this._panAxisOrDirection),c.vec3d.subtract(b.center,this._panAxisOrDirection),b.markViewDirty(),this.constraintOptions.interactionDirection=this._panAxisOrDirection),this.constraintOptions.interactionType=4,q.applyAll(this.view,
b,this.constraintOptions),this.constraintOptions.interactionDirection=null);this.rotation.momentum&&(n=this.rotation.momentum.valueDelta(0,this.elapsedTimeSec),t.applyRotation(b,l,a,n),this.constraintOptions.interactionType=2,this.constraintOptions.interactionDirection=null,q.applyAll(this.view,b,this.constraintOptions))};y.prototype.momentumFinished=function(){this.zoom.momentum&&this.zoom.momentum.isFinished(this.elapsedTimeSec)&&(this.zoom.momentum=null);this.rotation.momentum&&this.rotation.momentum.isFinished(this.elapsedTimeSec)&&
(this.rotation.momentum=null);this.pan.momentum&&this.pan.momentum.isFinished(this.elapsedTimeSec)&&(this.pan.momentum=null);return!this.zoom.momentum&&!this.rotation.momentum&&!this.pan.momentum};return y}(a.AnimationController);r.MomentumController=x})},"esri/views/navigation/Momentum":function(){define(["require","exports","../../core/tsSupport/extendsHelper","./ValueHistory","../3d/lib/glMatrix"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});var c=function(){function a(a,
b,c){this._initialVelocity=a;this._stopVelocity=b;this._friction=c;this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}Object.defineProperty(a.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0});a.prototype.isFinished=function(a){return a>this.duration};Object.defineProperty(a.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});a.prototype.value=function(a){a=
Math.min(a,this.duration);var b=1-this._friction;return this._initialVelocity*(Math.pow(b,a)-1)/Math.log(b)};a.prototype.valueDelta=function(a,b){var c=this.value(a);return this.value(a+b)-c};return a}();r.Momentum=c;x=function(){function b(b,c,f,n){void 0===b&&(b=.05);this._minimumInitialVelocity=c;this._stopVelocity=f;this._friction=n;this._history=new a.ValueHistory(1E3*b)}b.prototype.add=function(a,b){void 0!==b&&(b*=1E3);this._history.add(a,b)};b.prototype.reset=function(){this._history.reset()};
Object.defineProperty(b.prototype,"stopVelocity",{get:function(){return this._stopVelocity},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});b.prototype.evaluateMomentum=function(){var a=this._evaluateVelocity();return null!==a?new c(a,this._stopVelocity,this._friction):null};b.prototype._evaluateVelocity=function(){var a=this._history,b=a.oldest,a=a.newest;if(b&&a){var c=(a.timeStamp-b.timeStamp)/1E3;
if(0<c&&(b=(a.value-b.value)/c,Math.abs(b)>=this._minimumInitialVelocity))return b}return null};return b}();r.MomentumEstimator=x;var t=function(a){function b(b,c,f){return a.call(this,b,c,f)||this}k(b,a);b.prototype.value=function(b){b=a.prototype.value.call(this,b);return Math.exp(b)};b.prototype.valueDelta=function(b,c){var f=a.prototype.value.call(this,b);b=a.prototype.value.call(this,b+c);return Math.exp(b-f)};return b}(c);r.ZoomMomentum=t;var n=function(a){function b(b,c,f,l){void 0===b&&(b=
.05);void 0===c&&(c=4);void 0===f&&(f=.01);void 0===l&&(l=.95);return a.call(this,b,c,f,l)||this}k(b,a);b.prototype.add=function(b,c){a.prototype.add.call(this,Math.log(b),c)};b.prototype.evaluateMomentum=function(){var a=this._evaluateVelocity();return null!==a?new t(a,this.stopVelocity,this.friction):null};return b}(x);r.ZoomMomentumEstimator=n;x=function(a){function b(b,c,f,l){void 0===b&&(b=.05);void 0===c&&(c=4);void 0===f&&(f=.01);void 0===l&&(l=.95);return a.call(this,b,c,f,l)||this}k(b,a);
b.prototype.add=function(b,c){var f=this._history.newest;if(f){f=f.value;for(b-=f;b>Math.PI;)b-=2*Math.PI;for(;b<-Math.PI;)b+=2*Math.PI;b=f+b}a.prototype.add.call(this,b,c)};return b}(x);r.RotationMomentumEstimator=x;var f=function(a){function b(b,c,f,l,n,k){b=a.call(this,b,c,f)||this;b.dataOldest=l;b.dataNewest=n;b.dataTimeDelta=k;return b}k(b,a);b.prototype.velocityFactor=function(a){a=Math.min(a,this.duration);return Math.pow(1-this.friction,a)};b.prototype.valueFromInitialVelocity=function(a,
b){b=Math.min(b,this.duration);var c=1-this.friction;return a*(Math.pow(c,b)-1)/Math.log(c)};return b}(c);r.ScreenspaceMomentum=f;x=function(){function c(b,c,f,n){void 0===b&&(b=.05);this._minimumInitialVelocity=c;this._stopVelocity=f;this._friction=n;this._entryPool=[];this._history=new a.ValueHistory(1E3*b)}c.prototype.add=function(a,c,f,n){void 0!==n&&(n*=1E3);var l;0!==this._entryPool.length?(l=this._entryPool.pop(),l.x=a,l.y=c,b.vec3d.set(f,l.data)):l={x:a,y:c,data:b.vec3d.create(f)};this._history.add(l,
n)};c.prototype.reset=function(){for(var a=0,b=this._history.values;a<b.length;a++)this._entryPool.push(b[a].value);this._history.reset()};Object.defineProperty(c.prototype,"stopVelocity",{get:function(){return this._stopVelocity},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});c.prototype.evaluateMomentum=function(){var a=this._evaluateVelocity(),b=this._history.oldest,c=this._history.newest;return null!==
a?new f(a,this._stopVelocity,this._friction,b.value.data,c.value.data,.001*(c.timeStamp-b.timeStamp)):null};c.prototype._evaluateVelocity=function(){var a=this._history,b=a.oldest,c=a.newest;if(b&&c&&(a=.001*(c.timeStamp-b.timeStamp),0<a)){var f=c.value.x-b.value.x,b=c.value.y-b.value.y,b=Math.sqrt(f*f+b*b)/a;if(Math.abs(b)>=this._minimumInitialVelocity)return b}return null};return c}();r.ScreenspaceMomentumEstimator=x})},"esri/views/navigation/ValueHistory":function(){define(["require","exports",
"../../core/now"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function a(a){this._maximumAge=a;this._values=[]}Object.defineProperty(a.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0});a.prototype.reset=function(){this._values=[]};a.prototype.add=function(a,c){c=void 0!==c?c:k();this._values.push({value:a,timeStamp:c});this._cleanup(c)};Object.defineProperty(a.prototype,"newest",{get:function(){var a=this._values.length;if(0<
a)return this._values[a-1]},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"oldest",{get:function(){if(0<this._values.length)return this._values[0]},enumerable:!0,configurable:!0});a.prototype._cleanup=function(a){for(;0<this._values.length;)if(this._values[0].timeStamp+this._maximumAge<a)this._values.shift();else break};return a}();r.ValueHistory=x})},"esri/views/3d/state/controllers/local/PinchAndPanController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ../../../input/util ../../../webgl-engine/lib/Camera ../InteractiveController ./MomentumController ../../utils/navigationUtils ../../../camera/constraintUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){Object.defineProperty(r,"__esModule",{value:!0});var l;(function(a){a[a.Vertical=0]="Vertical";a[a.Horizontal=1]="Horizontal"})(l=r.PanMode||(r.PanMode={}));var y=a.vec3d.createFrom(0,0,1),B=16/180*Math.PI;x=function(t){function v(f,l){var k=t.call(this)||this;k.view=f;k.pickingHelper=l;k.rotationValueSmooth=new b.ExponentialFalloff(.05);k.scalingValueSmooth=new b.ExponentialFalloff(.05);k.planeHorizontal={normal:a.vec3d.create(),d:0};k.planeVertical={normal:a.vec3d.create(),
d:0};k.beginCenterHorizontal=a.vec3d.create();k.beginCenterVertical=a.vec3d.create();k.tmpPoints=[];k.beginCenterScreen=a.vec2d.create();k.tmpCentroid3d=a.vec3d.create();k.tmpCentroid2d=a.vec2d.create();k.tmp2d=a.vec2d.create();k.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new c,interactionDirection:null};k.momentumController=new n.MomentumController(f);return k}k(v,t);v.prototype.begin=function(b,c,n){if(this.active){this.beginRadius=c.radius;this.rotationValueSmooth.reset();
this.scalingValueSmooth.reset();f.navPointToScreenPoint(this.beginCamera,c.center,this.beginCenterScreen);this.planeHorizontal.d=0;a.vec3d.set(y,this.planeHorizontal.normal);c=a.vec3d.create();this.pickingHelper.pickPointInScreen(this.beginCenterScreen,c)||this.pickingHelper.pickFreePointInScreen(this.beginCenterScreen,c);n=a.vec3d.create();a.vec3d.negate(this.beginCamera.viewForward,n);var p=a.vec3d.create();a.vec3d.set(y,p);var k=a.vec3d.dot(n,p);this.panMode=Math.asin(0>k?-k:k)>=B?l.Horizontal:
l.Vertical;f.setPlaneD(c,this.planeHorizontal);0>a.vec3d.dot(this.planeHorizontal.normal,this.beginCamera.eye)+this.planeHorizontal.d&&(a.vec3d.negate(this.planeHorizontal.normal),this.planeHorizontal.d*=-1);this.panMode===l.Vertical&&(a.vec3d.scale(p,k),a.vec3d.subtract(n,p,this.planeVertical.normal),a.vec3d.normalize(this.planeVertical.normal),f.setPlaneD(c,this.planeVertical),this.computePlanePoints(b,"currentEvent",this.planeVertical,this.beginCamera,this.tmpPoints),f.centroid(this.tmpPoints,
this.beginCenterVertical));this.computePlanePoints(b,"currentEvent",this.planeHorizontal,this.beginCamera,this.tmpPoints);f.centroid(this.tmpPoints,this.beginCenterHorizontal);this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera)}};v.prototype.update=function(b,c,n){if(this.active){this.currentCamera.copyFrom(this.beginCamera);var p=1<b.length,k=this.panMode===l.Horizontal?this.planeHorizontal:this.planeVertical,t=this.panMode===l.Horizontal?this.beginCenterHorizontal:this.beginCenterVertical;
if(p){var v=this.beginRadius/c.radius,y=.001875*Math.min(Math.max(c.radius,40),120);this.scalingValueSmooth.gain=y;this.scalingValueSmooth.update(v);f.applyZoomToPoint(this.currentCamera,t,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance);this.momentumController.addScaleValue(n,this.scalingValueSmooth.value,t);this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=q.pixelDistanceToInteractionFactor(Math.abs(c.radius-this.beginRadius));q.applyAll(this.view,
this.currentCamera,this.constraintOptions)}this.computePlanePoints(b,"currentEvent",k,this.currentCamera,this.tmpPoints);f.centroid(this.tmpPoints,this.tmpCentroid3d);f.navPointToScreenPoint(this.currentCamera,c.center,this.tmpCentroid2d);f.applyPanPlanar(this.currentCamera,t,this.tmpCentroid3d,{estimator:this.momentumController,time:n,endScreenPoint:this.tmpCentroid2d});this.constraintOptions.interactionType=4;this.constraintOptions.interactionFactor=q.pixelDistanceToInteractionFactor(this.beginCenterScreen,
this.tmpCentroid2d);q.applyAll(this.view,this.currentCamera,this.constraintOptions);p&&(b=this.planeHorizontal.normal,a.vec3d.set(this.planeHorizontal.normal,b),y=c.angle,p=this.rotationValueSmooth.value,k=f.normalizeRotationDelta(y-p),y=.00125*Math.min(Math.max(c.radius,40),120),this.rotationValueSmooth.gain=y,this.rotationValueSmooth.update(p+k),y=this.rotationValueSmooth.value,this.momentumController.addRotationValue(n,t,b,y),f.applyRotation(this.currentCamera,t,b,y),this.constraintOptions.interactionType=
2,this.constraintOptions.interactionFactor=q.pixelDistanceToInteractionFactor(Math.abs(c.radius*y)),q.applyAll(this.view,this.currentCamera,this.constraintOptions));this.currentCamera.markViewDirty()}};v.prototype.end=function(){this.finishController();return this.momentumController.initiate()?this.momentumController:null};v.prototype.computePlanePoints=function(b,c,l,p,n){n.length=b.length;for(var k=this.tmp2d,q=0;q<n.length;q++){var t=b[q];k[0]=t[c].x;k[1]=this.view.height-t[c].y;void 0===n[q]&&
(n[q]=a.vec3d.create());f.intersectPlaneFromScreenPoint(l,p,k,n[q])}return n};return v}(t.InteractiveController);r.PinchAndPanController=x})},"esri/views/3d/state/controllers/local/MomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../AnimationController ../../../webgl-engine/lib/Camera ../../../lib/glMatrix ../../utils/navigationUtils ../../../../navigation/Momentum ../../../camera/constraintUtils".split(" "),function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,
"__esModule",{value:!0});x=function(a){function l(f){var l=a.call(this)||this;l.view=f;l.zoom={momentum:null,estimator:new n.ZoomMomentumEstimator(.05),enabled:!0};l.rotation={momentum:null,estimator:new n.RotationMomentumEstimator(.05,3,.05,.95),enabled:!0};l.pan={momentum:null,estimator:new n.ScreenspaceMomentumEstimator(.05,500,12,.82),enabled:!0};l._scaleState={center:c.vec3d.create()};l._rotationState={center:c.vec3d.create(),axis:c.vec3d.create()};l._panState={direction:c.vec3d.create()};l.elapsedTimeSec=
0;l.zoomDirection=c.vec3d.create();l.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new b,interactionDirection:null};return l}k(l,a);l.prototype.addPanValue=function(a,b,f,l){this.pan.estimator.add(b[0],b[1],f,.001*a);c.vec3d.set(l,this._panState.direction);c.vec3d.normalize(this._panState.direction)};l.prototype.addRotationValue=function(a,b,f,l){this.rotation.estimator.add(l,.001*a);c.vec3d.set(b,this._rotationState.center);c.vec3d.set(f,this._rotationState.axis)};
l.prototype.addScaleValue=function(a,b,f){this.zoom.estimator.add(b,.001*a);c.vec3d.set(f,this._scaleState.center)};l.prototype.initiate=function(){this.zoom.enabled&&(this.zoom.momentum=this.zoom.estimator.evaluateMomentum());!this.zoom.momentum&&this.rotation.enabled&&(this.rotation.momentum=this.rotation.estimator.evaluateMomentum());this.zoom.momentum||this.rotation.momentum||!this.pan.enabled||(this.pan.momentum=this.pan.estimator.evaluateMomentum());return null!=(this.zoom.momentum||this.rotation.momentum||
this.pan.momentum)};Object.defineProperty(l.prototype,"steppingFinished",{get:function(){this.zoom.momentum&&this.zoom.momentum.isFinished(this.elapsedTimeSec)&&(this.zoom.momentum=null);this.rotation.momentum&&this.rotation.momentum.isFinished(this.elapsedTimeSec)&&(this.rotation.momentum=null);this.pan.momentum&&this.pan.momentum.isFinished(this.elapsedTimeSec)&&(this.pan.momentum=null);return!this.zoom.momentum&&!this.rotation.momentum&&!this.pan.momentum},enumerable:!0,configurable:!0});l.prototype.onControllerStart=
function(b){this.constraintOptions.interactionStartCamera.copyFrom(b);this.constraintOptions.interactionDirection=null;a.prototype.onControllerStart.call(this,b)};l.prototype.stepController=function(b,l){a.prototype.stepController.call(this,b,l);if(this.zoom.momentum){c.vec3d.normalize(c.vec3d.subtract(this._scaleState.center,l.eye,this.zoomDirection));this.constraintOptions.interactionDirection=this.zoomDirection;this.constraintOptions.interactionType=1;var n=this.zoom.momentum.valueDelta(this.elapsedTimeSec,
b);t.applyZoomToPoint(l,this._scaleState.center,n,this.view.state.constraints.minimumPoiDistance);f.applyAll(this.view,l,this.constraintOptions)}this.pan.momentum&&(c.vec3d.normalize(this._panState.direction),n=c.vec3d.dist(this.pan.momentum.dataOldest,this.pan.momentum.dataNewest),n/=this.pan.momentum.dataTimeDelta,n*=this.pan.momentum.velocityFactor(this.elapsedTimeSec),c.vec3d.scale(this._panState.direction,n*b),c.vec3d.subtract(l.eye,this._panState.direction),c.vec3d.subtract(l.center,this._panState.direction),
l.markViewDirty(),this.constraintOptions.interactionType=4,f.applyAll(this.view,l,this.constraintOptions));this.rotation.momentum&&(n=this.rotation.momentum.valueDelta(this.elapsedTimeSec,b),t.applyRotation(l,this._rotationState.center,this._rotationState.axis,n),this.constraintOptions.interactionType=2,f.applyAll(this.view,l,this.constraintOptions));this.elapsedTimeSec+=b};return l}(a.AnimationController);r.MomentumController=x})},"esri/views/3d/webgl-engine/Stage":function(){define("require exports ./parts/Model ./parts/View ./lib/Selector ./lib/Camera ./lib/gl-matrix ./lib/Util ./lib/ModelContentType ./lighting/Lightsources".split(" "),
function(x,r,k,a,b,c,t,n,f,q){x=t.vec2d;r=t.vec2;var l=t.vec3d;t=function(){function t(c,f,n){this._intersectTolerance=b.DEFAULT_TOLERANCE;this._viewContent=[];this._externalIntersectionHandlers=[];this.container=f;this.viewingMode=c;this.model=new k;this.view=new a(f,this,this.model.getDirtySet(),n);this._validateHUDSelector=new b(this.viewingMode);this._validateHUDSelector.enableHUDSelection=!1;this.view.setLighting({lights:[new q.MainLight(l.createFrom(.7,.7,.7)),new q.AmbientLight(l.createFrom(.3,
.3,.3))],groundLightingFactor:.5,globalFactor:.5})}t.prototype.setNeedsRender=function(){this.view.setNeedsRender()};t.prototype.dispose=function(){this.view.dispose();this.model=this.view=null};t.prototype.frame=function(a,b){void 0===b&&(b=0);var f=Math.max(1E-6,a.getBSRadius());b=Math.max(2,b+2);b*=f;var f=this.getCamera(),p=l.create(f.viewForward);l.scale(p,-(1.5*b/Math.tan(f.fov)));l.set(a.getCenter(),f.center);l.add(f.center,p,f.eye);f=new c(f.eye,f.center,f.up);this.setCamera(f)};t.prototype.beginMod=
function(){t.DebugSettings.fineGrainedContentValidation&&this.model.validateContent()};t.prototype.endMod=function(a){void 0===a&&(a=!1);t.DebugSettings.fineGrainedContentValidation&&!a&&this.model.validateContent()};t.prototype.add=function(a,b){this.model.add(a,b);"function"===typeof b.addParentStage&&b.addParentStage(this)};t.prototype.remove=function(a,b){a=this.model.remove(a,b);"function"===typeof a.removeParentStage&&a.removeParentStage(this);return a};t.prototype.notifyDirty=function(a,b,
c,f){this.model.notifyDirty(a,b,c,f)};t.prototype.processDirty=function(){var a=this.model.getDirtySet(),b=a.getDirtyMaterials();if(a.hasDirtyGeometryRecords()||b){t.DebugSettings.endFrameContentValidation&&this.model.validateContent();t.DebugSettings.logDirtySet&&console.log("Dirty set: "+this.model.getDirtySet().formatDebugInfo(!1));var c=a.getAddRemoveUpdateListFilteredByLayers(this._viewContent,!0);(0<c[0].length+c[1].length+c[2].length||b)&&this.view.modify(c[0],c[1],c[2],b);t.DebugSettings.logDirtySet&&
(console.log("RGs add: "+c[0].map(function(a){return a.uniqueName})),console.log("RGs remove: "+c[1].map(function(a){return a.uniqueName})));a.getAddRemoveUpdateList(!0);a.clearDirtyMaterials();this.view.setNeedsRender()}};t.prototype.processDirtyLayer=function(a){var b=this.model.getDirtySet(),c=b.getDirtyMaterials();a=b.getAddRemoveUpdateListFilteredByLayers([a],!0);(0<a[0].length+a[1].length+a[2].length||c)&&this.view.modify(a[0],a[1],a[2],c);b.clearDirtyMaterials();this.view.setNeedsRender()};
t.prototype.get=function(a,b){return this.model.get(a,b)};t.prototype.getAll=function(a){return this.model.getAll(a)};t.prototype.addTextureListener=function(a){this.view.addTextureListener(a)};t.prototype.removeTextureListener=function(a){this.view.removeTextureListener(a)};t.prototype.getContainer=function(){return this.container};t.prototype.getCamera=function(){return this.view.getCamera()};t.prototype.setCamera=function(a){this.view.setCamera(a)};t.prototype.getViewParams=function(a){return this.view.getViewParams(a)};
t.prototype.setViewParams=function(a){this.view.setViewParams(a)};t.prototype.getLayers=function(){return this.model.getAll(f.LAYER)};t.prototype.setLighting=function(a){this.view.setLighting(a)};t.prototype.getCanvas=function(){return this.view.getCanvas()};t.prototype.setRenderParams=function(a){this.view.setRenderParams(a)};t.prototype.getRenderParams=function(){return this.view.getRenderParams()};t.prototype.has=function(a){return this.view.has(a)};t.prototype.getViewContent=function(){return this._viewContent.slice(0)};
t.prototype.setViewContent=function(a){var b=n.array2object(this._viewContent),c=n.array2object(a),f=n.subtractObjects(c,b),b=n.subtractObjects(b,c);this.processDirty();c=this.model.getDirtySet();f=c.getResidentRenderGeometriesFilteredByLayers(n.object2array(f));b=c.getResidentRenderGeometriesFilteredByLayers(n.object2array(b));this.view.modify(f,b,[]);this._viewContent=a.slice(0)};t.prototype.addToViewContent=function(a){for(var b=[],c=0;c<a.length;c++)-1===this._viewContent.indexOf(a[c])&&b.push(a[c]);
0<a.length&&(this.processDirty(),a=this.model.getDirtySet().getResidentRenderGeometriesFilteredByLayers(b),this.view.modify(a,[],[]),this._viewContent.push.apply(this._viewContent,b))};t.prototype.removeFromViewContent=function(a){this.processDirty();for(var b=this.model.getDirtySet(),c=this._viewContent,f=[],l=0;l<a.length;l++){var n=c.indexOf(a[l]);-1<n&&(c[n]=c[c.length-1],c.pop(),f.push(a[l]))}a=b.getResidentRenderGeometriesFilteredByLayers(f);this.view.modify([],a,[])};t.prototype.getViewFrustumObjects=
function(){return this.view.getFrustumObjects()};t.prototype.getLocalOrigin=function(a,b,c){return this.model.getOrigin(a,b,c)};t.prototype.getFrameTask=function(){return this.view.getFrameTask()};t.prototype.requestScreenCapture=function(a,b){this.view.requestScreenCapture(a,b)};t.prototype.getAllTexturesLoaded=function(){return this.view.getAllTexturesLoaded()};t.prototype.getTextureLoaded=function(a){return this.view.getTextureLoaded(a)};t.prototype.addExternalRenderer=function(a,b){"function"===
typeof b.intersect&&this._externalIntersectionHandlers.push(b);return this.view.addExternalRenderer(a,b)};t.prototype.removeExternalRenderer=function(a){var b=this._externalIntersectionHandlers.indexOf(a);-1<b&&this._externalIntersectionHandlers.splice(b,1);return this.view.removeExternalRenderer(a)};t.prototype.getContentDebugStrings=function(a){return this.model.formatDebugInfo(a)};t.prototype.getRenderStats=function(){return this.view.getCombinedStats()};t.prototype.getRenderStatString=function(a){var b=
this.getRenderStats(),c="";if(a){var c=c+"\x3ctable\x3e",f;for(f in b)c+="\x3ctr\x3e\x3ctd\x3e"+f+'\x3c/td\x3e\x3ctd style\x3d"text-align: right"\x3e'+Math.round(b[f])+"\x3c/td\x3e\x3c/tr\x3e";c+="\x3c/table\x3e"}else for(f in b)c+=f+": "+b[f]+"\n";return c};t.prototype.pick=function(a,b,c,f){var p=l.create(),n=l.create();this.view.getPickRay(a,p,n);return this.pickRay(p,n,a,a,b,c,f)};t.prototype.pickRayWithBeginPoint=function(a,b,c,f,l){this.view.pickRayWithBeginPoint(a,b,c,f,l)};t.prototype.pickRay=
function(a,c,f,p,n,q,t){p=this.view.getCamera();f||(f=y,p.projectPoint(c,f));var w;if(n){w=Array(n.length);for(var r=0;r<w.length;r++)w[r]=this.model.get(k.ContentType.LAYER,n[r])}else{w=[];n=this.getViewContent();for(var z=this.model.getAll(k.ContentType.LAYER),r=0;r<n.length;r++){var A=z[n[r]];A&&"VISIBLE"===A.getState()&&w.push(A)}}t?t.init(w,a,c,f,p,this._intersectTolerance,q):t=new b(this.viewingMode,w,a,c,f,p,this._intersectTolerance,q);for(r=0;r<this._externalIntersectionHandlers.length;r++)this._externalIntersectionHandlers[r].intersect(t,
a,c,f);if(t.getHudResults().length){r=t.getHudResults();r.sort(function(a,b){return b.dist-a.dist});c=r[r.length-1];n=B;p.projectPoint(c.center,n);n[0]=Math.round(n[0]);n[1]=Math.round(n[1]);z=v;this.view.getPickRay(n,a,z);f=l.dist(c.center,a)/l.dist(a,z)*.99;this._validateHUDSelector.init(w,a,z,n,p,this._intersectTolerance,q);for(r=0;r<this._externalIntersectionHandlers.length;r++)this._externalIntersectionHandlers[r].intersect(this._validateHUDSelector,a,z,n);a=this._validateHUDSelector.getMinResult();
(null==a.dist||f<=a.dist)&&t.getMinResult().copyFrom(c)}return t};t.prototype.getIntersectTolerance=function(){return this._intersectTolerance};t.prototype.setIntersectTolerance=function(a){void 0===a&&(a=1E-5);this._intersectTolerance=a};t.prototype.getTextureGraphicsRenderer=function(){return this.view.getTextureGraphicsRenderer()};t.DebugSettings={fineGrainedContentValidation:!1,endFrameContentValidation:!1,logDirtySet:!1};t.ModelContentType=f;return t}();var y=x.create(),B=r.create(),v=l.create();
return t})},"esri/views/3d/webgl-engine/parts/View":function(){define("require exports ../../../../core/sniff ../../../../core/Logger ../lib/GLTextureRep ../lib/GLMaterialRep ../lib/ShaderSnippets ../lib/GLSLShaderRep ../lib/TextureRenderer ../lib/gl-matrix ../lib/webgl-utils ./Model ./Viewport ../materials/repository ../lib/SSAOHelperObscurance ../lib/HighlightHelper ../lib/RenderOccludedHelper ../lib/OffscreenRenderingHelper ../lib/tracer ../../../webgl/RenderingContext ../lib/ProgramRepository ../lighting/Lightsources ../../../support/screenshotUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I){var K=q.vec3d,L=q.vec4d,O=a.getLogger("esri.views.3d.webgl-engine.parts.View");return function(){function a(a,l,p,n){var k=this;this._backgroundColor=L.createFrom(1,1,1,1);this._lightDirection=K.createFrom(0,1,0);this._didRender=!1;this._idleSuspend=this._needsRender=!0;this._shouldRender=!1;this._screenCaptureQueue=[];this._container=a;this._stage=l;this._initializeContext(n);this._initializeShaders(n);this._textureRep=new b(l.getAll(y.ContentType.TEXTURE),
this._programRepository,function(){return k._viewport.getCamera().viewport},this._rctx);this._materialRep=new c(this._textureRep,this._programRepository);this._viewport=new B(this._programRepository,this._materialRep,this._textureRep,this._rctx);this._initializeViewportCamera();this._textureRenderer=new f(this._rctx,this._canvas,this._programRepository,this._materialRep,this._textureRep,p);this._initializeFrameTask()}a.prototype._initializeFrameTask=function(){var a=this;this._frameTask={preRender:function(){p.begin();
a._stage.processDirty();a.needsRender()?(a._shouldRender=!0,a._viewport.getCamera().setGLViewport(a._rctx),a._rctx.setClearColor.apply(a._rctx,a._backgroundColor),a._rctx.clear(16640)):a._shouldRender=!1},render:function(){a._shouldRender&&(a._didRender=!0,a._viewport.render(a._lightDirection,null))},postRender:function(){p.end()},update:function(){a._performScreenCaptures();a.resetNeedsRender()}}};a.prototype._initializeViewportCamera=function(){var a=this._container.getBoundingClientRect(),b=this._viewport.getCamera();
b.viewport[2]=a.width;b.viewport[3]=a.height;this._viewport.setCamera(b)};a.prototype._initializeContext=function(a){this._canvas=a.canvas;this._canvas||(this._canvas=document.createElement("canvas"));this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");var b=l.setupWebGL(this._canvas,{alpha:a.alpha||!1,antialias:!1,depth:!0,stencil:null==a.stencil?!0:a.stencil});this._gl=p.instrumentContext(b[0]);this._rctx=new z(b[0],{disabledExtensions:a.deactivatedWebGLExtensions});!a.alpha&&
this._rctx.contextAttributes.alpha&&O.error("WebGL context has alpha channel even though no alpha channel was requested");11<=k("safari")&&(this._container.style.backgroundColor="black");this._container.appendChild(this._canvas)};a.prototype._initializeShaders=function(a){this._shaderSnippets=new t({fsprecisionf:"\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\nprecision highp sampler2D;\n#else\nprecision mediump float;\nprecision mediump sampler2D;\n#endif\n",vsprecisionf:"\nprecision highp float;\nprecision highp sampler2D;\n",
viewingMode:"global"===a.viewingMode?"#define VIEWING_MODE_GLOBAL 1 \n":" #define VIEWING_MODE_LOCAL 1 \n"});this._shaderRep=new n;this._programRepository=new A;v.initializeShaders(this._shaderSnippets,this._shaderRep,this._programRepository,this._rctx);D.loadShaders(this._shaderSnippets,this._shaderRep,this._programRepository,this._rctx);F.loadShaders(this._shaderSnippets,this._shaderRep,this._programRepository,this._rctx);w.loadShaders(this._shaderSnippets,this._shaderRep,this._programRepository,
this._rctx);G.loadShaders(this._shaderSnippets,this._shaderRep,this._programRepository,this._rctx)};a.prototype.dispose=function(){this._viewport.dispose();this._viewport=null;this._textureRenderer.dispose();this._textureRenderer=null;this._programRepository.dispose();this._programRepository=null;this._container.contains(this._canvas)&&this._container.removeChild(this._canvas);this._gl=this._canvas=this._container=null};a.prototype.getCombinedStats=function(){return this._viewport.getCombinedStats()};
a.prototype.setNeedsRender=function(){this._didRender=!1;this._needsRender=!0};a.prototype.resetNeedsRender=function(){this._didRender&&(this._didRender=this._needsRender=!1);this._viewport.resetNeedsRender();this._textureRep.resetNeedsRender()};a.prototype.needsRender=function(){return this._needsRender||!this._idleSuspend||this._viewport.needsRender()||this._textureRep.needsRender()};a.prototype.getFrameTask=function(){return this._frameTask};a.prototype.setLighting=function(a){K.set3(0,0,0,this._lightDirection);
for(var b=0,c=a.lights;b<c.length;b++){var f=c[b];if(f instanceof J.MainLight){K.negate(f.direction,this._lightDirection);break}}this._viewport.setLighting(a);this._needsRender=!0};a.prototype.getMainLightDirection=function(){return this._lightDirection};a.prototype.getViewParams=function(a){var b=this._viewport.getViewParams(a);if(!a||a.backgroundColor)b.backgroundColor=this._backgroundColor;return b};a.prototype.setViewParams=function(a){this._needsRender=!0;a.backgroundColor&&(this._backgroundColor=
a.backgroundColor);this._viewport.setViewParams(a)};a.prototype.setRenderParams=function(a){this._needsRender=!0;void 0!==a.idleSuspend&&(this._idleSuspend=!!a.idleSuspend);this._viewport.setRenderParams(a)};a.prototype.getRenderParams=function(){var a=this._viewport.getRenderParams();a.anisotropicFiltering=this._textureRep.getMaxAnisotropy();a.idleSuspend=this._idleSuspend;return a};Object.defineProperty(a.prototype,"renderingContext",{get:function(){return this._rctx},enumerable:!0,configurable:!0});
a.prototype.has=function(a){return"s3tc"===a?!!this._rctx.extensions.compressedTextureS3TC:"standardDerivatives"===a?!!this._rctx.extensions.standardDerivatives:"shaderTextureLOD"===a?!!this._rctx.extensions.shaderTextureLOD:"angleInstancedArrays"===a?!!this._rctx.extensions.angleInstancedArrays:!1};a.prototype.getFrustumObjects=function(){return this._viewport.getFrustumObjects()};a.prototype.modify=function(a,b,c,f){this._viewport.modify(a,b,c,f)};a.prototype.setCamera=function(a){this._viewport.setCamera(a)};
a.prototype.getCamera=function(){return this._viewport.getCamera()};a.prototype.getPickRay=function(a,b,c){this._viewport.getPickRay(a,b,c)};a.prototype.pickRayWithBeginPoint=function(a,b,c,f,l){this._viewport.pickRayWithBeginPoint(a,b,c,f,l)};a.prototype.getCanvas=function(){return this._canvas};a.prototype.getTextureGraphicsRenderer=function(){return this._textureRenderer};a.prototype.requestScreenCapture=function(a,b){this._screenCaptureQueue.push({settings:a||{},callback:b});this._needsRender=
!0};a.prototype.getAllTexturesLoaded=function(){return 0===this._textureRep.getLoadingCount()};a.prototype.getTextureLoaded=function(a){return this._textureRep.getIsLoaded(a)};a.prototype.addTextureListener=function(a){this._textureRep.addTextureListener(a)};a.prototype.removeTextureListener=function(a){this._textureRep.removeTextureListener(a)};a.prototype.addExternalRenderer=function(a,b){return this._viewport.addExternalRenderer(a,b)?(b.initializeRenderContext({rctx:this._rctx,gl:this._rctx.gl,
shaderSnippets:this._shaderSnippets,shaderRep:this._shaderRep,programRep:this._programRepository,textureRep:this._textureRep}),!0):!1};a.prototype.removeExternalRenderer=function(a){return this._viewport.removeExternalRenderer(a)?(a.uninitializeRenderContext({rctx:this._rctx,gl:this._rctx.gl}),!0):!1};a.prototype._performScreenCaptures=function(){if(0!==this._screenCaptureQueue.length){for(var a=0;a<this._screenCaptureQueue.length;a++){var b=this._screenCaptureQueue[a],c=0,f=0,l=this._canvas.width,
p=this._canvas.height,h=this._canvas.width,n=this._canvas.height,k=b.settings.area;k&&(c=k.x,f=k.y,l=k.width,p=k.height);void 0!==b.settings.width&&void 0!==b.settings.height?(k=b.settings.width/b.settings.height,p*k<l?(k*=p,c+=Math.floor((l-k)/2),l=Math.floor(k)):(k=l/k,f+=Math.floor((p-k)/2),p=Math.floor(k)),h=b.settings.width,n=b.settings.height):(h=l,n=p);var e=this._canvas,k=null;if(0!==c||0!==f||l!==this._canvas.width||p!==this._canvas.height||h!==this._canvas.width||n!==this._canvas.height){this._resizeCanvas||
(this._resizeCanvas=document.createElement("canvas"));this._resizeCanvas.width=h;this._resizeCanvas.height=n;var d=this._resizeCanvas.getContext("2d"),k=new Uint8Array(l*p*4);this._gl.readPixels(c,this._canvas.height-(f+p),l,p,6408,5121,k);c=d.getImageData(0,0,h,n);I.resampleHermite(k,l,p,c.data,h,n,!0);d.putImageData(c,0,0);e=this._resizeCanvas;d=null}l={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"}[b.settings.format?b.settings.format.toLowerCase():"png"];p=1;void 0!==b.settings.quality&&(p=
b.settings.quality/100);l={dataURL:e.toDataURL(l,p),x:0,y:0,width:h,height:n};b.settings.returnByteBuffer&&(l.data=k);b.callback(l)}this._screenCaptureQueue=[]}};return a}()})},"esri/views/3d/webgl-engine/lib/GLMaterialRep":function(){define(["require","exports","./Util"],function(x,r,k){var a=function(){function a(a){this.refCnt=0;this.glMaterial=a}a.prototype.incRefCnt=function(){++this.refCnt};a.prototype.decRefCnt=function(){--this.refCnt;k.assert(0<=this.refCnt)};a.prototype.getRefCnt=function(){return this.refCnt};
a.prototype.getGLMaterial=function(){return this.glMaterial};return a}();return function(){function b(a,b){this.textureRep=a;this.programRep=b;this.id2glMaterialRef={}}b.prototype.aquire=function(a){return this.aquireExt(a,"color")};b.prototype.aquireDepthShadowMap=function(a){return this.aquireExt(a,"depthShadowMap")};b.prototype.aquireDepth=function(a){return this.aquireExt(a,"depth")};b.prototype.aquireNormal=function(a){return this.aquireExt(a,"normal")};b.prototype.aquireHighlight=function(a){return this.aquireExt(a,
"highlight")};b.prototype.aquireExt=function(b,k){var c;c=b.getId()+"_"+k;var f=this.id2glMaterialRef[c];null==f?(b=(f=b.getGLMaterials()[k])?new f(b,this.programRep,this.textureRep):void 0,f=new a(b),this.id2glMaterialRef[c]=f):b=f.getGLMaterial();f.incRefCnt();b&&this.increaseProgramReferences(b);return b};b.prototype.release=function(a){this.releaseExt(a,"color")};b.prototype.releaseDepth=function(a){this.releaseExt(a,"depth")};b.prototype.releaseNormal=function(a){this.releaseExt(a,"normal")};
b.prototype.releaseDepthShadowMap=function(a){this.releaseExt(a,"depthShadowMap")};b.prototype.releaseHighlight=function(a){this.releaseExt(a,"highlight")};b.prototype.releaseExt=function(a,b){a=a+"_"+b;b=this.id2glMaterialRef[a];b.decRefCnt();if(0===b.getRefCnt()){if(b=b.getGLMaterial())this.decreaseProgramReferences(b),void 0!==b.dispose&&b.dispose();delete this.id2glMaterialRef[a]}};b.prototype.updateMaterialParameters=function(a){var b=this.id2glMaterialRef[a+"_color"];b&&b.getGLMaterial()&&this.updateParamsForMat(b.getGLMaterial());
(b=this.id2glMaterialRef[a+"_depth"])&&b.getGLMaterial()&&this.updateParamsForMat(b.getGLMaterial());(b=this.id2glMaterialRef[a+"_depthShadowMap"])&&b.getGLMaterial()&&this.updateParamsForMat(b.getGLMaterial());(b=this.id2glMaterialRef[a+"_normal"])&&b.getGLMaterial()&&this.updateParamsForMat(b.getGLMaterial());(a=this.id2glMaterialRef[a+"_highlight"])&&a.getGLMaterial()&&this.updateParamsForMat(a.getGLMaterial())};b.prototype.updateParamsForMat=function(a){a.updateParameters&&a.updateParameters()};
b.prototype.increaseProgramReferences=function(a){if(a.getAllPrograms){a=a.getAllPrograms();for(var b=0;b<a.length;b++)this.programRep.increaseRefCount(a[b])}else this.programRep.increaseRefCount(a.getProgram())};b.prototype.decreaseProgramReferences=function(a){if(a.getAllPrograms){a=a.getAllPrograms();for(var b=0;b<a.length;b++)this.programRep.decreaseRefCount(a[b])}else this.programRep.decreaseRefCount(a.getProgram())};return b}()})},"esri/views/3d/webgl-engine/lib/ShaderSnippets":function(){define(["require",
"exports","./Util","dojox/xml/parser"],function(x,r,k,a){return function(){function b(a){var b=k.VertexAttrConstants,c;for(c in b)this[b[c]]=k.VertexAttrConstants[c];if(a)for(var f in a)this[f]=a[f]}b.prototype._parse=function(b){b=a.parse(b).getElementsByTagName("snippet");for(var c=/\$[a-zA-Z0-9]+[ \t]*/,n=/[\$\s]+/g,f=0;f<b.length;f++){var q=b[f].getAttribute("name");k.assert(null==this[q]);for(var l=b[f].textContent;;){var y=l.match(c);if(null==y)break;var r=this[y[0].replace(n,"")];k.assert(void 0!==
r);l=l.replace(y[0],r)}this[q]=l}};return b}()})},"dojox/xml/parser":function(){define(["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/window","dojo/_base/sniff"],function(x){x.getObject("xml.parser",!0,dojox);dojox.xml.parser.parse=function(r,k){var a=x.doc,b;k=k||"text/xml";if(r&&x.trim(r)&&"DOMParser"in x.global){b=(new DOMParser).parseFromString(r,k);r=b.documentElement;if("parsererror"==r.nodeName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"==r.namespaceURI){if(a=
r.getElementsByTagNameNS("http://www.mozilla.org/newlayout/xml/parsererror.xml","sourcetext")[0])a=a.firstChild.data;throw Error("Error parsing text "+r.firstChild.data+" \n"+a);}return b}if("ActiveXObject"in x.global){a=function(a){return"MSXML"+a+".DOMDocument"};a=["Microsoft.XMLDOM",a(6),a(4),a(3),a(2)];x.some(a,function(a){try{b=new ActiveXObject(a)}catch(n){return!1}return!0});if(r&&b&&(b.async=!1,b.loadXML(r),r=b.parseError,0!==r.errorCode))throw Error("Line: "+r.line+"\nCol: "+r.linepos+"\nReason: "+
r.reason+"\nError Code: "+r.errorCode+"\nSource: "+r.srcText);if(b)return b}else if(a.implementation&&a.implementation.createDocument){if(r&&x.trim(r)&&a.createElement){k=a.createElement("xml");k.innerHTML=r;var c=a.implementation.createDocument("foo","",null);x.forEach(k.childNodes,function(a){c.importNode(a,!0)});return c}return a.implementation.createDocument("","",null)}return null};dojox.xml.parser.textContent=function(r,k){if(1<arguments.length)return dojox.xml.parser.replaceChildren(r,(r.ownerDocument||
x.doc).createTextNode(k)),k;if(void 0!==r.textContent)return r.textContent;var a="";r&&x.forEach(r.childNodes,function(b){switch(b.nodeType){case 1:case 5:a+=dojox.xml.parser.textContent(b);break;case 3:case 2:case 4:a+=b.nodeValue}});return a};dojox.xml.parser.replaceChildren=function(r,k){var a=[];x.isIE&&x.forEach(r.childNodes,function(b){a.push(b)});dojox.xml.parser.removeChildren(r);x.forEach(a,x.destroy);x.isArray(k)?x.forEach(k,function(a){r.appendChild(a)}):r.appendChild(k)};dojox.xml.parser.removeChildren=
function(r){for(var k=r.childNodes.length;r.hasChildNodes();)r.removeChild(r.firstChild);return k};dojox.xml.parser.innerXML=function(r){return r.innerXML?r.innerXML:r.xml?r.xml:"undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(r):null};return dojox.xml.parser})},"esri/views/3d/webgl-engine/lib/GLSLShaderRep":function(){define(["require","exports","./Util"],function(x,r,k){return function(){function a(){this.shaders={}}a.prototype.add=function(a,c){k.assert(null==this.shaders[a]);
this.shaders[a]=c};a.prototype.get=function(a){k.assert(void 0!==this.shaders[a]);return this.shaders[a]};return a}()})},"esri/views/3d/webgl-engine/lib/TextureRenderer":function(){define("require exports ./Renderer ./Camera ./Util ./gl-matrix ../materials/internal/TexOnlyGLMaterial ./ModelDirtyTypesTs ./RenderPass ./HighlightUtils ./ComponentUtils ../../../webgl/FramebufferObject ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ../../../webgl/Texture ../../support/debugFlags ../lighting/Lightsources ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A){var J=c.vec3d,I=c.vec4d,K=c.mat4d;x=function(){function a(a,b,c,f,l,p){var h=this;this._acquiredTextures={};this._clearColor=I.createFrom(0,0,0,0);this._id2origin={};this._uniqueIdx=0;this._rctx=a;this._canvas=b;this._programRep=c;this._textureRep=l;this._modelDirtySet=p;this._renderer=new k(c,f,l,this._rctx,!0);this._renderer.onHasHighlightsChanged=function(a){if(h.onHasHighlightsChanged)h.onHasHighlightsChanged(a)};this._renderer.setLighting({lights:[new G.AmbientLight(J.createFrom(1,
1,1))],groundLightingFactor:1,globalFactor:0})}a.prototype.dispose=function(){for(var a in this._acquiredTextures)this._acquiredTextures[a].fbo.dispose(),this._textureRep.release(a);this._acquiredTextures=null;this._renderer.dispose();this._renderer=null};a.prototype.addRenderGeometries=function(a){var b=this;a.forEach(function(a){null==a.origin&&(a.origin=b.getOrigin(a.center,a.bsRadius));a.idx=b._uniqueIdx++});this._renderer.modify(a,[])};a.prototype.removeRenderGeometries=function(a){this._renderer.modify([],
a)};a.prototype.updateRenderGeometries=function(a,b){a=a.map(function(a){return{renderGeometry:a,updateType:b}});this._renderer.modify([],[],a,{})};a.prototype.updateRenderOrder=function(a){0<Object.keys(a).length&&this._renderer.modifyRenderOrder(a)};a.prototype.setBackgroundColor=function(a){this._clearColor=a};a.prototype.addRenderGeometryHighlight=function(a,b){var c=a.instanceParameters,f=q.generateHighlightId();c.componentHighlights=l.addHighlight(c.componentHighlights,null,b,f);this.updateRenderGeometries([a],
32);return f};a.prototype.removeRenderGeometryHighlight=function(a,b){var c=a.instanceParameters;c.componentHighlights=l.removeHighlight(c.componentHighlights,b);this.updateRenderGeometries([a],32)};a.prototype.isEmpty=function(){return this._renderer.isEmpty()};a.prototype.processDirtyMaterials=function(){var a=this._modelDirtySet.getDirtyMaterials();a&&this._renderer.modify([],[],[],a);this._modelDirtySet.clearDirtyMaterials()};Object.defineProperty(a.prototype,"hasHighlights",{get:function(){return this._renderer.hasHighlights},
enumerable:!0,configurable:!0});a.prototype.draw=function(a,b){return this.drawPass(f.MATERIAL,a,b)};a.prototype.drawHighlights=function(a,b){return this.drawPass(f.MATERIAL_HIGHLIGHT,a,b)};a.prototype.drawPass=function(a,b,c){if(this.isEmpty()&&!F.OVERLAY_DRAW_TEST_TEXTURE)return!1;this.processDirtyMaterials();if(a===f.MATERIAL_HIGHLIGHT&&!this.hasHighlights||!c.views.some(function(a){return a.extent[0]!==a.extent[2]&&a.extent[1]!==a.extent[3]}))return!1;var l=b.getId(),p,n=this._rctx,h=n.gl;if(this._acquiredTextures[l])p=
this._acquiredTextures[l].fbo;else{p=this._textureRep.aquire(l).getGLTexture();p=y.createWithAttachments(this._rctx,p,{colorTarget:0,depthStencilTarget:0});var k=Object.keys(this._acquiredTextures).length;this._acquiredTextures[l]={texture:b,fbo:p,idx:k}}b=c.width;k=c.height;if(p.width!==b||p.height!==k)p.resize(b,k),p.colorTexture.setSamplingMode(9729);O.near=1;O.far=1E4;n.bindFramebuffer(p);n.setDepthTestEnabled(!1);n.setBlendFunctionSeparate(770,771,1,771);n.setClearColor.apply(n,this._clearColor);
n.clear(h.COLOR_BUFFER_BIT);this._renderer.setPixelRatio(c.pixelRatio||1);for(h=0;h<c.views.length;h++)p=c.views[h],O.viewport=p.viewport,K.ortho(0,p.extent[2]-p.extent[0],0,p.extent[3]-p.extent[1],O.near,O.far,O.projectionMatrix),K.identity(O.viewMatrix),K.translate(O.viewMatrix,[-p.extent[0],-p.extent[1],0]),O.setGLViewport(this._rctx),F.OVERLAY_DRAW_TEST_TEXTURE&&this._drawTestTexture(b,k,L[this._acquiredTextures[l].idx%L.length]),this._renderer.renderGeometryPass(a,O);n.setDepthTestEnabled(!0);
n.setBlendFunctionSeparate(770,771,1,771);n.bindFramebuffer(null);n.setViewport(0,0,this._canvas.width,this._canvas.height);return!0};a.prototype._drawTestTexture=function(a,b,c){var f=this._rctx,l=f.gl;if(!this._testPatternMat){for(var p=new Uint8Array(a*b*4),h=0,n=0;n<b;n++)for(var k=0;k<a;k++){var e=Math.floor(k/10),d=Math.floor(n/10);2>e||2>d||10*e>a-20||10*d>b-20?(p[h++]=255,p[h++]=255,p[h++]=255,p[h++]=255):(p[h++]=255,p[h++]=255,p[h++]=255,e&1&&d&1?p[h++]=k&1^n&1?0:255:p[h++]=e&1^d&1?0:128)}a=
new D(f,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:a,height:b},p);this._testPatternMat=new t(this._programRep,a,[1,1,1,1],!0,l.ALWAYS);this._testPatternBindParams={proj:K.identity(),view:K.identity(),nearFar:[-1,1],origin:[0,0,0]};l=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,-1,1,0,0,1,1,1,0,1,1]);this._quadVAO=new B(f,A.Default3D,{geometry:z.Pos3Tex},{geometry:v.createVertex(f,35044,l)})}this._testPatternMat.setColor([c[0],c[1],c[2],1]);this._testPatternMat.bind(f,this._testPatternBindParams);
this._testPatternMat.bindView(f,this._testPatternBindParams);f.bindVAO(this._quadVAO);f.drawArrays(5,0,w.vertexCount(this._quadVAO,"geometry"));this._testPatternMat.release(f)};a.prototype.getOrigin=function(a,c){var f=0;c=10*c/1E4;1<c&&(f=Math.ceil(b.logWithBase(c,2)));c=1E4*Math.pow(2,f);var l=Math.round(a[0]/c),p=Math.round(a[1]/c);a=Math.round(a[2]/c);var f=f+"_"+l+"_"+p+"_"+a,n=this._id2origin[f];null==n&&(n={vec3:J.createFrom(l*c,p*c,a*c),id:f},this._id2origin[f]=n);return n};return a}();var L=
[[1,.5,.5],[.5,.5,1],[.5,1,.5]],O=new a;return x})},"esri/views/3d/webgl-engine/lib/Renderer":function(){define("require exports ./IntervalUtilities ./ModelDirtyTypesTs ./Float32ArrayList ./InstanceBufferData ../lighting/SceneLighting ./LinearDepthTextureHelper ./NormalTextureHelper ./HighlightTextureHelper ./RenderPass ./RenderSlot ./RenderContext ./ExternalRendererContainer ./StencilRenderingHelper ./Util ./gl-matrix ./ComponentUtils ../../../webgl/Texture ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ./FxaaRenderPass ./SmaaRenderPass ../../../webgl/enums ./DefaultVertexAttributeLocations ../../../webgl/Profiling ../materials/HUDMaterial".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U){function N(a){return G.generateVisibleIndexRanges(a.instanceParameters.componentVisibilities,a.componentOffsets)}function R(a,b,d){var c=a.origin.vec3;Q(Y,-c[0],-c[1],-c[2]);e.multiply(Y,a.transformation,b);e.inverse(b,d);e.transpose(d)}function S(a,b,d){for(var e in a){var c=a[e];b(e,c);for(var g in c.origin2data)d(g,c.origin2data[g])}}function T(a){return!1===a.preinterleaved?ca(a.indices).length:a.indexCount}var V=D.assert,h=D.objectEmpty,
ca=D.getFirstObjectValue,Q=D.setMatrixTranslation3;x=F.vec2d;var e=F.mat4d,d=D.VertexAttrConstants,g=e.identity();D=function(){function a(a,b,d,e,c){this._lighting=new t.SceneLighting;this._mat2DataMerged={};this._mat2DataInstanced={};this._mat2DataPreinterleaved={};this._renderOrder=[];this._externalRenderers=new v;this._renderContext=new B;this._isRendering=!1;this._highlights=[];this._pixelRatio=1;this._threshold=1535;this._needsRender=!0;this._fallbackDepthStencilTexture=null;this._stats=new m;
this.ssaoEnabled=!1;this.renderOptions={antialiasing:"smaa",earlyOcclusionPixelDraw:!1};this._programRep=a;this._materialRep=b;this._orderedRendering=c;this._rctx=e;this._fxaaPass=new I(e);this._smaaPass=new K(e);this._renderContext.lightingData=this._lighting.getOld();e.setDepthTestEnabled(!0);e.setFaceCullingEnabled(!0);e.setBlendingEnabled(!1);e.setBlendFunctionSeparate(770,771,1,771);this._bindParameters={view:null,proj:null,viewInvTransp:null,nearFar:null,lightingData:null,viewport:null,framebufferTex:null,
shadowMappingEnabled:!1,ssaoEnabled:!1,origin:null,pixelRatio:null,instanceParameters:null,depthFBO:null,normalFBO:null,extensions:{angleInstancedArrays:e.extensions.angleInstancedArrays}};this._linearDepthTextureHelper=new n(e);this._normalTextureHelper=new f(e);this._highlightTextureHelper=new q(e);this._stencilRenderingHelper=new w(e);this._initializeFramebufferTexture()}a.prototype._initializeFramebufferTexture=function(){var a=this._rctx.gl,a=this._rctx.contextAttributes.alpha?a.RGBA:a.RGB,b=
new p(this._rctx,{target:3553,pixelFormat:a,dataType:5121,samplingMode:9728,wrapMode:33071,width:4,height:4});this._framebuffer={format:a,texture:b}};a.prototype.dispose=function(){var a=this,b=function(b){a._releaseMaterials(b)},d=function(a,b){if(b.type===C.Preinterleaved)for(var d in b.instances)b.instances[d].vao.dispose(!0);else b.vao.dispose(!0)};S(this._mat2DataMerged,b,d);S(this._mat2DataInstanced,b,d);S(this._mat2DataPreinterleaved,b,d);this._mat2DataPreinterleaved=this._mat2DataInstanced=
this._mat2DataMerged=null;this._framebuffer.texture.dispose();this._framebuffer.texture=null;this._linearDepthTextureHelper.getEnableState()&&this._linearDepthTextureHelper.disable();this._normalTextureHelper.getEnableState()&&this._normalTextureHelper.disable();this._highlightTextureHelper.getEnableState()&&this._highlightTextureHelper.setEnableState(!1);this._stencilRenderingHelper.getEnableState()&&this._stencilRenderingHelper.setEnableState(!1);this._fallbackDepthStencilTexture&&(this._fallbackDepthStencilTexture.dispose(),
this._fallbackDepthStencilTexture=null)};a.prototype.setLighting=function(a){this._lighting.set(a)};a.prototype.setPixelRatio=function(a){this._pixelRatio=a;this._needsRender=!0};a.prototype.getPixelRatio=function(){return this._pixelRatio};a.prototype.addExternalRenderer=function(a,b){this._externalRenderers.addRenderer(a,b);return!0};a.prototype.removeExternalRenderer=function(a){this._externalRenderers.removeRenderer(a);return!0};a.prototype.getExternalRenderers=function(){return this._externalRenderers};
a.prototype.resetNeedsRender=function(){this._needsRender=!1;this._externalRenderers.resetNeedsRender()};a.prototype.needsRender=function(){return this._needsRender||this._externalRenderers.needsRender()};a.prototype.getCombinedStats=function(){var a=this;this._stats.VBOallocatedSize=0;this._stats.VBOoptimalSize=0;this._stats.VBOusedSize=0;var b=function(){},d=function(b,d){if(d.type===C.Preinterleaved)for(var e in d.instances)b=d.instances[e].buffer,a._stats.VBOallocatedSize+=b.length,a._stats.VBOusedSize+=
b.length,a._stats.VBOoptimalSize+=b.length;else a._stats.VBOallocatedSize+=d.buffer.getArray().length,a._stats.VBOusedSize+=d.buffer.getSize(),a._stats.VBOoptimalSize+=d.optimalCount};S(this._mat2DataMerged,b,d);S(this._mat2DataInstanced,b,d);S(this._mat2DataPreinterleaved,b,d);this._stats.VBOallocatedSize*=.00390625;this._stats.VBOusedSize*=.00390625;this._stats.VBOoptimalSize*=.00390625;return this._stats};a.prototype._addHighlight=function(a){var b=this._getInstance(a);if(null===b)console.error("No instance found for RenderGeometry {name: '"+
a.name+"', uniqueName: '"+a.uniqueName+"'}");else if(this._highlights.push(b),this._orderedRendering&&this._sortHighlightsByRenderOrder(),this._needsRender=!0,this.onHasHighlightsChanged)this.onHasHighlightsChanged(this.hasHighlights)};a.prototype._removeHighlight=function(a){var b=this._highlights.length;this._highlights=this._highlights.filter(function(b){return b.uniqueName!==a.uniqueName});if(b!==this._highlights.length){if(this.onHasHighlightsChanged)this.onHasHighlightsChanged(this.hasHighlights);
this._needsRender=!0}};Object.defineProperty(a.prototype,"hasHighlights",{get:function(){return 0<this._highlights.length},enumerable:!0,configurable:!0});a.prototype._renderHUDVisibility=function(a){var b=this,d=U.shouldRenderVisibilityDuringRenderPass(a.pass),e=a.offscreenRenderingHelper&&a.offscreenRenderingHelper.getEnableState();d&&e&&a.offscreenRenderingHelper.renderHUDVisibility(function(){b._renderInternalSlot(y.OCCLUSION_PIXELS,a)})};a.prototype.renderGeometrySlots=function(a){this._externalRenderers.render(y.INTERNAL_MATERIAL,
a);this._renderInternalSlot(y.STENCIL_MATERIAL,a);this._externalRenderers.render(y.OPAQUE_TERRAIN,a);this._renderInternalSlot(y.OPAQUE_MATERIAL,a);this._externalRenderers.render(y.OPAQUE_EXTERNAL,a);a.ssaoHelper&&a.ssaoHelper.bindAll(this._programRep);this._renderInternalSlot(y.TRANSPARENT_MATERIAL,a);this.renderOptions.earlyOcclusionPixelDraw&&(this._renderHUDVisibility(a),this._renderInternalSlot(y.LINE_CALLOUTS,this._renderContext));this._externalRenderers.render(y.TRANSPARENT_EXTERNAL,a);a.ssaoHelper&&
a.ssaoHelper.bindAll(this._programRep);this._externalRenderers.render(y.TRANSPARENT_TERRAIN,a)};a.prototype._renderHighlights=function(a,b,d){var e=!!d&&d.getEnableState()&&(this.hasHighlights||this._externalRenderers.needsHighlight());this._highlightTextureHelper.setEnableState(e);if(e){e=null;d.profilingCallback&&(e=P.startMeasurement(this._renderContext.rctx));this._highlightTextureHelper.setupFBOs(a);this._highlightTextureHelper.prepareHighlightPass();this.renderGeometryPass(l.MATERIAL_HIGHLIGHT,
a,null,null);this._rctx.clear(this._rctx.gl.DEPTH_BUFFER_BIT);this._renderInternalSlot(y.LINE_CALLOUTS_HUD_DEPTH,this._renderContext);this._renderInternalSlot(y.HUDMATERIAL1,this._renderContext);this._renderInternalSlot(y.HUDMATERIAL2,this._renderContext);this._highlightTextureHelper.finish(b);var c=this._highlightTextureHelper.getHighlightFBO();d.render(a,b,c);null!==e&&d.profilingCallback&&e.stop(function(a){d.profilingCallback&&d.profilingCallback(a)})}};a.prototype._needsRenderOccluded=function(a){for(var b in this._mat2DataInstanced){var d=
this._mat2DataInstanced[b][0];if(d&&d.isRenderOccluded()&&d.beginSlot(a)&&d.isVisible())return!0}return!1};a.prototype._renderOccluded=function(a,b,d){if(b&&d&&d.getEnableState()){var e=this._needsRenderOccluded(y.OPAQUE_MATERIAL)||this._needsRenderOccluded(y.TRANSPARENT_MATERIAL);e!==b.getEnableState()&&b.setEnableState(e);e&&(e=this._renderContext,b.setupFBOs(a),b.prepareColorPass(),e.pass=l.MATERIAL,e.renderOccludedOnly=!0,this._renderInternalSlot(y.OPAQUE_MATERIAL,e),this._renderInternalSlot(y.TRANSPARENT_MATERIAL,
e),e.renderOccludedOnly=!1,b.finish(d.getFramebuffer()),b.apply())}};a.prototype._renderUnordered=function(a,b,d,c){var g=this._rctx;this._isRendering=!0;this._stats.reset();this._updateGlobalUniforms(a.projectionMatrix);this._renderContext.pass=l.MATERIAL;this._renderContext.camera=a;this._renderContext.shadowMap=b;this._renderContext.ssaoHelper=c.ssao;this._renderContext.offscreenRenderingHelper=c.offscreenRendering;this._renderContext.stencilRenderingHelper=this._stencilRenderingHelper;this._renderContext.depth=
this._linearDepthTextureHelper.getDepthFBO();this._renderContext.normals=this._normalTextureHelper.getNormalFBO();this._renderContext.highlight=this._highlightTextureHelper.getHighlightFBO();this._renderContext.options=this.renderOptions;this._renderContext.rctx=this._rctx;this._renderContext.lightingData=this._lighting.getOld();c.offscreenRendering.setEnableState(!0);c.offscreenRendering.initializeFrame(a);this._externalRenderers.render(y.BACKGROUND,this._renderContext);this.renderGeometrySlots(this._renderContext);
this._externalRenderers.render(y.POSTPROCESSING_ATMOSPHERE,this._renderContext);this._externalRenderers.render(y.POSTPROCESSING_EXTERNAL,this._renderContext);this.renderOptions.earlyOcclusionPixelDraw||(this._renderHUDVisibility(this._renderContext),this._renderInternalSlot(y.LINE_CALLOUTS,this._renderContext));this._renderOccluded(a,c.renderOccluded,c.offscreenRendering);b=this.renderOptions.antialiasing;"smaa"===b&&this._smaaPass.ensureEnabled()?(this._fxaaPass.disable(),this._smaaPass.render({colorTexture:c.offscreenRendering.getColorTexture()},
null)):"fxaa"===b&&this._fxaaPass.enable()?(this._smaaPass.disable(),this._fxaaPass.render({colorTexture:c.offscreenRendering.getColorTexture()},null)):(b=a.viewport,b=e.ortho(b[0],b[2],b[1],b[3],-1,1),c.offscreenRendering.drawQuad(b),this._fxaaPass.disable(),this._smaaPass.disable());g.bindFramebuffer(null);this._renderContext.framebufferTex=c.offscreenRendering.getColorTexture();this._renderInternalSlot(y.LINE_CALLOUTS_HUD_DEPTH,this._renderContext);this._renderInternalSlot(y.HUDMATERIAL1,this._renderContext);
this._renderInternalSlot(y.HUDMATERIAL2,this._renderContext);this._renderHighlights(a,d,c.highlight);this._isRendering=!1};a.prototype._renderGeometryPassOrderedHighlight=function(a){this._renderInternalHighlights(this._highlights)};a.prototype._renderGeometryPassOrderedMaterial=function(a){for(var b=null,d=0;d<this._renderOrder.length;d++){var e=this._renderOrder[d][1];if(e.instanced){var c=e.instanced||e.merged,h=c[a.pass];h&&h.isVisible()&&(this._renderInternalInstanced(c,h,this._bindParameters,
Infinity),b=null)}e.merged&&(c=e.merged,(h=c[a.pass])&&h.isVisible()&&(e=h.getProgram(),e!==b&&(e.setUniformMatrix4fv("model",g),e.hasUniform("modelNormal")&&e.setUniformMatrix4fv("modelNormal",g)),b=e,this._renderInternalMerged(c,h,this._bindParameters,Infinity)))}};a.prototype._renderGeometryPassOrdered=function(a){var b=a.camera;this._bindParameters.view=b.viewMatrix;this._bindParameters.proj=b.projectionMatrix;this._bindParameters.viewInvTransp=b.viewInverseTransposeMatrix;M[0]=b.near;M[1]=b.far;
this._bindParameters.nearFar=M;this._bindParameters.lightingData=this._lighting.getOld();this._bindParameters.viewport=b.fullViewport;this._bindParameters.framebufferTex=this._framebuffer.texture;this._bindParameters.pixelRatio=this._pixelRatio;this._bindParameters.instanceParameters=void 0;this._bindParameters.depthFBO=this._linearDepthTextureHelper.getDepthFBO();this._bindParameters.normalFBO=this._normalTextureHelper.getNormalFBO();a.isHighlightPass?this._renderGeometryPassOrderedHighlight(a):
this._renderGeometryPassOrderedMaterial(a)};a.prototype._renderOrdered=function(a,b){this._stats.reset();this.renderGeometryPass(a,b)};a.prototype.render=function(a,b,d){this._orderedRendering?this._renderOrdered(l.MATERIAL,a):this._renderUnordered(a,d.shadowMap,b,d)};a.prototype.renderAuxiliaryBuffers=function(a,b,d){var e=d.ssao;d=d.shadowMap;var c=this.ssaoEnabled||this._externalRenderers.needsLinearDepth();this._linearDepthTextureHelper.setEnableState(c);c&&(this._linearDepthTextureHelper.setupFBOs(a),
this._linearDepthTextureHelper.prepareDepthPass(),this.renderGeometryPass(l.MATERIAL_DEPTH,a,d,e),this._linearDepthTextureHelper.finish(b));this._normalTextureHelper.setEnableState(this.ssaoEnabled);this.ssaoEnabled&&(this._normalTextureHelper.setupFBOs(a),this._normalTextureHelper.prepareNormalPass(),this.renderGeometryPass(l.MATERIAL_NORMAL,a,d,e),this._normalTextureHelper.finish(b));this.ssaoEnabled&&e.computeSSAO(a,b,this._linearDepthTextureHelper.getDepthFBO(),this._normalTextureHelper.getNormalFBO());
e.bindAll(this._programRep)};a.prototype.renderGeometryPass=function(a,b,d,e){this._isRendering=!0;this._updateGlobalUniforms(b.projectionMatrix);this._renderContext.pass=a;this._renderContext.camera=b;this._renderContext.shadowMap=d;this._renderContext.ssaoHelper=e;this._renderContext.depth=this._linearDepthTextureHelper.getDepthFBO();this._renderContext.normals=this._normalTextureHelper.getNormalFBO();this._renderContext.rctx=this._rctx;this._orderedRendering?this._renderGeometryPassOrdered(this._renderContext):
this._renderGeometryPassUnordered(this._renderContext);this._isRendering=!1};a.prototype._renderGeometryPassUnordered=function(a){this.renderGeometrySlots(a)};a.prototype._renderInternalHighlights=function(a,b){void 0===b&&(b=null);for(var d=0;d<a.length;++d){var e=a[d],c=e.matData[l.MATERIAL_HIGHLIGHT];c&&(null===b||c.beginSlot(b))&&c.isVisible()&&this._renderInternalHighlight(e,this._bindParameters,l.MATERIAL_HIGHLIGHT)}};a.prototype._renderInternalSlotOccluded=function(a,b){for(var d in this._mat2DataInstanced){var e=
this._mat2DataInstanced[d],c=e[b.pass];c&&c.isRenderOccluded()&&c.beginSlot(a)&&c.isVisible()&&this._renderInternalInstanced(e,c,this._bindParameters,a)}};a.prototype._renderInternalSlotMaterial=function(a,b){for(var d in this._mat2DataInstanced){var e=this._mat2DataInstanced[d],c=e[b.pass];c&&c.beginSlot(a)&&c.isVisible()&&this._renderInternalInstanced(e,c,this._bindParameters,a)}for(var e=this._programRep.getProgramsUsingUniform("model"),c=this._programRep.getProgramsUsingUniform("modelNormal"),
h=0;h<e.length;h++){var f=e[h];f.setUniformMatrix4fv("model",g);-1<c.indexOf(f)&&f.setUniformMatrix4fv("modelNormal",g)}for(d in this._mat2DataMerged)e=this._mat2DataMerged[d],(c=e[b.pass])&&c.beginSlot(a)&&c.isVisible()&&this._renderInternalMerged(e,c,this._bindParameters,a);for(d in this._mat2DataPreinterleaved)e=this._mat2DataPreinterleaved[d],(c=e[b.pass])&&c.beginSlot(a)&&c.isVisible()&&this._renderInternalPreinterleaved(e,c,this._bindParameters,a);a===y.STENCIL_MATERIAL&&this._stencilRenderingHelper.finish()};
a.prototype._renderInternalSlotHighlights=function(a,b){this._renderInternalHighlights(this._highlights,a)};a.prototype._renderInternalSlot=function(a,b){this._bindParameters.view=b.camera.viewMatrix;this._bindParameters.proj=b.camera.projectionMatrix;this._bindParameters.viewInvTransp=b.camera.viewInverseTransposeMatrix;this._bindParameters.cameraAboveGround=b.camera.aboveGround;this._bindParameters.fovY=b.camera.fovY;this._bindParameters.poiDistance=b.camera.distance;M[0]=b.camera.near;M[1]=b.camera.far;
var d=this._renderContext.offscreenRenderingHelper;this._bindParameters.nearFar=M;this._bindParameters.lightingData=this._lighting.getOld();this._bindParameters.viewport=b.camera.fullViewport;this._bindParameters.framebufferTex=d?d.getColorTexture():null;this._bindParameters.shadowMap=b.shadowMap;this._bindParameters.shadowMappingEnabled=!!b.shadowMap&&b.shadowMap.getEnableState();this._bindParameters.ssaoEnabled=!!b.ssaoHelper&&b.ssaoHelper.getEnableState();this._bindParameters.pixelRatio=this._pixelRatio;
this._bindParameters.instanceParameters=void 0;this._bindParameters.depthFBO=this._linearDepthTextureHelper.getDepthFBO();this._bindParameters.hudVisibilityTexture=d?d.getHUDVisibilityTexture():null;b.isHighlightPass?this._renderInternalSlotHighlights(a,b):b.renderOccludedOnly?this._renderInternalSlotOccluded(a,b):this._renderInternalSlotMaterial(a,b)};a.prototype._renderInternalInstanced=function(a,b,d,e){var c=this._rctx,g=c.gl,h=!1,f=b.getDrawMode(c),m=this._bindParameters.extensions.angleInstancedArrays,
l;for(l in a.origin2data){var p=a.origin2data[l];d.origin=p.origin;e===y.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());var n=!1;if(b.instanced)for(var k in p.perGeometryDataInfo){var q=p.perGeometryDataInfo[k];h||(b.bind(c,d),h=!0);c.bindVAO(q.vao);var t=b.getProgram();J.assertCompatibleVertexAttributeLocations(q.vao,t);n||(b.bindView(c,d),n=!0);var t=q.to-q.from,v=q.refCount;f===g.TRIANGLES&&(this._stats.trianglesRendered+=
v*t/3);m.drawArraysInstancedANGLE(f,q.from,t,v);this._stats.drawCallsAngleInstanced++;this._stats.instancesDrawnAngle+=v}else{var q=p.instances,u;for(u in q)t=q[u],v=t.displayedIndexRange,v&&0===v.length||(h||(b.bind(c,d),h=!0),n||(c.bindVAO(p.vao),b.bindView(c,d),n=!0),b.bindInstance(c,t),this._stats.drawCallsInstanced++,f===g.TRIANGLES&&(this._stats.trianglesRendered+=(t.to-t.from)/3),v?this._drawArraysFaceRange(v,t.from,f):c.drawArrays(f,t.from,t.to-t.from))}}c.bindVAO(null);h&&b.release(c,d)};
a.prototype._renderInternalHighlight=function(a,b,d){var e=this._rctx,c=e.gl;d=a.matData[d];var h=d.getDrawMode(e),f=a.instance,m=f.highlightedIndexRange,l=this._renderContext.offscreenRenderingHelper,l=(l?l.getDepthTexture():null)||this._getFallbackDepthTexture(),p=d.getProgram(),n=this._bindParameters.extensions.angleInstancedArrays;b.origin=a.originData.origin;if(d.instanced&&a.type===C.Instanced)for(a=a.instancedVAO,d.bind(e,b),e.bindVAO(a),J.assertCompatibleVertexAttributeLocations(a,p),d.bindView(e,
b),a=0;a<m.length;a++){var k=m[a],q=k.range?k.range[0]+f.from:f.from,k=k.range?k.range[1]-k.range[0]+1:f.to-f.from;e.bindTexture(l,5);p.setUniform1i("depthTex",5);p.setUniform4f("highlightViewportPixelSz",0,0,1/this._bindParameters.viewport[2],1/this._bindParameters.viewport[3]);n.drawArraysInstancedANGLE(h,q,k,1);h===c.TRIANGLES&&(this._stats.trianglesRendered+=1*k/3);this._stats.drawCallsHighlight++}else if(a.type===C.Instanced&&d.instanced)console.error("_renderInternalHighlight: incompatible instance type");
else{d.bind(e,b);d.bindView(e,b);switch(a.type){case C.Merged:n=a.originData;e.bindVAO(n.vao);p.setUniformMatrix4fv("model",g);break;case C.Instanced:n=a.originData;e.bindVAO(n.vao);d.bindInstance(e,f);break;case C.Preinterleaved:n=a.originData,a=n.instances[a.uniqueName].vao,e.bindVAO(a),d.bindInstance(e,f)}for(a=0;a<m.length;a++)k=m[a],q=k.range?k.range[0]+f.from:f.from,k=k.range?k.range[1]-k.range[0]+1:f.to-f.from,e.bindTexture(l,5),d.getProgram().setUniform1i("depthTex",5),p.setUniform4f("highlightViewportPixelSz",
0,0,1/this._bindParameters.viewport[2],1/this._bindParameters.viewport[3]),e.drawArrays(h,q,k),h===c.TRIANGLES&&(this._stats.trianglesRendered+=k/3),this._stats.drawCallsHighlight++}e.bindVAO(null);d.release(e,b)};a.prototype._drawArraysFaceRange=function(a,b,d){for(var e=this._rctx,c=0;c<a.length;c++){var g=a[c];e.drawArrays(d,g[0]+b,g[1]-g[0]+1)}this._stats.drawCallsFragmented+=a.length-1};a.prototype._renderInternalMerged=function(a,b,d,e){var c=this._rctx,g=c.gl,h=!1,f;for(f in a.origin2data){var m=
a.origin2data[f];d.origin=m.origin;e===y.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());if(!m.displayedIndexRange||0!==m.displayedIndexRange.length){h||(b.bind(c,d),h=!0);var l=b.getProgram();c.bindVAO(m.vao);J.assertCompatibleVertexAttributeLocations(m.vao,l);b.bindView(c,d);this._stats.drawCallsMerged++;l=b.getDrawMode(c);l===g.TRIANGLES&&(this._stats.trianglesRendered+=m.vao.vertexBuffers.geometry.size/3);m.displayedIndexRange?
this._drawArraysFaceRange(m.displayedIndexRange,0,l):c.drawArrays(l,0,J.vertexCount(m.vao,"geometry"))}}h&&b.release(c,d)};a.prototype._renderInternalPreinterleaved=function(a,b,d,e){var c=this._rctx,g=c.gl,h=!1,f=b.getDrawMode(c),m;for(m in a.origin2data){var l=a.origin2data[m];d.origin=l.origin;var p=!1;e===y.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());for(var n in l.instances){var k=l.instances[n],q=k.instance,k=k.vao,
t=q.displayedIndexRange;if(!t||0!==t.length){h||(b.bind(c,d),h=!0);var v=b.getProgram();J.assertCompatibleVertexAttributeLocations(k,v);c.bindVAO(k);p||(b.bindView(c,d),p=!0);b.bindInstance(c,q);this._stats.drawCallsPreinterleaved++;f===g.TRIANGLES&&(this._stats.trianglesRendered+=(q.to-q.from)/3);t?this._drawArraysFaceRange(t,q.from,f):c.drawArrays(f,q.from,q.to-q.from)}}}c.bindVAO(null);h&&b.release(c,d)};a.prototype._updateGlobalUniforms=function(a){for(var b=this._programRep.getProgramsUsingUniform("proj"),
d=0;d<b.length;d++)b[d].setUniformMatrix4fv("proj",a);if(this._lighting){b=this._programRep.getProgramsUsingUniform("lightingMainDirection");for(d=0;d<b.length;d++)this._lighting.setUniforms(b[d]);b=this._programRep.getProgramsUsingUniform("lightDirection");for(d=0;d<b.length;d++)this._lighting.setUniforms(b[d])}};a.prototype.print=function(){var a=Object.keys(this._mat2DataMerged).length,b=Object.keys(this._mat2DataInstanced).length,d=Object.keys(this._mat2DataPreinterleaved).length;console.log("number of materials (merged/instanced/preinterleaved): "+
a+"/"+b+"/"+d);var e=0;S(this._mat2DataMerged,function(){},function(a,b){e+=Object.keys(b.instances).length});var c=0;S(this._mat2DataInstanced,function(){},function(a,b){c+=Object.keys(b.instances).length});var g=0;S(this._mat2DataPreinterleaved,function(){},function(a,b){g+=Object.keys(b.instances).length});console.log("number of instances (merged/instanced/preinterleaved): "+e+"/"+c+"/"+g)};a.prototype.isEmpty=function(){for(var a in this._mat2DataInstanced){var b=this._mat2DataInstanced[a],d;
for(d in b.origin2data)if(!h(b.origin2data[d].instances))return!1}for(a in this._mat2DataMerged)for(d in b=this._mat2DataMerged[a],b.origin2data)if(!h(b.origin2data[d].instances))return!1;for(a in this._mat2DataPreinterleaved)for(d in b=this._mat2DataPreinterleaved[a],b.origin2data)if(!h(b.origin2data[d].instances))return!1;return!0};a.prototype.modify=function(a,b,d,e){this._isRendering&&console.warn("Renderer.modify called while rendering");var c=[],g=[],h=[];this._classifyRenderGeometry(a,c,g,
h);a=[];var f=[],m=[];this._classifyRenderGeometry(b,a,f,m);var l={};d&&this._performUpdates(d,l);d=[];this._modifyMerged(c,a,d,l);this._modifyInstanced(g,f,d);this._modifyPreinterleaved(h,m,d);this._updateMergedFaceranges(l);this._releaseMaterials(d);c=this._highlights.length;if(b&&0<b.length&&0<c&&(this._highlights=this._highlights.filter(function(a){return!b.some(function(b){return b.uniqueName===a.uniqueName})}),c!==this._highlights.length&&this.onHasHighlightsChanged))this.onHasHighlightsChanged(this.hasHighlights);
this._updateHighlightVAOs();this._modifyMaterials(e);this._needsRender=!0};a.prototype._classifyRenderGeometry=function(a,b,d,e){for(var c=0;c<a.length;c++){var g=a[c];if(1<=T(g.data))switch(this._getType(g)){case C.Merged:b.push(g);break;case C.Instanced:d.push(g);break;case C.Preinterleaved:e.push(g)}}};a.prototype._performUpdates=function(a,b){for(var d=0;d<a.length;d++){var e=a[d],c=e.updateType,e=e.renderGeometry,g=this._getType(e)===C.Merged;if(1<=T(e.data)){c&2&&this._updateFaceranges(e,b);
if(c&32){var h=this._getInstance(e);h&&this._updateHighlightFaceranges(e,h.instance)}c&4||g&&c&16?this._updateVertexAttributes(e,!g):!g&&c&16?this._updateInstanceTransformation(e):c&8&&this._updateColorAttributes(e)}}};a.prototype._updateFaceranges=function(a,b){var d=a.material.getId(),e=a.origin.id,c=this._getType(a),g;if(c===C.Preinterleaved){var h=this._getOriginData(c,d,e);g=h.instances[a.uniqueName].instance}else h=this._getOriginData(c,d,e),(g=h.instances[a.uniqueName])&&c===C.Merged&&(b[this._modifiedMergedFacerangesKey(d,
e)]=h);g&&(g.displayedIndexRange=N(a),this._updateHighlightFaceranges(a,g))};a.prototype._updateHighlightFaceranges=function(a,b){if(b){var d=b.highlightedIndexRange,e;e=G.generateHighlightedIndexRanges(a.instanceParameters.componentVisibilities,a.instanceParameters.componentHighlights,a.componentOffsets);(b.highlightedIndexRange=e)&&!d?this._addHighlight(a):!e&&d&&this._removeHighlight(a)}};a.prototype._updateMergedFaceranges=function(a){for(var b in a){var d=a[b];d.displayedIndexRange=[];var e=
d.instances,c=!0,g;for(g in e){var h=e[g];h.displayedIndexRange?(d.displayedIndexRange.push.apply(d.displayedIndexRange,k.offsetIntervals(h.displayedIndexRange,h.from)),c=!1):d.displayedIndexRange.push([h.from,h.to-1])}d.displayedIndexRange=c?null:k.mergeIntervals(d.displayedIndexRange)}};a.prototype._updateVertexAttributes=function(a,b){var d=a.material,e=d.getId(),c=a.origin.id,g=J.getStride(d.getVertexBufferLayout())/4,h=this._getType(a);if(h===C.Preinterleaved)h=this._getOriginData(h,e,c),b=h.instances[a.uniqueName],
e=b.instance,c=b.buffer,h=b.vao;else{var h=this._getOriginData(h,e,c),e=h.instances[a.uniqueName],c=h.buffer.getArray(),h=h.vao,f=void 0,m=void 0;b||(R(a,W,da),f=W,m=da);d.fillInterleaved(a.data,f,m,a.instanceParameters,c,e.from*g)}V(e.from+d.getOutputAmount(T(a.data))/g===e.to,"material VBO layout has changed");h.vertexBuffers.geometry.setSubData(c,e.from*g*4,e.from*g*4,e.to*g*4)};a.prototype._updateInstanceTransformation=function(a){var b=this._getType(a),d=a.material.getId(),e=a.origin.id;b===
C.Preinterleaved?(b=this._getOriginData(b,d,e),e=b.instances[a.uniqueName].instance,R(a,e.transformation,e.transformationNormal)):(b=this._getOriginData(b,d,e),e=b.instances[a.uniqueName],b=b.perGeometryDataInfo[a.data.id],d=b.instanceBufferData,R(a,e.transformation,e.transformationNormal),d&&(a=d.getSlot(a.idx),d.fill(a,0,e.transformation),d.fill(a,16,e.transformationNormal),a=4*d.getOffset(a),e=J.getStride(b.vao.layout.instance),b.vao.vertexBuffers.instance.setSubData(d.getArray(),a,a,a+e)))};a.prototype._updateColorAttributes=
function(a){var b=a.material,e=b.getId(),c=a.origin.id,g=J.getStride(b.getVertexBufferLayout())/4,h=this._getType(a);if(h===C.Preinterleaved)var h=this._getOriginData(h,e,c),f=h.instances[a.uniqueName],e=f.instance,c=f.buffer,h=f.vao;else{var h=this._getOriginData(h,e,c),e=h.instances[a.uniqueName],c=h.buffer.getArray(),h=h.vao,m=(f={},f[d.COLOR]=!0,f[d.SYMBOLCOLOR]=!0,f);b.fillInterleaved(a.data,void 0,void 0,a.instanceParameters,c,e.from*g,m)}V(e.from+b.getOutputAmount(T(a.data))/g===e.to,"material VBO layout has changed");
h.vertexBuffers.geometry.setSubData(c,e.from*g*4,e.from*g*4,e.to*g*4)};a.prototype._modifyMerged=function(a,d,c,g){var h=this._rctx,f=C.Merged;a=this._compMat2delta(a,d,f);d=this._mat2DataMerged;for(var m in a){var l=a[m],p;for(p in l){var n=l[p],k=n.optimalCount,q=n.material,t=q.getVertexBufferLayout(),v=J.getStride(t)/4,y=d[m];if(null==y){V(0<k);var w=q.getRenderPriority(),y=this._initializeMatData(q);d[m]=y;this._orderedRendering&&this._insertIntoRenderOrder(y,w,"merged")}w=y.origin2data[p];null==
w&&(V(0<k),w={type:f,instances:{},vao:new z(h,O.Default3D,{geometry:t},{geometry:A.createVertex(h,35044)}),buffer:new b(k),optimalCount:0,origin:n.origin},y.origin2data[p]=w);if(0<k){var t=w.buffer.getSize(),r=w.buffer.getArray(),y=k<n.sparseCount/2,B=w.buffer.resize(y?k:n.sparseCount),D=n.toRemove;if(y||B){for(var t=0,F=w.buffer.getArray(),y=0;y<D.length;++y)B=w.instances[D[y].uniqueName],w.optimalCount-=(B.to-B.from)*v,delete w.instances[D[y].uniqueName];var y={},G;for(G in w.instances)B=w.instances[G],
V(null==y[B.from]),y[B.from]=B;for(var K in y){var B=y[K],L=B.from*v,I=B.to*v;F.set(r.subarray(L,I),t);B.from=t/v;t+=I-L;B.to=t/v}V(t===w.optimalCount)}else for(y=0;y<D.length;++y)B=D[y].uniqueName,V(void 0!==w.instances[B]),L=w.instances[B].from*v,I=w.instances[B].to*v,w.buffer.erase(L,I),delete w.instances[B],w.optimalCount-=I-L;Q(Y,-n.origin[0],-n.origin[1],-n.origin[2]);r=n.toAdd;n=!1;for(y=0;y<r.length;++y)D=r[y],L=D.data,e.multiply(Y,D.transformation,W),e.inverse(W,da),e.transpose(da),B=t,q.fillInterleaved(L,
W,da,D.instanceParameters,w.buffer.getArray(),t),L=q.getOutputAmount(T(L)),F=B+L,V(null==w.instances[D.uniqueName]),I=N(D),B=new u(D.name,B/v,F/v,I,void 0,void 0,D.idx),w.instances[D.uniqueName]=B,this._updateHighlightFaceranges(D,B),I&&(n=!0),w.optimalCount+=L,t+=L;V(w.optimalCount===k);k=new Float32Array(w.buffer.getArray().buffer,0,w.buffer.getSize());w.vao.vertexBuffers.geometry.setData(k);if(n||w.displayedIndexRange)g[this._modifiedMergedFacerangesKey(m,p)]=w}else V(0===k),w.vao.dispose(!0),
w.vao=null,delete y.origin2data[p],0===Object.keys(y.origin2data).length&&(c.push(m),delete d[m],this._orderedRendering&&this._removeFromRenderOrder(y,"merged"))}}};a.prototype._modifyInstanced=function(a,d,g){var h=this._rctx,f=C.Instanced;a=this._compMat2delta(a,d,f);d=this._mat2DataInstanced;for(var m in a){var p=a[m],n;for(n in p){var k=p[n];if(0===k.optimalCount)k=d[m],k.origin2data[n].vao.dispose(!0),delete k.origin2data[n],0===Object.keys(k.origin2data).length&&(g.push(m),delete d[m],this._orderedRendering&&
this._removeFromRenderOrder(k,"instanced"));else{var q=k.material,t=d[m];if(null==t){var v=q.getRenderPriority(),t=this._initializeMatData(q);d[m]=t;this._orderedRendering&&this._insertIntoRenderOrder(t,v,"instanced")}var y=q.getVertexBufferLayout(),w=t[l.MATERIAL].instanced?q.getInstanceBufferLayout():void 0,r=w&&J.findAttribute(w,"instanceColor"),B=w&&J.findAttribute(w,"instanceFeatureAttribute"),D=J.getStride(y)/4,v=t.origin2data[n];null==v&&(v={type:f,instances:{},vao:new z(h,O.Default3D,{geometry:y},
{geometry:A.createVertex(h,35044)}),buffer:new b(k.optimalCount),optimalCount:0,perGeometryDataInfo:{},origin:k.origin},t.origin2data[n]=v);var t=v.buffer.getSize(),F=v.buffer.getArray(),G=k.optimalCount<k.sparseCount/2,L=v.buffer.resize(G?k.optimalCount:k.sparseCount),K;for(K in k.perGeometryDelta){var I=v.perGeometryDataInfo[K];if(I&&I.instanceBufferData){var x=k.perGeometryDelta[K].removeCount;0<x&&I.instanceBufferData.prepareFree(x)}}var M=k.toRemove;if(G||L){for(G=0;G<M.length;++G){L=M[G];delete v.instances[L.uniqueName];
K=L.data.id;var P=I=v.perGeometryDataInfo[K];0===--P.refCount&&null==k.dataId2refCount[K]?(v.optimalCount-=(P.to-P.from)*D,delete v.perGeometryDataInfo[K]):I.instanceBufferData&&I.instanceBufferData.free(L.idx)}var t=0,G=v.buffer.getArray(),L={},U;for(U in v.perGeometryDataInfo)P=v.perGeometryDataInfo[U],V(null==L[P.from]),L[P.from]=P;for(var R in L)P=L[R],x=P.from*D,I=P.to*D,G.set(F.subarray(x,I),t),P.from=t/D,t+=I-x,P.to=t/D;for(var W in v.instances)x=v.instances[W],x.from=v.perGeometryDataInfo[x.dataId].from,
x.to=v.perGeometryDataInfo[x.dataId].to}else for(G=0;G<M.length;++G)L=M[G],delete v.instances[L.uniqueName],K=L.data.id,I=v.perGeometryDataInfo[K],0===--I.refCount&&null==k.dataId2refCount[K]?(x=I.from*D,I=I.to*D,v.buffer.erase(x,I),v.optimalCount-=I-x,delete v.perGeometryDataInfo[K]):I.instanceBufferData&&I.instanceBufferData.free(L.idx);Q(Y,-k.origin[0],-k.origin[1],-k.origin[2]);for(K in k.perGeometryDelta)(I=v.perGeometryDataInfo[K])&&I.instanceBufferData&&(G=k.perGeometryDelta[K].addCount,0<
G&&I.instanceBufferData.prepareAllocate(G));F=k.toAdd;for(G=0;G<F.length;++G)if(L=F[G],x=L.data,K=x.id,I=v.perGeometryDataInfo[K],null==I?(q.fillInterleaved(x,void 0,void 0,void 0,v.buffer.getArray(),t),M=q.getOutputAmount(T(x)),x=t/D,t+=M,I=t/D,v.optimalCount+=M,I={refCount:1,from:x,to:I,vao:null,instanceBufferData:null},w&&(x=J.getStride(w)/4,I.vao=new z(h,O.Default3D,{geometry:y,instance:w},{geometry:v.vao.vertexBuffers.geometry,instance:A.createVertex(h,35044)}),I.instanceBufferData=new c(x,k.perGeometryDelta[K].addCount)),
v.perGeometryDataInfo[K]=I):++I.refCount,V(I.from*D<=v.buffer.getSize()&&I.to*D<=v.buffer.getSize()),x=e.create(),e.multiply(Y,L.transformation,x),M=N(L),x=new u(L.name,I.from,I.to,M,x,L.instanceParameters,L.idx,K),v.instances[L.uniqueName]=x,this._updateHighlightFaceranges(L,x),I=I.instanceBufferData)M=I.allocate(L.idx),I.fill(M,0,x.transformation),I.fill(M,16,x.transformationNormal),r&&I.fill(M,r.offset/4,L.instanceParameters.color),B&&I.fill(M,B.offset/4,L.instanceParameters.featureAttribute);
V(v.optimalCount===k.optimalCount);q=new Float32Array(v.buffer.getArray().buffer,0,v.buffer.getSize());v.vao.vertexBuffers.geometry.setData(q);for(K in v.perGeometryDataInfo)if(y=v.perGeometryDataInfo[K],y.vao&&(q=y.vao.vertexBuffers.instance))w=k.perGeometryDelta[K],0<w.addCount+w.removeCount&&(y=y.instanceBufferData.compact(),q.setData(y))}}}};a.prototype._modifyPreinterleaved=function(a,b,d){for(var c=this._rctx,g=C.Preinterleaved,h=this._mat2DataPreinterleaved,f=0;f<a.length;f++){var m=a[f],l=
m.material,p=l.getId(),n=m.origin.id,k=m.origin.vec3,q=h[p];null==q&&(q=this._initializeMatData(l),h[p]=q);p=q.origin2data[n];null==p&&(p={type:g,origin:k,count:0,instances:{}},q.origin2data[n]=p);Q(Y,-k[0],-k[1],-k[2]);q=e.create();e.multiply(Y,m.transformation,q);k=N(m);n=m.data;n.preinterleaved?(q=new u(m.name,0,n.indexCount,k,q,m.instanceParameters,m.idx,n.id),l=l.getVertexBufferLayout(),l=new z(c,O.Default3D,{geometry:l},{geometry:A.createVertex(c,35044)}),l.vertexBuffers.geometry.setData(n.vertexData),
p.count+=1,p.instances[m.uniqueName]={instance:q,vao:l,buffer:n.vertexData},this._updateHighlightFaceranges(m,q)):V(!1,"Non-interleaved render geometry processed as pre-interleaved")}for(a=0;a<b.length;a++)m=b[a],k=m.origin,l=m.material,p=l.getId(),n=k.id,m=m.uniqueName,q=h[p],c=q.origin2data[n],c.instances[m].vao.dispose(),delete c.instances[m],--c.count,0===c.count&&delete q.origin2data[n],0===Object.keys(q.origin2data).length&&(d.push(p),delete h[p])};a.prototype._compMat2delta=function(a,b,d){var e=
{};this._updateMat2delta(a,!0,d,e);this._updateMat2delta(b,!1,d,e);return e};a.prototype._updateMat2delta=function(a,b,d,e){d=d===C.Instanced;for(var c=0;c<a.length;c++){var g=a[c],h=g.origin,f=g.material,m=f.getId(),l=d?this._mat2DataInstanced[m]:this._mat2DataMerged[m],l=l&&l.origin2data[h.id],p=e[m];null==p&&(p={},e[m]=p);m=p[h.id];if(null==m){m={optimalCount:null==l?0:l.optimalCount,sparseCount:null==l?0:l.buffer.getSize(),material:f,toAdd:[],toRemove:[],perGeometryDelta:null,origin:h.vec3};if(d){var n=
{};if(void 0!==l)for(var k in l.perGeometryDataInfo)n[k]=l.perGeometryDataInfo[k].refCount;m.dataId2refCount=n;m.perGeometryDelta={}}p[h.id]=m}h=f.getOutputAmount(T(g.data));d?(f=g.data.id,l=m.perGeometryDelta[f],l||(l={addCount:0,removeCount:0},m.perGeometryDelta[f]=l),b?(l.addCount++,null==m.dataId2refCount[f]&&(m.dataId2refCount[f]=0),1===++m.dataId2refCount[f]&&(m.optimalCount+=h,m.sparseCount+=h),m.toAdd.push(g)):(l.removeCount++,0===--m.dataId2refCount[f]&&(delete m.dataId2refCount[f],m.optimalCount-=
h),m.toRemove.push(g))):b?(m.optimalCount+=h,m.sparseCount+=h,m.toAdd.push(g)):(m.optimalCount-=h,m.toRemove.push(g))}};a.prototype._getType=function(a){if(a.data.preinterleaved)return C.Preinterleaved;var b=!1,d=T(a.data),b=(b=(b=(b=b||!1===a.material.canBeMerged)||a.material.instanced)||a.material.isBackdrop)||!0===a.material.isRenderOccluded();a.singleUse||(b=b||d>this._threshold);return b?C.Instanced:C.Merged};a.prototype._getTargetMat2Data=function(a){switch(a){case C.Merged:return this._mat2DataMerged;
case C.Instanced:return this._mat2DataInstanced;case C.Preinterleaved:return this._mat2DataPreinterleaved}};a.prototype._getOriginData=function(a,b,d){return this._getTargetMat2Data(a)[b].origin2data[d]};a.prototype._modifiedMergedFacerangesKey=function(a,b){return a+"_"+b};a.prototype._insertIntoRenderOrder=function(a,b,d){for(var e=a[l.MATERIAL].getMaterialId(),c=this._renderOrder.length,g=0;g<c&&this._renderOrder[g][0]>=b;){var h=this._renderOrder[g][1];if(h.id===e){V(!h[d],"matData for type already exists");
h[d]=a;return}g++}e={id:e,instanced:null,merged:null};e[d]=a;this._renderOrder.splice(g,0,[b,e])};a.prototype._removeFromRenderOrder=function(a,b){var d=a[l.MATERIAL].getMaterialId();for(a=0;this._renderOrder[a][1].id!==d;)a++;d=this._renderOrder[a][1];d[b]=null;d.instanced||d.merged||this._renderOrder.splice(a,1)};a.prototype._sortHighlightsByRenderOrder=function(){this._highlights.sort(function(a,b){a=a.matData[l.MATERIAL].getRenderPriority();b=b.matData[l.MATERIAL].getRenderPriority();return a>
b?-1:b>a?1:0})};a.prototype._updateRenderOrder=function(a,b){for(var d=b.length,e=0;e<d&&b[e][1].id!==a;)e++;if(e<d){a=b[e][1];a=(a.merged||a.instanced)[l.MATERIAL].getRenderPriority();var c=b[e][0];if(a!==b[e][0])for(b[e][0]=a,c=a>c?-1:1,e+=c;-1<e&&e<d&&c*b[e][0]>c*a;){var g=b[e];b[e]=b[e-c];b[e-c]=g;e+=c}}};a.prototype._modifyMaterials=function(a){for(var b in a)this._materialRep.updateMaterialParameters(b)};a.prototype.modifyRenderOrder=function(a){if(this._orderedRendering){for(var b in a)this._updateRenderOrder(b,
this._renderOrder);this._sortHighlightsByRenderOrder();this._needsRender=!0}};a.prototype._initializeMatData=function(a){var b={origin2data:{}};b[l.MATERIAL]=this._materialRep.aquire(a);b[l.MATERIAL_DEPTH_SHADOWMAP]=this._materialRep.aquireDepthShadowMap(a);b[l.MATERIAL_NORMAL]=this._materialRep.aquireNormal(a);b[l.MATERIAL_DEPTH]=this._materialRep.aquireDepth(a);b[l.MATERIAL_HIGHLIGHT]=this._materialRep.aquireHighlight(a);return b};a.prototype._releaseMaterials=function(a){if(Array.isArray(a))for(var b=
0;b<a.length;b++)this._materialRep.release(a[b]),this._materialRep.releaseDepthShadowMap(a[b]),this._materialRep.releaseNormal(a[b]),this._materialRep.releaseDepth(a[b]),this._materialRep.releaseHighlight(a[b]);else this._materialRep.release(a),this._materialRep.releaseDepthShadowMap(a),this._materialRep.releaseNormal(a),this._materialRep.releaseDepth(a),this._materialRep.releaseHighlight(a)};a.prototype._getInstance=function(a){var b=a.uniqueName,d=a.material.getId(),e=this._getType(a),d=this._getTargetMat2Data(e)[d];
if(!d)return null;a=d.origin2data[a.origin.id];if(!a)return null;var c;return(c=a.type===C.Preinterleaved?a.instances[b].instance:a.instances[b])?{type:e,uniqueName:b,instance:c,matData:d,originData:a,instancedVAO:null,instancedVAOBaseInstance:null}:null};a.prototype._createBaseInstanceVAO=function(a){var b=this._rctx,d=a.instance,e=a.originData;if(a.type===C.Instanced&&e.perGeometryDataInfo){var e=e.perGeometryDataInfo[d.dataId],c=e.instanceBufferData;c&&(e=e.vao,d=c.getSlot(d.idx),a.instancedVAOBaseInstance!==
d&&(c=J.setBaseInstanceOffset(e.layout,d),a.instancedVAO=new z(b,e.locations,c,e.vertexBuffers,e.indexBuffer),a.instancedVAOBaseInstance=d))}};a.prototype._updateHighlightVAOs=function(){for(var a=0;a<this._highlights.length;++a)this._createBaseInstanceVAO(this._highlights[a])};a.prototype._getFallbackDepthTexture=function(){this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=new p(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:1,height:1},new Uint8Array([255,
255,255,255])));return this._fallbackDepthStencilTexture};return a}();var m=function(){function a(){this.reset()}a.prototype.reset=function(){this.VBOusedSize=this.VBOoptimalSize=this.VBOallocatedSize=this.instancesDrawnAngle=this.drawCallsHighlight=this.drawCallsFragmented=this.drawCallsPreinterleaved=this.drawCallsMerged=this.drawCallsAngleInstanced=this.drawCallsInstanced=this.trianglesRendered=0};return a}(),u=function(){return function(a,b,d,c,g,h,f,m){this.name=a;this.from=b;this.to=d;this.displayedIndexRange=
c;this.transformation=g;this.instanceParameters=h;this.idx=f;this.dataId=m;null!=g&&(this.transformationNormal=e.create(),e.set(g,this.transformationNormal),e.inverse(this.transformationNormal,this.transformationNormal),e.transpose(this.transformationNormal,this.transformationNormal))}}(),C;(function(a){a[a.Merged=0]="Merged";a[a.Instanced=1]="Instanced";a[a.Preinterleaved=2]="Preinterleaved"})(C||(C={}));var M=x.create(),Y=e.identity(),W=e.create(),da=e.create();return D})},"esri/views/3d/webgl-engine/lib/IntervalUtilities":function(){define(["require",
"exports"],function(x,r){return function(){function k(){}k.copyIntervals=function(a){for(var b=[],c=0;c<a.length;c++){var k=a[c];b.push([k[0],k[1]])}return b};k.convertFaceToIndexRange=function(a,b){for(var c=0;c<a.length;c++){var k=a[c];k[0]*=b;k[1]=k[1]*b+(b-1)}};k.sortIntervals=function(a){return a.sort(function(a,c){return a[0]===c[0]?a[1]>c[1]?1:a[1]<c[1]?-1:0:a[0]>c[0]?1:a[0]<c[0]?-1:0})};k.intersectIntervals=function(a,b){if(0>=a.length)return[];for(var c=[],k=0;k<a.length;k++){var n=a[k];
n[1]<b[0]||n[0]>b[1]||(n=[n[0],n[1]],n[0]<b[0]&&(n[0]=b[0]),n[1]>b[1]&&(n[1]=b[1]),c.push(n))}return c};k.mergeIntervals=function(a){if(0>=a.length)return[];var b=[];a=this.sortIntervals(a);b.push(a[0]);for(var c=1;c<a.length;c++){var k=b[b.length-1];k[1]+1<a[c][0]?b.push(a[c]):k[1]<a[c][1]&&(k[1]=a[c][1],b.pop(),b.push(k))}return b};k.invertIntervals=function(a,b){for(var c=[],k=0,n=0;n<a.length;n++){var f=a[n];f[0]>k&&c.push([k,f[0]-1]);k=f[1]+1}k<=b&&c.push([k,b]);return c};k.offsetIntervals=function(a,
b){for(var c=[],k=0;k<a.length;k++){var n=a[k];c.push([n[0]+b,n[1]+b])}return c};return k}()})},"esri/views/3d/webgl-engine/lib/Float32ArrayList":function(){define(["require","exports","./Util"],function(x,r,k){return function(){function a(a){null==a?a=16:65536>a&&(a=k.nextHighestPowerOfTwo(a));this.array=new Float32Array(a);this.size=0}a.prototype.resize=function(a,c){void 0===c&&(c=!1);this.size=a;var b;if(this.size>this.array.length){for(a=this.array.length||1;a<this.size;)a*=2;b=new Float32Array(a);
c&&b.set(this.array);this.array=b;return!0}if(this.size<=this.array.length/2){a=this.array.length;for(b=2*this.size;a>=b;)a=Math.floor(a/2);b=new Float32Array(a);c&&b.set(this.array.subarray(0,a));this.array=b;return!0}return!1};a.prototype.append=function(a){var b=this.size;this.resize(this.size+a.length,!0);this.array.set(a,b)};a.prototype.erase=function(a,c){for(;a<c;++a)this.array[a]=0};a.prototype.getArray=function(){return this.array};a.prototype.getSize=function(){return this.size};return a}()})},
"esri/views/3d/webgl-engine/lib/InstanceBufferData":function(){define(["require","exports","./Util"],function(x,r,k){return function(){function a(a,c){null==c&&(c=4);var b=k.nextHighestPowerOfTwo(c*a);this.array=new Float32Array(b);this.zeroItem=new Float32Array(a);this.endSlot=0;this.perInstanceDataSize=a;this.emptySlots=[];this.emptySlotsIdx=0;this.id2slot={};this.slot2id=Array(c)}a.prototype.prepareFree=function(a){this.emptySlots.length+=a};a.prototype.free=function(a){a=this.id2slot[a];null!=
a&&(this.emptySlots[this.emptySlotsIdx++]=a,this.slot2id[a]=void 0)};a.prototype.prepareAllocate=function(a){a-=this.emptySlotsIdx;0<a&&this._resizeArray((this.endSlot+a)*this.perInstanceDataSize)};a.prototype.allocate=function(a){var b;b=0<this.emptySlotsIdx?this.emptySlots[--this.emptySlotsIdx]:this.endSlot++;this.id2slot[a]=b;this.slot2id[b]=a;return b};a.prototype.getSlot=function(a){return this.id2slot[a]};a.prototype.getOffset=function(a){return a*this.perInstanceDataSize};a.prototype.getArray=
function(){return this.array};a.prototype.fill=function(a,c,k){this.array.set(k,a*this.perInstanceDataSize+c)};a.prototype.compact=function(){if(0<this.emptySlotsIdx){this.emptySlots.length=this.emptySlotsIdx;for(this.emptySlots.sort(function(a,b){return a-b});0<this.emptySlotsIdx&&this.emptySlots[this.emptySlotsIdx-1]===this.endSlot;)this.emptySlotsIdx--,this.endSlot--;for(;0<this.emptySlotsIdx;){this.emptySlotsIdx--;var a=this.endSlot-1,c=this.emptySlots[this.emptySlotsIdx],k=a*this.perInstanceDataSize,
n=c*this.perInstanceDataSize;this.array.set(this.array.subarray(k,k+this.perInstanceDataSize),n);this.array.set(this.zeroItem,k);k=this.slot2id[a];this.slot2id[a]=void 0;this.slot2id[c]=k;this.id2slot[k]=c;this.endSlot--}}this._resizeArray(this.endSlot*this.perInstanceDataSize);this.emptySlots.length=0;return this.array};a.prototype._resizeArray=function(a){var b;if(a>this.array.length){for(b=this.array.length||1;b<a;)b*=2;a=new Float32Array(b);a.set(this.array);this.array=a}else if(a<=this.array.length/
2){b=this.array.length;for(a*=2;b>=a;)b/=2;a=new Float32Array(b);a.set(this.array.subarray(0,b));this.array=a}};return a}()})},"esri/views/3d/webgl-engine/lighting/SceneLighting":function(){define(["require","exports","./SphericalHarmonics","../../lib/glMatrix"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});var b=a.vec3d,c=a.vec4d,t=b.create();x=function(){function a(){this._renderLighting={main:{intensity:b.create(),direction:b.createFrom(1,0,0),castShadows:!1},sphericalHarmonics:{sh:{r:[0],
g:[0],b:[0]}}};this._shOrder=2;this._oldDirection=b.create();this._oldSpecular=c.create();this._oldDiffuse=c.create();this._oldAmbient=c.create()}a.prototype.setUniforms=function(a,b){void 0===b&&(b=!1);b||a.getDefine("GROUND_NORMAL_SHADING")?a.setUniform1f("lightingFixedFactor",(1-this._info.groundLightingFactor)*(1-this._info.globalFactor)):a.setUniform1f("lightingFixedFactor",0);a.setUniform1f("lightingGlobalFactor",this._info.globalFactor);a.setUniform3fv("lightingMainDirection",this._renderLighting.main.direction);
a.setUniform3fv("lightingMainIntensity",this._renderLighting.main.intensity);a.setUniform1f("ambientBoostFactor",.4);b=this._renderLighting.sphericalHarmonics.sh;0===this._shOrder?a.setUniform3f("lightingAmbientSH0",b.r[0],b.g[0],b.b[0]):1===this._shOrder?(a.setUniform4f("lightingAmbientSH_R",b.r[0],b.r[1],b.r[2],b.r[3]),a.setUniform4f("lightingAmbientSH_G",b.g[0],b.g[1],b.g[2],b.g[3]),a.setUniform4f("lightingAmbientSH_B",b.b[0],b.b[1],b.b[2],b.b[3])):2===this._shOrder&&(a.setUniform3f("lightingAmbientSH0",
b.r[0],b.g[0],b.b[0]),a.setUniform4f("lightingAmbientSH_R1",b.r[1],b.r[2],b.r[3],b.r[4]),a.setUniform4f("lightingAmbientSH_G1",b.g[1],b.g[2],b.g[3],b.g[4]),a.setUniform4f("lightingAmbientSH_B1",b.b[1],b.b[2],b.b[3],b.b[4]),a.setUniform4f("lightingAmbientSH_R2",b.r[5],b.r[6],b.r[7],b.r[8]),a.setUniform4f("lightingAmbientSH_G2",b.g[5],b.g[6],b.g[7],b.g[8]),a.setUniform4f("lightingAmbientSH_B2",b.b[5],b.b[6],b.b[7],b.b[8]));a.setUniform3fv("lightDirection",this._oldDirection)};a.prototype.set=function(a){this._info=
a;k.combineLights(a.lights,this._shOrder,this._renderLighting.main,this._renderLighting.sphericalHarmonics);b.negate(this._renderLighting.main.direction,this._oldDirection);a=1/Math.PI;this._oldAmbient[0]=.282095*this._renderLighting.sphericalHarmonics.sh.r[0]*a;this._oldAmbient[1]=.282095*this._renderLighting.sphericalHarmonics.sh.g[0]*a;this._oldAmbient[2]=.282095*this._renderLighting.sphericalHarmonics.sh.b[0]*a;this._oldAmbient[3]=1;this._oldDiffuse[0]=this._renderLighting.main.intensity[0]*a;
this._oldDiffuse[1]=this._renderLighting.main.intensity[1]*a;this._oldDiffuse[2]=this._renderLighting.main.intensity[2]*a;this._oldDiffuse[3]=1;a=b.set(this._oldDiffuse,t);b.scale(a,.4*this._info.globalFactor);b.add(this._oldAmbient,a)};Object.defineProperty(a.prototype,"globalFactor",{get:function(){return this._info.globalFactor},enumerable:!0,configurable:!0});a.prototype.getOld=function(){return{ambient:this._oldAmbient,diffuse:this._oldDiffuse,specular:this._oldSpecular,direction:this._oldDirection,
helper:this}};return a}();r.SceneLighting=x})},"esri/views/3d/webgl-engine/lighting/SphericalHarmonics":function(){define("require exports ./Lightsources ../lib/LongVectorMath ../../lib/glMatrix ../../support/mathUtils".split(" "),function(x,r,k,a,b,c){function t(a){return(a+1)*(a+1)}function n(a){return c.clamp(Math.floor(Math.sqrt(a)-1),0,2)}function f(a,b,c){var f=a[0],l=a[1];a=a[2];c=c||[];c.length=t(b);0<=b&&(c[0]=.28209479177);1<=b&&(c[1]=.4886025119*f,c[2]=.4886025119*a,c[3]=.4886025119*l);
2<=b&&(c[4]=1.09254843059*f*l,c[5]=1.09254843059*l*a,c[6]=.31539156525*(3*a*a-1),c[7]=1.09254843059*f*a,c[8]=.54627421529*(f*f-l*l));return c}function q(a,b){a=t(a);b=b||{r:[],g:[],b:[]};b.r.length=b.g.length=b.b.length=a;for(var c=0;c<a;c++)b.r[c]=b.g[c]=b.b[c]=0;return b}function l(b,c){for(var l=n(c.r.length),k=0;k<b.length;k++){var q=b[k];B.negate(q.direction,p);f(p,l,F);a.elementwiseProduct(F,z);a.scalarProduct(F,q.intensity[0],G);a.add(c.r,G);a.scalarProduct(F,q.intensity[1],G);a.add(c.g,G);
a.scalarProduct(F,q.intensity[2],G);a.add(c.b,G)}return c}function y(a,b){f(p,0,F);for(var c=0;c<a.length;c++){var l=a[c];b.r[0]+=F[0]*z[0]*l.intensity[0]*4*Math.PI;b.g[0]+=F[0]*z[0]*l.intensity[1]*4*Math.PI;b.b[0]+=F[0]*z[0]*l.intensity[2]*4*Math.PI}return b}Object.defineProperty(r,"__esModule",{value:!0});var B=b.vec3d;r.numberOfCoefficients=t;r.numberOfCoefficientsInBand=function(a){return 2*a+1};r.orderFromNumberOfCoefficients=n;r.computeCoefficients=f;r.initSHCoefficients=q;r.projectFillLights=
l;r.projectAmbientLights=y;r.combineLights=function(b,c,f,p){q(c,p.sh);B.set3(0,0,0,f.intensity);var n=!1,t=v,r=w;c=D;t.length=0;r.length=0;for(var z=c.length=0;z<b.length;z++){var A=b[z];A instanceof k.MainLight&&!n?(B.set(A.direction,f.direction),f.intensity[0]=A.intensity[0],f.intensity[1]=A.intensity[1],f.intensity[2]=A.intensity[2],f.castShadows=A.castShadows,n=!0):A instanceof k.MainLight||A instanceof k.FillLight?t.push(A):A instanceof k.AmbientLight?r.push(A):A instanceof k.SphericalHarmonicsLight&&
c.push(A)}l(t,p.sh);y(r,p.sh);for(b=0;b<c.length;b++)A=c[b],a.add(p.sh.r,A.sh.r),a.add(p.sh.g,A.sh.g),a.add(p.sh.b,A.sh.b)};var v=[],w=[],D=[],F=[0],G=[0],p=B.create(),z=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398]})},"esri/views/3d/webgl-engine/lib/LongVectorMath":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.dotProduct=function(k,a){for(var b=0,c=0;c<k.length;c++)b+=k[c]*a[c];return b};r.elementwiseProduct=
function(k,a,b){b=b||k;b.length=k.length;for(var c=0;c<k.length;c++)b[c]=k[c]*a[c];return b};r.scalarProduct=function(k,a,b){b=b||k;b.length=k.length;for(var c=0;c<k.length;c++)b[c]=k[c]*a;return b};r.add=function(k,a,b){b=b||k;b.length=k.length;for(var c=0;c<k.length;c++)b[c]=k[c]+a[c];return b}})},"esri/views/3d/webgl-engine/lib/LinearDepthTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject","../../../webgl/enums"],function(x,r,k,a,b){return function(){function b(a){this._rctx=
a;this._depthFBO=void 0;this.height=this.width=this.viewportToRestore=null}b.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};b.prototype.getEnableState=function(){return void 0!==this._depthFBO};b.prototype.getDepthFBO=function(){return this._depthFBO};b.prototype.enable=function(){k.assert(!this.getEnableState());this._depthFBO=a.createWithAttachments(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:0,
height:0},{colorTarget:0,depthStencilTarget:3})};b.prototype.disable=function(){k.assert(this.getEnableState());this._depthFBO.dispose();this._depthFBO=void 0};b.prototype.setupFBOs=function(a){k.assert(this.getEnableState());this.viewportToRestore=a=a.fullViewport;this.width=a[2];this.height=a[3];this._rctx.setViewport(0,0,this.width,this.height)};b.prototype.prepareDepthPass=function(){k.assert(this.getEnableState());var a=this._rctx,b=a.gl;this._depthFBO.resize(this.width,this.height);a.bindFramebuffer(this._depthFBO);
a.setClearStencil(0);a.setClearColor(0,0,0,0);a.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT|b.STENCIL_BUFFER_BIT);a.setBlendingEnabled(!1)};b.prototype.finish=function(a){var b=this._rctx;b.bindFramebuffer(a);b.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],this.viewportToRestore[3])};return b}()})},"esri/views/3d/webgl-engine/lib/NormalTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject","../../../webgl/enums"],
function(x,r,k,a,b){return function(){function b(a){this.rctx=a;this.normalFBO=void 0;this.height=this.width=this.viewportToRestore=null}b.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};b.prototype.getEnableState=function(){return void 0!==this.normalFBO};b.prototype.getNormalFBO=function(){return this.normalFBO};b.prototype.enable=function(){k.assert(!this.getEnableState());this.normalFBO=a.createWithAttachments(this.rctx,{target:3553,pixelFormat:6408,
dataType:5121,samplingMode:9728,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:1})};b.prototype.disable=function(){k.assert(this.getEnableState());this.normalFBO.dispose();this.normalFBO=void 0};b.prototype.setupFBOs=function(a){k.assert(this.getEnableState());this.viewportToRestore=a=a.viewport;this.width=a[2];this.height=a[3];this.rctx.setViewport(0,0,this.width,this.height)};b.prototype.prepareNormalPass=function(){k.assert(this.getEnableState());var a=this.rctx,b=a.gl;this.normalFBO.resize(this.width,
this.height);a.bindFramebuffer(this.normalFBO);a.setClearColor(0,0,0,0);a.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};b.prototype.finish=function(a){var b=this.rctx;b.bindFramebuffer(a);b.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],this.viewportToRestore[3])};return b}()})},"esri/views/3d/webgl-engine/lib/HighlightTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject","../../../webgl/enums"],function(x,r,k,
a,b){return function(){function b(a){this._rctx=a;this.height=this.width=this.viewportToRestore=this.fbo2=this.fbo=null}b.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};b.prototype.getEnableState=function(){return null!==this.fbo};b.prototype.getHighlightFBO=function(){return this.fbo};b.prototype.getBlurFBO=function(){return this.fbo2};b.prototype.enable=function(){k.assert(!this.getEnableState());this.fbo=a.createWithAttachments(this._rctx,{target:3553,
pixelFormat:6408,dataType:32819,samplingMode:9729,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:1})};b.prototype.disable=function(){k.assert(this.getEnableState());this.fbo.dispose();this.fbo=null};b.prototype.setupFBOs=function(a){k.assert(this.getEnableState());this.viewportToRestore=a=a.fullViewport;this.width=a[2];this.height=a[3];this._rctx.setViewport(0,0,this.width,this.height)};b.prototype.prepareHighlightPass=function(){k.assert(this.getEnableState());var a=this._rctx,
b=a.gl;this.fbo.resize(this.width,this.height);a.bindFramebuffer(this.fbo);a.setClearColor(0,0,0,0);a.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};b.prototype.finish=function(a){var b=this._rctx;b.bindFramebuffer(a);b.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],this.viewportToRestore[3])};return b}()})},"esri/views/3d/webgl-engine/lib/RenderContext":function(){define(["require","exports","./RenderSlot","./RenderPass"],function(x,r,k,a){return function(){function b(){this.normals=
this.lightingData=this.highlight=this.depth=this.camera=null;this.pass=a.MATERIAL;this.shadowMap=null;this.slot=k.BACKGROUND;this.options=this.rctx=this.framebufferTex=this.stencilRenderingHelper=this.offscreenRenderingHelper=this.ssaoHelper=null;this.renderOccludedOnly=!1}Object.defineProperty(b.prototype,"isHighlightPass",{get:function(){return this.pass===a.MATERIAL_HIGHLIGHT},enumerable:!0,configurable:!0});return b}()})},"esri/views/3d/webgl-engine/lib/ExternalRendererContainer":function(){define(["require",
"exports","./RenderSlot"],function(x,r,k){return function(){function a(){this.renderersChanged=!1;this.renderers=[];this.slots=[];for(var a=0;a<k.MAX_SLOTS;++a)this.slots[a]=[]}a.prototype.addRenderer=function(a,c){this.renderers.push(c);for(var b=0;b<a.length;++b)this.slots[a[b]].push(c);this.renderersChanged=!0};a.prototype.removeRenderer=function(a){this.renderers=this.renderers.filter(function(b){return b!==a});for(var b=0;b<this.slots.length;++b)this.slots[b]=this.slots[b].filter(function(b){return b!==
a});this.renderersChanged=!0};a.prototype.render=function(a,c){c.slot=a;var b=0;for(a=this.slots[a];b<a.length;b++){var n=a[b];n.render(c)&&(n.didRender=!0)}};a.prototype.needsRender=function(){if(this.renderersChanged)return!0;for(var a=0,c=this.renderers;a<c.length;a++)if(c[a].needsRender)return!0;return!1};a.prototype.needsHighlight=function(){for(var a=0,c=this.renderers;a<c.length;a++)if(c[a].needsHighlight)return!0;return!1};a.prototype.needsLinearDepth=function(){for(var a=0,c=this.renderers;a<
c.length;a++)if(c[a].needsLinearDepth)return!0;return!1};a.prototype.resetNeedsRender=function(){this.renderersChanged=!1;for(var a=0,c=this.renderers;a<c.length;a++){var k=c[a];k.resetNeedsRender?k.resetNeedsRender():k.didRender&&(k.needsRender=!1,k.didRender=!1)}};return a}()})},"esri/views/3d/webgl-engine/lib/StencilRenderingHelper":function(){define(["require","exports","./Util","../../../webgl/enums"],function(x,r,k,a){return function(){function a(a){this._enabled=!1;this._rctx=a}a.prototype.enable=
function(){this._enabled=!0;this._rctx.setStencilTestEnabled(!0)};a.prototype.disable=function(){this._enabled=!1;this._rctx.setStencilTestEnabled(!1)};a.prototype.getIsSupported=function(){return!!this._rctx.contextAttributes.stencil};a.prototype.setEnableState=function(a){a?this.enable():this.disable()};a.prototype.getEnableState=function(){return this._enabled};a.prototype.prepareStencilWritePass=function(){k.assert(this.getEnableState());var a=this._rctx;a.setStencilFunction(519,1,255);a.setStencilOp(7680,
7680,7681);a.setStencilWriteMask(255)};a.prototype.finish=function(){if(this.getEnableState()){var a=this._rctx;a.setStencilFunction(519,0,0);a.setStencilOp(7680,7680,7680)}};a.prototype.enableStencilRead=function(){this.getEnableState()&&this._rctx.setStencilFunction(517,1,255)};a.prototype.disableStencilRead=function(){this.getEnableState()&&this._rctx.setStencilFunction(519,0,0)};return a}()})},"esri/views/3d/webgl-engine/lib/FxaaRenderPass":function(){define("require exports ../../../webgl/Program ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/enums".split(" "),
function(x,r,k,a,b,c){return function(){function c(a){this.isEnabled=!1;this.vertexAttributeLocations={position:0};this.vertexBufferLayout=[{name:"position",count:2,type:5126,offset:0,stride:8,normalized:!1}];this.rctx=a}c.prototype.enable=function(){if(!this.isEnabled){var c=this.rctx;this.program=new k(c,"\n #version 100\n precision highp float;\n\n attribute vec2 position;\n\n varying vec2 fCoordinate;\n\n void main() {\n fCoordinate \x3d (position + 1.0 ) * 0.5;\n gl_Position \x3d vec4(position, -1, 1);\n }",
"\n #version 100\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n /**\n * @license\n * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.\n *\n * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED\n * *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS\n * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA\n * OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS\n * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY\n * OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,\n * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n */\n\n #define FXAA_EDGE_THRESHOLD (1.0/8.0)\n #define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n #define FXAA_SEARCH_STEPS 16\n #define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n #define FXAA_SUBPIX_CAP (3.0/4.0)\n #define FXAA_SUBPIX_TRIM (1.0/4.0)\n #define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\n\n uniform vec2 uRcpFrameDimension;\n uniform sampler2D uColorTexture;\n varying vec2 fCoordinate;\n\n // Return the luma, the estimation of luminance from rgb inputs.\n // This approximates luma using one FMA instruction,\n // skipping normalization and tossing out blue.\n // FxaaLuma() will range 0.0 to 2.963210702.\n float FxaaLuma(vec3 rgb) {\n return rgb.y * (0.587 / 0.299) + rgb.x;\n }\n vec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\n return (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n }\n vec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\n float x \x3d pos.x + float(off.x) * rcpFrame.x;\n float y \x3d pos.y + float(off.y) * rcpFrame.y;\n return texture2D(tex, vec2(x, y));\n }\n\n // pos is the output of FxaaVertexShader interpolated across screen.\n // xy -\x3e actual texture position {0.0 to 1.0}\n // rcpFrame should be a uniform equal to {1.0/frameWidth, 1.0/frameHeight}\n vec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame) {\n vec3 rgbN \x3d FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\n vec3 rgbW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\n vec3 rgbM \x3d FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\n vec3 rgbE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\n vec3 rgbS \x3d FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\n float lumaN \x3d FxaaLuma(rgbN);\n float lumaW \x3d FxaaLuma(rgbW);\n float lumaM \x3d FxaaLuma(rgbM);\n float lumaE \x3d FxaaLuma(rgbE);\n float lumaS \x3d FxaaLuma(rgbS);\n float rangeMin \x3d min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\n float rangeMax \x3d max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\n float range \x3d rangeMax - rangeMin;\n if (range \x3c max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD)) {\n return rgbM;\n }\n vec3 rgbL \x3d rgbN + rgbW + rgbM + rgbE + rgbS;\n float lumaL \x3d (lumaN + lumaW + lumaE + lumaS) * 0.25;\n float rangeL \x3d abs(lumaL - lumaM);\n float blendL \x3d max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\n blendL \x3d min(FXAA_SUBPIX_CAP, blendL);\n vec3 rgbNW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\n vec3 rgbNE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\n vec3 rgbSW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\n vec3 rgbSE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\n rgbL +\x3d (rgbNW + rgbNE + rgbSW + rgbSE);\n rgbL *\x3d vec3(1.0/9.0);\n float lumaNW \x3d FxaaLuma(rgbNW);\n float lumaNE \x3d FxaaLuma(rgbNE);\n float lumaSW \x3d FxaaLuma(rgbSW);\n float lumaSE \x3d FxaaLuma(rgbSE);\n float edgeVert \x3d\n abs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\n abs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\n abs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\n float edgeHorz \x3d\n abs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\n abs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\n abs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\n bool horzSpan \x3d edgeHorz \x3e\x3d edgeVert;\n float lengthSign \x3d horzSpan ? -rcpFrame.y : -rcpFrame.x;\n if(!horzSpan) {\n lumaN \x3d lumaW;\n lumaS \x3d lumaE;\n }\n float gradientN \x3d abs(lumaN - lumaM);\n float gradientS \x3d abs(lumaS - lumaM);\n lumaN \x3d (lumaN + lumaM) * 0.5;\n lumaS \x3d (lumaS + lumaM) * 0.5;\n if (gradientN \x3c gradientS)\n {\n lumaN \x3d lumaS;\n lumaN \x3d lumaS;\n gradientN \x3d gradientS;\n lengthSign *\x3d -1.0;\n }\n vec2 posN;\n posN.x \x3d pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\n posN.y \x3d pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\n gradientN *\x3d FXAA_SEARCH_THRESHOLD;\n vec2 posP \x3d posN;\n vec2 offNP \x3d horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\n float lumaEndN \x3d lumaN;\n float lumaEndP \x3d lumaN;\n bool doneN \x3d false;\n bool doneP \x3d false;\n posN +\x3d offNP * vec2(-1.0, -1.0);\n posP +\x3d offNP * vec2( 1.0, 1.0);\n for(int i \x3d 0; i \x3c FXAA_SEARCH_STEPS; i++) {\n if(!doneN) {\n lumaEndN \x3d FxaaLuma(texture2D(tex, posN.xy).xyz);\n }\n if(!doneP) {\n lumaEndP \x3d FxaaLuma(texture2D(tex, posP.xy).xyz);\n }\n doneN \x3d doneN || (abs(lumaEndN - lumaN) \x3e\x3d gradientN);\n doneP \x3d doneP || (abs(lumaEndP - lumaN) \x3e\x3d gradientN);\n if(doneN \x26\x26 doneP) { break; }\n if(!doneN) {\n posN -\x3d offNP;\n }\n if(!doneP) {\n posP +\x3d offNP;\n }\n }\n float dstN \x3d horzSpan ? pos.x - posN.x : pos.y - posN.y;\n float dstP \x3d horzSpan ? posP.x - pos.x : posP.y - pos.y;\n bool directionN \x3d dstN \x3c dstP;\n lumaEndN \x3d directionN ? lumaEndN : lumaEndP;\n if(((lumaM - lumaN) \x3c 0.0) \x3d\x3d ((lumaEndN - lumaN) \x3c 0.0)) {\n lengthSign \x3d 0.0;\n }\n float spanLength \x3d (dstP + dstN);\n dstN \x3d directionN ? dstN : dstP;\n float subPixelOffset \x3d (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\n vec3 rgbF \x3d texture2D(tex, vec2(\n pos.x + (horzSpan ? 0.0 : subPixelOffset),\n pos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\n return FxaaLerp3(rgbL, rgbF, blendL);\n }\n\n void main() {\n vec4 color;\n vec2 screenCoord \x3d fCoordinate;\n // if (screenCoord.x \x3c 0.5) {\n color.rgb \x3d FxaaPixelShader(screenCoord, uColorTexture, uRcpFrameDimension);\n // } else if (screenCoord.x \x3c 0.501 \x26\x26 screenCoord.x \x3e 0.499) {\n // color.rgb \x3d vec3(1,0,0);\n // } else {\n // color \x3d texture2D(uColorTexture, fCoordinate);\n // }\n color.a \x3d 1.0;\n gl_FragColor \x3d color;\n }",
this.vertexAttributeLocations);var f=new Float32Array([-1,-1,3,-1,-1,3]);this.vao=new a(c,this.vertexAttributeLocations,{geometry:this.vertexBufferLayout},{geometry:new b(c,34962,35044,f)});this.isEnabled=!0}};c.prototype.disable=function(){this.isEnabled&&(this.program.dispose(),this.program=null,this.vao.dispose(),this.vao=null,this.isEnabled=!1)};c.prototype.render=function(a,b){this.enable();var c=this.rctx;c.bindVAO(this.vao);c.bindFramebuffer(b);var f=0,n=0;null!=b?(f=b.descriptor.width,n=b.descriptor.height):
(f=c.gl.canvas.width,n=c.gl.canvas.height);c.bindProgram(this.program);c.bindTexture(a.colorTexture,0);this.program.setUniform1i("uColorTexture",0);this.program.setUniform2f("uRcpFrameDimension",1/f,1/n);c.setFaceCullingEnabled(!1);c.drawArrays(4,0,3)};return c}()})},"esri/views/3d/webgl-engine/lib/SmaaRenderPass":function(){define("require exports ../../../webgl/Program ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Texture ../../../webgl/FramebufferObject ../../support/imageUtils ../../../webgl/enums".split(" "),
function(x,r,k,a,b,c,t,n,f){var q=null;return function(){function f(a){this.isEnabled=!1;this.vertexAttributeLocations={vPosition:0};this.vertexBufferLayout=[{name:"vPosition",count:2,type:5126,offset:0,stride:8,normalized:!1}];this.rctx=a}f.prototype.ensureEnabled=function(){if(this.isEnabled)return!0;if(!q)return x(["./SmaaRenderPassData"],function(a){q=a}),!1;var c=this.rctx;this.programEdgeDetect=new k(c,q.edgeDetectShader.vertex,q.edgeDetectShader.fragment,this.vertexAttributeLocations);this.programBlendWeights=
new k(c,q.blendWeightShader.vertex,q.blendWeightShader.fragment,this.vertexAttributeLocations);this.programBlur=new k(c,q.blurShader.vertex,q.blurShader.fragment,this.vertexAttributeLocations);var f=new Float32Array([-1,-1,3,-1,-1,3]);this.vao=new a(c,this.vertexAttributeLocations,{geometry:this.vertexBufferLayout},{geometry:new b(c,34962,35044,f)});this.tmpFramebufferEdges=t.createWithAttachments(this.rctx,{target:3553,pixelFormat:6407,dataType:5121,samplingMode:9729,wrapMode:33071,width:4,height:4},
{colorTarget:0,depthStencilTarget:0});this.tmpFramebufferBlend=t.createWithAttachments(this.rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:4,height:4},{colorTarget:0,depthStencilTarget:0});this.textureArea=this.loadTextureFromBase64(q.areaTexture,9729,6407);this.textureSearch=this.loadTextureFromBase64(q.searchTexure,9728,6409);return this.isEnabled=!0};f.prototype.disable=function(){this.isEnabled&&(this.programEdgeDetect.dispose(),this.programEdgeDetect=
null,this.programBlendWeights.dispose(),this.programBlendWeights=null,this.programBlur.dispose(),this.programBlur=null,this.vao.dispose(),this.vao=null,this.textureArea.dispose(),this.textureArea=null,this.textureSearch.dispose(),this.textureSearch=null,this.tmpFramebufferBlend.dispose(),this.tmpFramebufferBlend=null,this.tmpFramebufferEdges.dispose(),this.tmpFramebufferEdges=null,this.isEnabled=!1)};f.prototype.render=function(a,b){this.ensureEnabled();var c=this.rctx,f=0,l=0;null!=b?(f=b.descriptor.width,
l=b.descriptor.height):(f=c.gl.canvas.width,l=c.gl.canvas.height);c.bindVAO(this.vao);c.setFaceCullingEnabled(!0);c.setCullFace(1029);c.setFrontFace(2305);c.setBlendingEnabled(!1);c.setDepthTestEnabled(!1);c.setViewport(0,0,f,l);this.tmpFramebufferEdges.resize(f,l);c.bindFramebuffer(this.tmpFramebufferEdges);c.setClearColor(0,0,0,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programEdgeDetect);c.bindTexture(a.colorTexture,0);this.programEdgeDetect.setUniform1i("tColor",0);this.programEdgeDetect.setUniform4f("uResolution",
1/f,1/l,f,l);c.drawArrays(4,0,3);this.tmpFramebufferBlend.resize(f,l);c.bindFramebuffer(this.tmpFramebufferBlend);c.setClearColor(0,0,1,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programBlendWeights);this.programBlendWeights.setUniform4f("uResolution",1/f,1/l,f,l);c.bindTexture(this.textureSearch,1);this.programBlendWeights.setUniform1i("tSearch",1);c.bindTexture(this.textureArea,2);this.programBlendWeights.setUniform1i("tArea",2);c.bindTexture(this.tmpFramebufferEdges.colorTexture,3);this.programBlendWeights.setUniform1i("tEdges",
3);c.drawArrays(4,0,3);c.bindFramebuffer(b);c.setClearColor(0,1,0,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programBlur);this.programBlur.setUniform4f("uResolution",1/f,1/l,f,l);c.bindTexture(a.colorTexture,0);this.programBlur.setUniform1i("tColor",0);c.bindTexture(this.tmpFramebufferBlend.colorTexture,1);this.programBlur.setUniform1i("tBlendWeights",1);c.drawArrays(4,0,3);c.setDepthTestEnabled(!0)};f.prototype.loadTextureFromBase64=function(a,b,f){var l=new c(this.rctx,{pixelFormat:f,
dataType:5121,wrapMode:33071,samplingMode:b},null);n.dataUriToImage(a).then(function(a){l.resize(a.width,a.height);l.setData(a)});return l};return f}()})},"esri/views/3d/support/imageUtils":function(){define(["require","exports","dojo/Deferred","../../../core/urlUtils","../../../request"],function(x,r,k,a,b){function c(a){var b=!1,c=new Image,q=new k(function(){b=!0;c.src=""}),l=function(){b||q.reject()};c.onload=function(){b||q.resolve(c)};c.onerror=l;c.onabort=l;c.src=a;return q.promise}Object.defineProperty(r,
"__esModule",{value:!0});r.dataURItoBlob=function(a){var b=atob(a.split(",")[1]);a=a.split(",")[0].split(":")[1].split(";")[0];for(var c=new ArrayBuffer(b.length),k=new Uint8Array(c),l=0;l<b.length;l++)k[l]=b.charCodeAt(l);return new Blob([c],{type:a})};r.dataUriToImage=c;r.requestImage=function(k){return a.isDataProtocol(k)?c(k):b(k,{responseType:"image",allowImageDataAccess:!0}).then(function(a){return a.data})}})},"esri/views/webgl/Profiling":function(){define(["require","exports"],function(x,
r){Object.defineProperty(r,"__esModule",{value:!0});r.startMeasurement=function(a){if(!a.extensions.disjointTimerQuery)return null;var b=new k;b.start(a);return b};var k=function(){function a(){}a.prototype.start=function(a){this._rctx=a;a=a.extensions.disjointTimerQuery;this._query=a.createQueryEXT();a.beginQueryEXT(a.TIME_ELAPSED_EXT,this._query)};a.prototype.stop=function(a,c){void 0===c&&(c=50);this._cb=a;this._checkInterval=c;a=this._rctx.extensions.disjointTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT);
this._checkQueryResult()};a.prototype._checkQueryResult=function(){var a=this._rctx.extensions.disjointTimerQuery,c=a.getQueryObjectEXT(this._query,a.QUERY_RESULT_AVAILABLE_EXT),k=this._rctx.gl.getParameter(a.GPU_DISJOINT_EXT);c&&!k?(a=a.getQueryObjectEXT(this._query,a.QUERY_RESULT_EXT),this._cb(a/1E6)):k?this._cb(null):setTimeout(this._checkQueryResult.bind(this),this._checkInterval)};return a}()})},"esri/views/3d/webgl-engine/materials/HUDMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./HUDMaterial.xml ./internal/MaterialUtil ../lib/Util ../../../webgl/Util ./internal/MaterialBase ./internal/GLMaterialTextureBase ../lib/gl-matrix ../lib/RenderSlot ../lib/RenderPass ../lib/ShaderVariations ../lib/ComponentUtils ../../support/aaBoundingRect ../lib/screenSizePerspectiveUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D){function F(a,b){void 0===b&&(b=U);if(a.textureIsSignedDistanceField){var d=a.anchorPos;a=a.distanceFieldBoundingBox;var e=b;e[0]=d[0]*(a[2]-a[0])+a[0];e[1]=d[1]*(a[3]-a[1])+a[1]}else G.set(a.anchorPos,b);return b}var G=q.vec2d,p=q.vec3d,z=q.mat3d,A=q.mat4d,J={"bottom-left":[0,0],bottom:[.5,0],"bottom-right":[1,0],left:[0,.5],center:[.5,.5],right:[1,.5],"top-left":[0,1],top:[.5,1],"top-right":[1,1]},I=[{name:"position",count:3,type:5126,offset:0,stride:76,
normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:76,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:76,normalized:!1},{name:"color",count:4,type:5121,offset:32,stride:76,normalized:!1},{name:"size",count:2,type:5126,offset:36,stride:76,normalized:!1},{name:"auxpos1",count:4,type:5126,offset:44,stride:76,normalized:!1},{name:"auxpos2",count:4,type:5126,offset:60,stride:76,normalized:!1}],K={texCoordScale:[1,1],occlusionTest:!0,binaryHighlightOcclusion:!0,drawInSecondSlot:!1,
color:[1,1,1,1],outlineColor:[1,1,1,1],outlineSize:0,textureIsSignedDistanceField:!1,distanceFieldBoundingBox:null,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],screenOffset:[0,0],verticalOffset:null,screenSizePerspective:null,screenSizePerspectiveAlignment:null,anchorPos:J.center,shaderPolygonOffset:1E-5,polygonOffset:!1,
textureId:null,centerOffsetUnits:"world",debugDrawBorder:!1};x=function(f){function l(a,d){d=f.call(this,d)||this;d._textureDirty=!1;d.params=b.copyParameters(a,K);"string"===typeof d.params.anchorPos&&(d.params.anchorPos=J[d.params.anchorPos]);return d}k(l,f);l.prototype.dispose=function(){};l.prototype.getParameterValues=function(){var a=this.params;return{color:a.color,texCoordScale:a.texCoordScale,polygonOffset:a.polygonOffset,anchorPos:a.anchorPos,screenOffset:a.screenOffset,verticalOffset:a.verticalOffset,
screenSizePerspective:a.screenSizePerspective,screenSizePerspectiveAlignment:a.screenSizePerspectiveAlignment,shaderPolygonOffset:a.shaderPolygonOffset,textureIsSignedDistanceField:a.textureIsSignedDistanceField,outlineColor:a.outlineColor,outlineSize:a.outlineSize,distanceFieldBoundingBox:a.distanceFieldBoundingBox,vvSizeEnabled:a.vvSizeEnabled,vvSizeMinSize:a.vvSizeMinSize,vvSizeMaxSize:a.vvSizeMaxSize,vvSizeOffset:a.vvSizeOffset,vvSizeFactor:a.vvSizeFactor,vvColorEnabled:a.vvColorEnabled,vvColorValues:a.vvColorValues,
vvColorColors:a.vvColorColors,textureId:a.textureId,occlusionTest:a.occlusionTest,binaryHighlightOcclusion:a.binaryHighlightOcclusion,centerOffsetUnits:a.centerOffsetUnits,debugDrawBorder:a.debugDrawBorder,drawInSecondSlot:a.drawInSecondSlot}};l.prototype.setParameterValues=function(a){for(var b in a)"textureId"===b&&c.assert(!!this.params.textureId,"Can only change texture of material that already has a texture"),this.params[b]=a[b];this.notifyDirty("matChanged")};l.prototype.getParams=function(){return this.params};
l.prototype.getOutputAmount=function(a){return 114*a};l.prototype.getInstanceBufferLayout=function(){};l.prototype.getVertexBufferLayout=function(){return I};l.prototype.fillInterleaved=function(a,d,e,g,h,f){var m=4*f,l=a.indices[c.VertexAttrConstants.POSITION],p=a.vertexAttr[c.VertexAttrConstants.POSITION].data,n=f+t.findAttribute(I,c.VertexAttrConstants.POSITION).offset/4;for(g=0;g<l.length;++g){var k=3*l[g];b.fill(p,k,h,n,d,3);n+=19;b.fill(p,k,h,n,d,3);n+=19;b.fill(p,k,h,n,d,3);n+=19;b.fill(p,
k,h,n,d,3);n+=19;b.fill(p,k,h,n,d,3);n+=19;b.fill(p,k,h,n,d,3);n+=19}d=a.indices[c.VertexAttrConstants.NORMAL];p=a.vertexAttr[c.VertexAttrConstants.NORMAL].data;n=f+t.findAttribute(I,c.VertexAttrConstants.NORMAL).offset/4;for(g=0;g<d.length;++g)k=3*d[g],b.fill(p,k,h,n,e,3),n+=19,b.fill(p,k,h,n,e,3),n+=19,b.fill(p,k,h,n,e,3),n+=19,b.fill(p,k,h,n,e,3),n+=19,b.fill(p,k,h,n,e,3),n+=19,b.fill(p,k,h,n,e,3),n+=19;g=a.vertexAttr[c.VertexAttrConstants.UV0].data;null==g||3>=g.length?(e=k=0,d=this.params.texCoordScale[0],
p=this.params.texCoordScale[1]):(k=a.vertexAttr[c.VertexAttrConstants.UV0].data[0],e=a.vertexAttr[c.VertexAttrConstants.UV0].data[1],d=a.vertexAttr[c.VertexAttrConstants.UV0].data[2],p=a.vertexAttr[c.VertexAttrConstants.UV0].data[3]);d=Math.min(1.99999,d+1);p=Math.min(1.99999,p+1);n=f+t.findAttribute(I,c.VertexAttrConstants.UV0).offset/4;for(g=0;g<l.length;++g)h[n]=k,h[n+1]=e,n+=19,h[n]=d,h[n+1]=e,n+=19,h[n]=d,h[n+1]=p,n+=19,h[n]=d,h[n+1]=p,n+=19,h[n]=k,h[n+1]=p,n+=19,h[n]=k,h[n+1]=e,n+=19;l=a.indices[c.VertexAttrConstants.COLOR];
e=a.vertexAttr[c.VertexAttrConstants.COLOR].data;m+=t.findAttribute(I,c.VertexAttrConstants.COLOR).offset;d=new Uint8Array(h.buffer);for(g=0;g<l.length;++g)k=4*l[g],b.fill(e,k,d,m,null,4),m+=76,b.fill(e,k,d,m,null,4),m+=76,b.fill(e,k,d,m,null,4),m+=76,b.fill(e,k,d,m,null,4),m+=76,b.fill(e,k,d,m,null,4),m+=76,b.fill(e,k,d,m,null,4),m+=76;k=a.indices[c.VertexAttrConstants.SIZE];m=a.vertexAttr[c.VertexAttrConstants.SIZE].data;l=f+t.findAttribute(I,c.VertexAttrConstants.SIZE).offset/4;for(g=0;g<k.length;++g)e=
m[2*k[g]],d=m[2*k[g]+1],h[l]=e,h[l+1]=d,l+=19,h[l]=e,h[l+1]=d,l+=19,h[l]=e,h[l+1]=d,l+=19,h[l]=e,h[l+1]=d,l+=19,h[l]=e,h[l+1]=d,l+=19,h[l]=e,h[l+1]=d,l+=19;if(null!=a.indices[c.VertexAttrConstants.AUXPOS1]&&null!=a.vertexAttr[c.VertexAttrConstants.AUXPOS1])for(m=a.indices[c.VertexAttrConstants.AUXPOS1],l=a.vertexAttr[c.VertexAttrConstants.AUXPOS1].data,e=f+t.findAttribute(I,"auxpos1").offset/4,g=0;g<m.length;++g)k=4*m[g],b.fill(l,k,h,e,null,4),e+=19,b.fill(l,k,h,e,null,4),e+=19,b.fill(l,k,h,e,null,
4),e+=19,b.fill(l,k,h,e,null,4),e+=19,b.fill(l,k,h,e,null,4),e+=19,b.fill(l,k,h,e,null,4),e+=19;if(null!=a.indices[c.VertexAttrConstants.AUXPOS2]&&null!=a.vertexAttr[c.VertexAttrConstants.AUXPOS2])for(m=a.indices[c.VertexAttrConstants.AUXPOS2],a=a.vertexAttr[c.VertexAttrConstants.AUXPOS2].data,f+=t.findAttribute(I,"auxpos2").offset/4,g=0;g<m.length;++g)k=4*m[g],b.fill(a,k,h,f,null,4),f+=19,b.fill(a,k,h,f,null,4),f+=19,b.fill(a,k,h,f,null,4),f+=19,b.fill(a,k,h,f,null,4),f+=19,b.fill(a,k,h,f,null,4),
f+=19,b.fill(a,k,h,f,null,4),f+=19};l.prototype.intersect=function(a,b,f,m,l,n,k,q){if(m.isSelection&&m.enableHUDSelection&&!v.isAllHidden(b.componentVisibilities,a.data.componentOffsets)){var t=a.getData();a=this.params;l=b=1;A.toMat3(f,h);if(q){l=q(e);b=l[0];l=l[5];q=h;n=q[0];var y=q[1],u=q[2],w=q[3],r=q[4],z=q[5],B=q[6],C=q[7],G=q[8],L=1/Math.sqrt(n*n+y*y+u*u),I=1/Math.sqrt(w*w+r*r+z*z),K=1/Math.sqrt(B*B+C*C+G*G);q[0]=n*L;q[1]=y*L;q[2]=u*L;q[3]=w*I;q[4]=r*I;q[5]=z*I;q[6]=B*K;q[7]=C*K;q[8]=G*K}q=
t.getVertexAttr()[c.VertexAttrConstants.POSITION];n=t.getVertexAttr()[c.VertexAttrConstants.SIZE];t=t.getVertexAttr()[c.VertexAttrConstants.NORMAL];c.assert(3<=q.size);y=m.point;u=m.camera;w=F(a);for(r=0;r<q.data.length/q.size;r++)z=r*q.size,p.set3(q.data[z],q.data[z+1],q.data[z+2],N),A.multiplyVec3(f,N,N),z=r*n.size,g[0]=n.data[z]*b,g[1]=n.data[z+1]*l,A.multiplyVec3(u.viewMatrix,N),z=r*t.size,p.set3(t.data[z],t.data[z+1],t.data[z+2],R),this.applyVerticalOffsetTransformation(N,R,h,u,P),u.applyProjection(N,
S),-1<S[0]&&(z=Math.floor(S[0]),C=Math.floor(S[1]),D.applyPrecomputedScaleFactorVec2(g,P.factor,g),z=z-d-(0<w[0]?g[0]*w[0]:0),B=z+g[0]+2*d,C=C-d-(0<w[1]?g[1]*w[1]:0),G=C+g[1]+2*d,a.textureIsSignedDistanceField&&(L=a.outlineSize/2,I=a.distanceFieldBoundingBox,z+=g[0]*I[0],C+=g[1]*I[1],B-=g[0]*(1-I[2]),G-=g[1]*(1-I[3]),z-=L,B+=L,C-=L,G+=L),y[0]>z&&y[0]<B&&y[1]>C&&y[1]<G&&(B=m.p0,C=m.p1,A.multiplyVec3(A.inverse(u.viewMatrix,ca),N,V),S[0]=y[0],S[1]=y[1],u.unprojectPoint(S,N),z=p.negate(m.getDirection(),
p.create()),B=p.dist(B,N)/p.dist(B,C),k(B,z,-1,1,!0,V)))}};l.prototype.normalAndViewAngle=function(a,b,d,e){void 0===e&&(e=Q);z.multiplyVec3(b,a,e.normal);A.multiplyVec3(d.viewInverseTransposeMatrix,e.normal);e.cosAngle=p.dot(T,m);return e};l.prototype.updateScaleInfo=function(a,b,d){b=this.params;b.screenSizePerspective?a.factor=D.precomputeScaleFactor(Q.cosAngle,d,b.screenSizePerspective,a.factor):(a.factor.scale=1,a.factor.factor=0,a.factor.minPixelSize=0,a.factor.paddingPixels=0);b.screenSizePerspectiveAlignment?
(a.scaleAlignment=D.precomputeScale(Q.cosAngle,d,b.screenSizePerspectiveAlignment),a.minPixelSizeAlignment=b.screenSizePerspectiveAlignment.parameters.minPixelSize):(a.scaleAlignment=a.factor.scale,a.minPixelSizeAlignment=a.factor.minPixelSize)};l.prototype.applyVerticalOffsetTransformation=function(a,d,e,c,g,f){var m=this.params;16===e.length&&(e=A.toMat3(e,h));if(!m.verticalOffset||!m.verticalOffset.screenLength)return g&&(m.screenSizePerspective||m.screenSizePerspectiveAlignment)?(c=this.normalAndViewAngle(d,
e,c),m=p.length(a),this.updateScaleInfo(g,c.cosAngle,m)):g&&(g.factor.scale=1,g.scaleAlignment=1),f?p.set(a,f):a;d=this.normalAndViewAngle(d,e,c);e=p.length(a);c=b.verticalOffsetAtDistance(c,e,m.verticalOffset,d.cosAngle,m.screenSizePerspectiveAlignment||m.screenSizePerspective);g&&this.updateScaleInfo(g,d.cosAngle,e);return p.add(a,p.scale(d.normal,c),f)};l.prototype.getGLMaterials=function(){return{color:L,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:O}};l.prototype.getAllTextureIds=
function(){return[this.params.textureId]};l.prototype.setTextureDirty=function(){this._textureDirty=!0};l.prototype.calculateRelativeScreenBounds=function(a,b,d){void 0===d&&(d=w.create());var e=this.params,c=d;void 0===c&&(c=U);G.set(e.anchorPos,c);c[0]*=-a[0];c[1]*=-a[1];c[0]+=e.screenOffset[0]*b;c[1]+=e.screenOffset[1]*b;d[2]=d[0]+a[0];d[3]=d[1]+a[1];return d};l.prototype.calculateAnchorPosForRendering=function(a){return F(this.params,a)};l.loadShaders=function(b,d,e,c){b._parse(a);var g=function(a){a.addDefine("OcclTest",
"OCCL_TEST");a.addDefine("SDF","SIGNED_DISTANCE_FIELD");a.addDefine("vvSize","VV_SIZE");a.addDefine("vvColor","VV_COLOR");a.addDefine("verticalOffset","VERTICAL_OFFSET");a.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");a.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN")},h=new B("hud",["vertexShaderHUD","fragmentShaderHUD"],null,e,d,b,c);g(h);h.addDefine("debugDrawBorder","DEBUG_DRAW_BORDER");e.addShaderVariations("hud-material-shader-variations",h);h=new B("hudHighlight",
["vertexShaderHUD","fragmentShaderHUDHighlight"],null,e,d,b,c);g(h);h.addDefine("binaryHighlightOcclusion","BINARY_HIGHLIGHT_OCCLUSION");e.addShaderVariations("hud-material-highlight-shader-variations",h);b=new B("hudOcclusionTestPixel",["vertexShaderOcclusionTestPixel","fragmentShaderSimple"],null,e,d,b,c);b.addDefine("verticalOffset","VERTICAL_OFFSET");b.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");b.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN");e.addShaderVariations("hud-material-occlusion-test-pixel-shader-variations",
b)};l.shouldRenderVisibilityDuringRenderPass=function(a){return a===y.MATERIAL||y.MATERIAL_HIGHLIGHT};return l}(n.MaterialBase);f=function(a){function d(d,e,c){c=a.call(this,d,d.getParams(),e,c)||this;c.programRep=e;c.params=b.copyParameters(d.getParams());c.selectProgram();c.selectSlot();return c}k(d,a);d.prototype.selectSlot=function(){this.mainSlot=this.params.drawInSecondSlot?l.HUDMATERIAL2:l.HUDMATERIAL1};d.prototype.beginSlot=function(a){return a===this.mainSlot};d.prototype.getProgram=function(){return this.program};
d.prototype.getAllPrograms=function(){return[this.program]};d.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.color=a.color;b.texCoordScale=a.texCoordScale;b.polygonOffset=a.polygonOffset;b.anchorPos=a.anchorPos;b.screenOffset=a.screenOffset;b.verticalOffset=a.verticalOffset;b.screenSizePerspective=a.screenSizePerspective;b.screenSizePerspectiveAlignment=a.screenSizePerspectiveAlignment;b.shaderPolygonOffset=a.shaderPolygonOffset;b.textureIsSignedDistanceField=
a.textureIsSignedDistanceField;b.outlineColor=a.outlineColor;b.outlineSize=a.outlineSize;b.vvSizeEnabled=a.vvSizeEnabled;b.vvSizeMinSize=a.vvSizeMinSize;b.vvSizeMaxSize=a.vvSizeMaxSize;b.vvSizeOffset=a.vvSizeOffset;b.vvSizeFactor=a.vvSizeFactor;b.vvColorEnabled=a.vvColorEnabled;b.vvColorValues=a.vvColorValues;b.vvColorColors=a.vvColorColors;this.updateTexture(a.textureId);this.selectProgram();this.selectSlot()};d.prototype.bindRender=function(a,b){var d=this.params,e=this.getProgram();this.bindTexture(a,
e);e.setUniform1i("hudVisibilityTexture",1);a.bindTexture(b.hudVisibilityTexture,1);a.setActiveTexture(0);e.setUniform4fv("overrideColor",d.color);e.setUniform1f("pixelRatio",b.pixelRatio);d.textureIsSignedDistanceField&&(e.setUniform4fv("outlineColor",d.outlineColor),e.setUniform1f("outlineSize",d.outlineSize));d.vvSizeEnabled&&(e.setUniform3fv("vvSizeMinSize",d.vvSizeMinSize),e.setUniform3fv("vvSizeMaxSize",d.vvSizeMaxSize),e.setUniform3fv("vvSizeOffset",d.vvSizeOffset),e.setUniform3fv("vvSizeFactor",
d.vvSizeFactor));d.vvColorEnabled&&(e.setUniform1fv("vvColorValues",d.vvColorValues),e.setUniform4fv("vvColorColors",d.vvColorColors));e.setUniform2fv("texScale",d.texCoordScale);e.setUniform2f("screenOffset",2*d.screenOffset[0],2*d.screenOffset[1]);e.setUniform2fv("anchorPos",F(d));d.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));a.setBlendingEnabled(!0);a.setBlendFunction(1,771)};d.prototype.bindProjection=function(a,d){this.material._textureDirty&&(this.renderTexture(a),
this.material._textureDirty=!1);var e=d.cameraAboveGround?1:-1,c=this.getProgram(),g=this.params;a.bindProgram(c);c.setUniform1f("cameraGroundRelative",e);c.setUniform1f("polygonOffset",g.shaderPolygonOffset);c.setUniform4fv("viewport",d.viewport);b.bindVerticalOffset(g.verticalOffset,d,c);c.setUniformMatrix4fv("viewNormal",d.viewInvTransp);g.screenSizePerspective&&(b.bindScreenSizePerspective(g.screenSizePerspective,c,"screenSizePerspective"),b.bindScreenSizePerspective(g.screenSizePerspectiveAlignment||
g.screenSizePerspective,c,"screenSizePerspectiveAlignment"))};d.prototype.releaseRender=function(a){a.setPolygonOffsetFillEnabled(!1);a.setBlendFunction(770,771);a.setBlendingEnabled(!1)};d.prototype.bindView=function(a,d){a=d.origin;var e=this.getProgram();b.bindView(a,d.view,e);b.bindCamPos(a,d.viewInvTransp,e)};d.prototype.bindInstance=function(a,b){a=this.getProgram();a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};d.prototype.getDrawMode=
function(a){return a.gl.TRIANGLES};return d}(f.GLMaterialTextureBase);var L=function(a){function b(b,d,e){b=a.call(this,b,d,e)||this;b.isOcclusionSlot=!1;return b}k(b,a);b.prototype.selectProgram=function(){var a=this.params;this.programOcclusionTestPixel=this.programRep.getShaderVariationsProgram("hud-material-occlusion-test-pixel-shader-variations",[!!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits]);this.program=this.programRep.getShaderVariationsProgram("hud-material-shader-variations",
[a.occlusionTest,a.textureIsSignedDistanceField,!!a.vvSizeEnabled,!!a.vvColorEnabled,!!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits,!!a.debugDrawBorder])};b.prototype.getDrawMode=function(a){a=a.gl;return this.isOcclusionSlot?a.POINTS:a.TRIANGLES};b.prototype.release=function(a){a.setDepthFunction(a.gl.LESS);this.isOcclusionSlot||this.releaseRender(a)};b.prototype.bind=function(a,b){var d=a.gl;this.bindProjection(a,b);var e=this.getProgram();a.setDepthFunction(d.LEQUAL);
this.isOcclusionSlot?e.setUniform4f("color",1,1,1,1):(this.bindRender(a,b),this.bindTexture(a,e))};b.prototype.getProgram=function(){return this.isOcclusionSlot?this.programOcclusionTestPixel:this.program};b.prototype.getAllPrograms=function(){return[this.programOcclusionTestPixel,this.program]};b.prototype.beginSlot=function(a){if(this.params.occlusionTest)return this.isOcclusionSlot=a===l.OCCLUSION_PIXELS,a===l.OCCLUSION_PIXELS||a===this.mainSlot;this.isOcclusionSlot=!1;return a===this.mainSlot};
return b}(f),O=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}k(b,a);b.prototype.selectProgram=function(){var a=this.params;this.program=this.programRep.getShaderVariationsProgram("hud-material-highlight-shader-variations",[a.occlusionTest,a.textureIsSignedDistanceField,!!a.vvSizeEnabled,!!a.vvColorEnabled,!!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits,a.binaryHighlightOcclusion])};b.prototype.bind=function(a,b){this.bindProjection(a,b);this.bindRender(a,
b)};b.prototype.release=function(a){this.releaseRender(a)};return b}(f),P={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},scaleAlignment:0,minPixelSizeAlignment:0},U=[0,0],N=p.create(),R=p.create(),S=p.create(),T=p.create(),V=p.create(),h=z.create(),ca=A.create(),Q={normal:T,cosAngle:0},e=A.create();A.identity(e);var d=1,g=[0,0],m=[0,0,1];return x})},"esri/views/3d/webgl-engine/materials/internal/MaterialBase":function(){define(["require","exports","./MaterialUtil","../../lib/ModelContentType"],
function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function b(a){this.visible=!0;this.renderOccluded=!1;this.renderPriority=0;this.parentStage=null;this.id=k.__Material_idGen.gen(a)}b.prototype.getId=function(){return this.id};b.prototype.getParentStage=function(){return this.parentStage};b.prototype.addParentStage=function(a){this.parentStage=a};b.prototype.removeParentStage=function(a){this.parentStage=null};b.prototype.setVisible=function(a){this.visible!==a&&(this.visible=
a,this.notifyDirty("matChanged"))};b.prototype.isVisible=function(){return this.visible};b.prototype.setRenderOccluded=function(a){this.renderOccluded!==a&&(this.renderOccluded=a,this.notifyDirty("matChanged"))};b.prototype.isRenderOccluded=function(){return this.renderOccluded};b.prototype.notifyDirty=function(b){this.parentStage&&this.parentStage.notifyDirty(a.MATERIAL,this,b)};b.prototype.setRenderPriority=function(a){this.renderPriority=a;this.notifyDirty("matChanged")};b.prototype.getRenderPriority=
function(){return this.renderPriority};return b}();r.MaterialBase=x;r.default=x})},"esri/views/3d/webgl-engine/materials/internal/GLMaterialTextureBase":function(){define(["require","exports","../../../../../core/tsSupport/extendsHelper","./GLMaterialBase","./MaterialUtil"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(a){function c(c,f,k,l,t){void 0===t&&(t=!1);c=a.call(this,c,k,l)||this;c.params=f;c.textureRep=l;c.initTransparent=t;c.glTextureRef=b.aquireIfNotUndefined(f.textureId,
f.initTexture,l,t);return c}k(c,a);c.prototype.updateTexture=function(a){var c=this.params;c.textureId!==a&&(b.releaseIfNotUndefined(c.textureId,this.textureRep),c.textureId=a,this.glTextureRef=b.aquireIfNotUndefined(c.textureId,c.initTexture,this.textureRep,this.initTransparent))};c.prototype.renderTexture=function(a){(a=this.textureRep.getTexture(this.params.textureId))&&a.dirty&&a.redraw&&a.redraw()};c.prototype.bindTexture=function(a,b){null!=this.glTextureRef&&(b.setUniform1i("tex",0),a.bindTexture(this.glTextureRef.getGLTexture()))};
c.prototype.bindTextureSize=function(a,b){null!=this.glTextureRef&&(a=this.glTextureRef.getGLTexture(),b.setUniform2f("texSize",a.descriptor.width,a.descriptor.height))};c.prototype.dispose=function(){b.releaseIfNotUndefined(this.params.textureId,this.textureRep)};return c}(a.default);r.GLMaterialTextureBase=x;r.default=x})},"esri/views/3d/webgl-engine/materials/internal/GLMaterialBase":function(){define(["require","exports","./MaterialUtil"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});
x=function(){function a(a,c,t){this.id=k.__GLMaterial_id++;this.material=a}a.prototype.getId=function(){return this.id};a.prototype.getMaterialId=function(){return this.material.getId()};a.prototype.isVisible=function(){return this.material.isVisible()};a.prototype.isRenderOccluded=function(){return this.material.isRenderOccluded()};a.prototype.getRenderPriority=function(){return this.material.getRenderPriority()};return a}();r.GLMaterialBase=x;r.default=x})},"esri/views/3d/webgl-engine/lib/ShaderVariations":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang ./Util ../../../webgl/Program ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t){return function(){function n(a,c,l,n,k,t,w){this.variables=[];this.sealed=!1;this.programCache={};b.assert(2===c.length,"you must specify shader snippet prefixes for vertex and fragment shaders");this.programNamePrefix=a;this.shaderSnippetPrefixes=c;this.baseDefines=l;this.programRep=n;this.snippets=t;this.rctx=w;this.baseDefines=l?l.slice():[]}n.prototype.addDefine=function(a,c,l,n){b.assert(!this.sealed,"you cannot add another variable after the first program has been generated");
b.assert(!!a,"you must specify a program name suffix");this.variables.push({programNameSuffixes:["",a],shaderNameSuffixes:n||a,defineStr:c,affectsShaderTypes:l||[!0,!0]})};n.prototype.addBinaryShaderSnippetSuffix=function(a,c,l){b.assert(!this.sealed,"you cannot add another variable after the first program has been generated");b.assert(!!a,"you must specify a program name suffix");this.variables.push({programNameSuffixes:["",a],shaderSnippetSuffixes:["",c],affectsShaderTypes:l||[!0,!0]})};n.prototype.addNaryShaderSnippetSuffix=
function(a,c){b.assert(!this.sealed,"you cannot add another variable after the first program has been generated");var f=a.map(function(a){b.assert(null!=a.value,"value must always be specified");return a.value});this.variables.push({values:f,programNameSuffixes:a.map(function(a,b){return null!=a.programNameSuffix?a.programNameSuffix:f[b]}),shaderSnippetSuffixes:a.map(function(a,b){return null!=a.shaderSnippetSuffix?a.shaderSnippetSuffix:f[b]}),affectsShaderTypes:c||[!0,!0]})};n.prototype.getShaderVariation=
function(c){b.assert(c.length===this.variables.length,"you must specify a value for each variable");for(var f=this.programNamePrefix,l=a.clone(this.shaderSnippetPrefixes),n=a.clone(this.shaderSnippetPrefixes),k=a.clone(this.baseDefines),t=0;t<this.variables.length;t++){var w=this.variables[t],r=c[t],F=void 0;w.values?(F=w.values.indexOf(r.toString()),b.assert(0<=F,"invalid value "+r+" for variable "+t)):F=r?1:0;f+=w.programNameSuffixes[F];for(r=0;2>r;r++)w.affectsShaderTypes[r]&&(w.shaderSnippetSuffixes&&
(l[r]+=w.shaderSnippetSuffixes[F],n[r]+=w.shaderSnippetSuffixes[F]),w.defineStr&&F&&(k.push(w.defineStr),n[r]+=w.shaderNameSuffixes))}return{programName:f,shaderSnippetNames:l,shaderNames:n,defines:k}};n.prototype.getProgram=function(a,n,l){void 0===n&&(n=this.snippets);void 0===l&&(l=this.rctx);this.sealed=!0;var f=a.reduce(function(a,b){return a+b.toString()},"");if(this.programCache[f])return this.programCache[f];a=this.getShaderVariation(a);var k=this.programRep.get(a.programName);if(k)return k;
var q=a.shaderSnippetNames[0],k=n[q];b.assert(null!=k,"shader snippet '"+q+"' does not exist");q=a.shaderSnippetNames[1];n=n[q];b.assert(null!=n,"shader snippet '"+q+"' does not exist");k=new c(l,k,n,t.Default3D,a.defines);this.programCache[f]=k;this.programRep.add(a.programName,k);return k};return n}()})},"esri/views/3d/webgl-engine/materials/internal/TexOnlyGLMaterial":function(){define("require exports dojo/text!./TexOnlyGLMaterial.xml ./MaterialUtil ../../lib/RenderSlot ../../lib/gl-matrix ../../../../webgl/Program ../../../../webgl/enums ../../lib/DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f){var q=c.vec4d.createFrom(1,1,1,1);return function(){function c(b,c,f,l,n){this.id=a.__GLMaterial_id++;this.program=b.get("texOnly");this.color=f;this.depthFunc=n;this.blend=l;this.texGLName=c}c.prototype.getId=function(){return this.id};c.prototype.beginSlot=function(a){return a===b.INTERNAL_MATERIAL};c.prototype.getProgram=function(){return this.program};c.prototype.setColor=function(a){this.color=a};c.prototype.bind=function(b,c){b.bindProgram(this.program);this.program.setUniformMatrix4fv("model",
a.IDENTITY);this.program.setUniformMatrix4fv("proj",c.proj);this.program.setUniform4fv("color",void 0!==this.color?this.color:q);this.program.setUniform1i("tex",0);b.bindTexture(this.texGLName,0);this.blend&&(b.setBlendingEnabled(!0),b.setBlendFunctionSeparate(b.gl.SRC_ALPHA,b.gl.ONE_MINUS_SRC_ALPHA,b.gl.ONE,b.gl.ONE_MINUS_SRC_ALPHA));b.setDepthTestEnabled(!0);void 0!==this.depthFunc&&b.setDepthFunction(this.depthFunc)};c.prototype.release=function(a){void 0!==this.depthFunc&&a.setDepthFunction(513);
this.blend&&a.setBlendingEnabled(!1)};c.prototype.bindView=function(b,c){a.bindView(c.origin,c.view,this.program)};c.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};c.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};c.loadShaders=function(a,b,c,l){a._parse(k);a=new t(l,a.vertexShaderTexOnly,a.fragmentShaderTexOnly,f.Default3D);c.add("texOnly",a)};return c}()})},"esri/views/3d/support/debugFlags":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor".split(" "),
function(x,r,k,a,b,c){return new (function(c){function n(){var a=null!==c&&c.apply(this,arguments)||this;a.SCENEVIEW_HITTEST_RETURN_SELECTOR=!1;a.HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED=!1;a.HIGHLIGHTS_VISUALIZE_BLOCKS=!1;a.HIGHLIGHTS_PROFILE_TO_CONSOLE=!1;a.DECONFLICTOR_SHOW_OUTLINES=!1;a.DECONFLICTOR_SHOW_GRID=!1;a.LABELS_SHOW_BORDER=!1;a.OVERLAY_DRAW_TEST_TEXTURE=!1;a.OVERLAY_SHOW_CENTER=!1;a.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS=!1;a.DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES=!1;a.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES=
!1;return a}k(n,c);a([b.property()],n.prototype,"SCENEVIEW_HITTEST_RETURN_SELECTOR",void 0);a([b.property()],n.prototype,"HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED",void 0);a([b.property()],n.prototype,"HIGHLIGHTS_VISUALIZE_BLOCKS",void 0);a([b.property()],n.prototype,"HIGHLIGHTS_PROFILE_TO_CONSOLE",void 0);a([b.property()],n.prototype,"DECONFLICTOR_SHOW_OUTLINES",void 0);a([b.property()],n.prototype,"DECONFLICTOR_SHOW_GRID",void 0);a([b.property()],n.prototype,"LABELS_SHOW_BORDER",void 0);a([b.property()],
n.prototype,"OVERLAY_DRAW_TEST_TEXTURE",void 0);a([b.property()],n.prototype,"OVERLAY_SHOW_CENTER",void 0);a([b.property()],n.prototype,"TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS",void 0);a([b.property()],n.prototype,"DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES",void 0);a([b.property()],n.prototype,"DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES",void 0);return n=a([b.subclass()],n)}(b.declared(c)))})},"esri/views/3d/webgl-engine/lib/webgl-utils":function(){define([],function(){var x=function(r,k){for(var a=
["webgl","experimental-webgl","webkit-3d","moz-webgl"],b=null,c=0;c<a.length;++c){try{b=r.getContext(a[c],k)}catch(t){}if(b)break}return b};return{create3DContext:x,setupWebGL:function(r,k){function a(a){var b=r.parentNode;b&&(b.innerHTML='\x3ctable style\x3d"background-color: #8CE; width: 100%; height: 100%;"\x3e\x3ctr\x3e\x3ctd align\x3d"center"\x3e\x3cdiv style\x3d"display: table-cell; vertical-align: middle;"\x3e\x3cdiv style\x3d""\x3e'+a+"\x3c/div\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e")}
if(!window.WebGLRenderingContext)return a('This page requires a browser that supports WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org"\x3eClick here to upgrade your browser.\x3c/a\x3e'),[null,'This page requires a browser that supports WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org"\x3eClick here to upgrade your browser.\x3c/a\x3e'];k=x(r,k);return k?[k]:(a('It doesn\'t appear your computer can support WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org/troubleshooting/"\x3eClick here for more information.\x3c/a\x3e'),
[null,'It doesn\'t appear your computer can support WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org/troubleshooting/"\x3eClick here for more information.\x3c/a\x3e'])},detectWebGL:function(){var r;try{r=window.WebGLRenderingContext}catch(a){r=[!1,0]}var k;try{k=x(document.createElement("canvas"))}catch(a){k=[!1,1]}r?k?(r=k,r=[!0,{VERSION:r.getParameter(r.VERSION),SHADING_LANGUAGE_VERSION:r.getParameter(r.SHADING_LANGUAGE_VERSION),VENDOR:r.getParameter(r.VENDOR),RENDERER:r.getParameter(r.RENDERER),
EXTENSIONS:r.getSupportedExtensions(),MAX_TEXTURE_SIZE:r.getParameter(r.MAX_TEXTURE_SIZE),MAX_RENDERBUFFER_SIZE:r.getParameter(r.MAX_RENDERBUFFER_SIZE),MAX_VERTEX_TEXTURE_IMAGE_UNITS:r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)}]):r=[!1,1]:r=[!1,0];return r}}})},"esri/views/3d/webgl-engine/parts/Viewport":function(){define("require exports dojo/has ../lib/PerformanceTimer ../lib/Camera ../lib/Util ../lib/gl-matrix ./Visualizer".split(" "),function(x,r,k,a,b,c,t,n){var f=t.vec3;x=t.vec4d;var q=
t.mat4d,l=[0,0],y=q.create(),B=[x.create(),x.create(),x.create(),x.create(),x.create(),x.create()];return function(){function a(a,c,l,k){this._content={};this._frustumCullingEnabled=!0;this._maxFarNearRatio=2E4;this._stats={renderGeometriesTotal:0,renderGeometriesVisible:0,visualizerRenderTimer:null,viewportRenderTimer:null};this._needsRender=!0;this._rctx=k;this._gl=k.gl;this._visualizer=new n(a,c,l,this._rctx);this._camera=new b(f.createFrom(0,100,-100),f.createFrom(0,0,0))}a.prototype.getCombinedStats=
function(){var a={},b=this._visualizer.getCombinedStats(),c;for(c in b)a[c]=b[c];a.renderGeometriesTotal=this._stats.renderGeometriesTotal;a.renderGeometriesVisible=this._stats.renderGeometriesVisible;void 0!==this._gl.getUsedTextureMemory&&(a.textureMemory=this._gl.getUsedTextureMemory());void 0!==this._gl.getUsedRenderbufferMemory&&(a.renderbufferMemory=this._gl.getUsedRenderbufferMemory());void 0!==this._gl.getUsedVBOMemory&&(a.VBOMemory=this._gl.getUsedVBOMemory());if(void 0!==this._gl.getUsedTextureMemoryStats){var b=
this._gl.getUsedTextureMemoryStats(),f;for(f in b)a["texMem type: "+f]=b[f]}return a};a.prototype.dispose=function(){this._visualizer.dispose();this._visualizer=null};a.prototype.setLighting=function(a){this._visualizer.setLighting(a)};a.prototype.getViewParams=function(a){var b=this._visualizer.getViewParams(a);if(!a||a.frustumCullingEnabled)b.frustumCullingEnabled=this._frustumCullingEnabled;if(!a||a.maxFarNearRatio)b.maxFarNearRatio=this._maxFarNearRatio;return b};a.prototype.setViewParams=function(a){void 0!==
a.frustumCullingEnabled&&(this._frustumCullingEnabled=a.frustumCullingEnabled);void 0!==a.maxFarNearRatio&&(this._maxFarNearRatio=-1===a.maxFarNearRatio?2E4:a.maxFarNearRatio);this._visualizer.setViewParams(a);this._needsRender=!0};a.prototype.setRenderParams=function(a){this._visualizer.setRenderParams(a)};a.prototype.getRenderParams=function(){return this._visualizer.getRenderParams()};a.prototype.getFrustumObjects=function(){var a={},b;for(b in this._content)a[this._content[b].name]=1;return a};
a.prototype.modify=function(a,b,c,f){this._visualizer.modify(a,b,c,f);this._content=this._visualizer.getContent()};a.prototype.getContent=function(){return this._content};a.prototype.setCamera=function(a){this._camera.copyFrom(a);this._updateNearFar();this._needsRender=!0};a.prototype.getCamera=function(){return this._camera};a.prototype.getPickRay=function(a,b,c){return this.pickRayWithBeginPoint(a,void 0,this._camera.viewMatrix,b,c)};a.prototype.pickRayWithBeginPoint=function(a,b,c,f,l){return this._visualizer.getPickRay(a,
b,this._camera,c,f,l)};a.prototype.addExternalRenderer=function(a,b){return this._visualizer.addExternalRenderer(a,b)};a.prototype.removeExternalRenderer=function(a){return this._visualizer.removeExternalRenderer(a)};a.prototype.getExternalRenderers=function(){return this._visualizer.getExternalRenderers()};a.prototype.render=function(a,b){this._updateNearFar();this._visualizer.render(this._camera,a,b)};a.prototype.resetNeedsRender=function(){this._needsRender=!1;this._visualizer.resetNeedsRender()};
a.prototype.needsRender=function(){return this._needsRender||this._visualizer.needsRender()};a.prototype._updateNearFar=function(){if(this._frustumCullingEnabled||0<this._maxFarNearRatio)l[1]=0,this._computeFrustumCullingAndNearFar(this._camera.eye,l),0<this._maxFarNearRatio&&0<l[1]&&(this._camera.far=l[1],this._camera.near=Math.max(l[0],this._camera.far/this._maxFarNearRatio))};a.prototype._computeFrustumCullingAndNearFar=function(a,b){q.perspective(this._camera.fovY,this._camera.aspect,1,10,y);
c.matrix2frustumPlanes(this._camera.viewMatrix,y,B);this._stats.renderGeometriesTotal=0;this._stats.renderGeometriesVisible=0;a=-Number.MAX_VALUE;var f=-Number.MAX_VALUE,l=B[0][0],p=B[0][1],n=B[0][2],k=B[0][3],t=B[1][0],v=B[1][1],r=B[1][2],w=B[1][3],D=B[2][0],x=B[2][1],U=B[2][2],N=B[2][3],R=B[3][0],S=B[3][1],T=B[3][2],V=B[3][3],h=B[4][0],ca=B[4][1],Q=B[4][2],e=B[4][3],d=B[5][3],g;for(g in this._content){var m=this._content[g];this._stats.renderGeometriesTotal++;if(!m.material.isBackdrop){var u=m.center,
C=u[0],M=u[1],u=u[2],m=m.bsRadius;if(l*C+p*M+n*u+k>m)continue;if(t*C+v*M+r*u+w>m)continue;if(D*C+x*M+U*u+N>m)continue;if(R*C+S*M+T*u+V>m)continue;M=h*C+ca*M+Q*u;C=M+m;M=-M+m;C>a&&(a=C);M>f&&(f=M)}this._stats.renderGeometriesVisible++}g=a!==-Number.MAX_VALUE;0<this._stats.renderGeometriesVisible&&g&&(b[0]=.99*Math.max(1-(a+e),2),b[1]=1.01*Math.max(10+(f+d),b[0]+1))};return a}()})},"esri/views/3d/webgl-engine/parts/Visualizer":function(){define("require exports ../lib/Renderer ../lib/SSAOHelperObscurance ../lib/ShadowMap ../lib/NearFarCalc ../lib/Util ../lib/gl-matrix ../lib/RenderPass ../lib/HighlightHelper ../lib/RenderOccludedHelper ../lib/OffscreenRenderingHelper".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){var B=n.vec3d,v=n.mat4d,w=t.assert;return function(){function n(f,n,p,t){this._drawSSAOMapDebugQuad=this._drawShadowMapDebugQuad=!1;this._needsRender=!0;this._content={};this._rctx=t;this._renderer=new k(f,n,p,this._rctx,!1);this._programRep=f;this._nearFarCalc=new c;this._helpers={shadowMap:new b(f,this._rctx),ssao:new a(f,p,this._rctx,this.setNeedsRender.bind(this)),highlight:new q(f,p,this._rctx),renderOccluded:new l(f,p,this._rctx),offscreenRendering:new y(f,
this._rctx)}}n.prototype.getCombinedStats=function(){return this._renderer.getCombinedStats()};n.prototype.dispose=function(){this._renderer.dispose();this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setEnableState(!1);this._helpers.shadowMap.dispose();this._helpers.ssao.getEnableState()&&this._helpers.ssao.setEnableState(!1);this._helpers.ssao.dispose();this._helpers.highlight.getEnableState()&&this._helpers.highlight.setEnableState(!1);this._helpers.renderOccluded.getEnableState()&&
this._helpers.renderOccluded.setEnableState(!1);this._helpers.offscreenRendering.getEnableState()&&this._helpers.offscreenRendering.setEnableState(!1)};n.prototype.setLighting=function(a){this._renderer.setLighting(a)};n.prototype.getViewParams=function(a){var b=a||{};if(!a||a.pixelRatio)b.pixelRatio=this._renderer.getPixelRatio();return b};n.prototype.setViewParams=function(a){null!=a.pixelRatio&&this._renderer.setPixelRatio(a.pixelRatio)};n.prototype.setRenderParams=function(a){void 0!==a.shadowMapResolution&&
!1===this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setTextureResolution(a.shadowMapResolution);void 0!==a.shadowMap&&a.shadowMap!==this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setEnableState(a.shadowMap);void 0!==a.shadowMapMaxCascades&&this._helpers.shadowMap.setMaxNumCascades(a.shadowMapMaxCascades);!0!==this._helpers.highlight.getEnableState()&&this._helpers.highlight.setEnableState(!0);void 0!==a.ssao&&a.ssao!==this._helpers.ssao.getEnableState()&&this._helpers.ssao.setEnableState(a.ssao);
void 0!==a.ssaoAttenuation&&this._helpers.ssao.setAttenuation(a.ssaoAttenuation);void 0!==a.ssaoRadius&&this._helpers.ssao.setRadius(a.ssaoRadius);void 0!==a.ssaoFilterRadius&&console.error("The property ssaoFilterRadius is no longer supported as a render parameter.");void 0!==a.ssaoSamples&&this._helpers.ssao.setSamples(a.ssaoSamples);void 0!==a.drawShadowMapDebugQuad&&(this._drawShadowMapDebugQuad=a.drawShadowMapDebugQuad);void 0!==a.drawSSAODebugQuad&&(this._drawSSAOMapDebugQuad=a.drawSSAODebugQuad);
this._helpers.ssao.getEnableState()?this._renderer.ssaoEnabled=!0:this._renderer.ssaoEnabled=!1;void 0!==a.offscreenRendering&&a.offscreenRendering!==this._helpers.offscreenRendering.getEnableState()&&this._helpers.offscreenRendering.setEnableState(a.offscreenRendering);void 0!==a.antialiasingEnabled&&(this._renderer.renderOptions.antialiasing=a.antialiasingEnabled?"smaa":"none");void 0!==a.earlyOcclusionPixelDraw&&(this._renderer.renderOptions.earlyOcclusionPixelDraw=a.earlyOcclusionPixelDraw);void 0!==
a.defaultHighlightOptions&&this._helpers.highlight.setDefaultOptions(a.defaultHighlightOptions);this._needsRender=!0};n.prototype.getRenderParams=function(){var a={};this._helpers.shadowMap.getIsSupported()&&(a.shadowMap=this._helpers.shadowMap.getEnableState(),a.shadowMapResolution=this._helpers.shadowMap.getTextureResolution(),a.shadowMapMaxCascades=this._helpers.shadowMap.getMaxNumCascades());this._helpers.ssao.getIsSupported()&&(a.ssao=this._helpers.ssao.getEnableState(),a.ssaoAttenuation=this._helpers.ssao.getAttenuation(),
a.ssaoRadius=this._helpers.ssao.getRadius(),a.ssaoFilterRadius=this._helpers.ssao.getFilterRadius(),a.ssaoSamples=this._helpers.ssao.getSamples());return a};n.prototype.modify=function(a,b,c,f){this._renderer.modify(a,b,c,f);for(f=0;f<b.length;++f)delete this._content[b[f].uniqueName];for(f=0;f<a.length;++f)this._content[a[f].uniqueName]=a[f];for(f=0;f<c.length;++f)w(this._content[c[f].renderGeometry.uniqueName]===c[f].renderGeometry)};n.prototype.getContent=function(){return this._content};n.prototype.getPickRay=
function(a,b,c,f,l,n){B.unproject(B.createFrom(a[0],a[1],0),f,c.projectionMatrix,c.fullViewport,l);B.unproject(B.createFrom(a[0],a[1],1),f,c.projectionMatrix,c.fullViewport,n)};n.prototype.getProjectionMatrix=function(a,b,c,f,l){b=t.fovx2fovy(b,a[2],a[3]);v.perspective(180*b/Math.PI,a[2]/a[3],c,f,l)};n.prototype.addExternalRenderer=function(a,b){return this._renderer.addExternalRenderer(a,b)};n.prototype.removeExternalRenderer=function(a){return this._renderer.removeExternalRenderer(a)};n.prototype.getExternalRenderers=
function(){return this._renderer.getExternalRenderers()};n.prototype.resetNeedsRender=function(){this._needsRender=!1;this._renderer.resetNeedsRender()};n.prototype.needsRender=function(){return this._needsRender||this._renderer.needsRender()};n.prototype.setNeedsRender=function(){this._needsRender=!0};n.prototype.render=function(a,b,c){var l=a.viewport,p;if(this._helpers.shadowMap.getEnableState()){p=this._nearFarCalc.calculateSceneNearFar(a,this._content);this._helpers.shadowMap.prepare(a,b,this._content,
p);b=this._helpers.shadowMap.getCascades();for(p=0;p<b.length;++p){var n=b[p];n.camera.setGLViewport(this._rctx);this._renderer.renderGeometryPass(f.MATERIAL_DEPTH_SHADOWMAP,n.camera)}this._helpers.shadowMap.finish(c);a.setGLViewport(this._rctx)}this._helpers.shadowMap.bindAll(this._programRep);this._renderer.renderAuxiliaryBuffers(a,c,this._helpers);this._renderer.render(a,c,this._helpers);this._drawShadowMapDebugQuad&&this._helpers.shadowMap.getEnableState()&&(a=v.ortho(l[0],l[2],l[1],l[3],-1,1),
this._helpers.shadowMap.drawDebugQuad(a));this._drawSSAOMapDebugQuad&&this._helpers.ssao.getEnableState()&&(a=v.ortho(l[0],l[2],l[1],l[3],-1,1),this._helpers.ssao.drawQuad(a))};return n}()})},"esri/views/3d/webgl-engine/lib/SSAOHelperObscurance":function(){define("require exports ../../../../core/Logger ./Util ./gl-matrix dojo/text!../materials/internal/ssao.xml ../../../webgl/Program ../../../webgl/Texture ../../../webgl/FramebufferObject ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ../../support/imageUtils ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D){var F=b.vec3d,G=b.vec4d,p=k.getLogger("esri.views.3d.webgl-engine.lib.SSAOHelperObscurance");x=function(){function b(a,b,c,f){this._enabled=!1;this._BLUR_F=2;this._attenuation=.5;this._radius=3;this._samples=16;this._viewportToRestore=G.create();this._rctx=c;this._programRep=a;this._requestRender=f;this._emptyTexture=new n(c,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:4,height:4},null)}b.prototype.dispose=function(){this._emptyTexture.dispose();
this._emptyTexture=null};b.prototype.getIsSupported=function(){var a=this._rctx,b=-1!==a.parameters.versionString.indexOf("WebGL 0.93"),c=-1!==a.parameters.versionString.indexOf("WebGL 0.94");return a.extensions.standardDerivatives&&!(b||c)};b.prototype.setEnableState=function(a){a?this.enable():this.disable()};b.prototype.getEnableState=function(){return this._enabled};b.prototype.enable=function(){var a=this;if(!this.getEnableState())if(this.getIsSupported()){this._enabled=!0;var b={target:3553,
pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,height:0},c={colorTarget:0,depthStencilTarget:0};this._ssaoFBO=f.createWithAttachments(this._rctx,b,c);this._blur0FBO=f.createWithAttachments(this._rctx,b,c);this._blur1FBO=f.createWithAttachments(this._rctx,b,c);B.dataUriToImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAqf0lEQVR42gTBB5ydB2EY8G/v8b7v7Xnv9mmcdFp3WpasZUuWFzZgDJgkhgwoSdM2JbTNjzZA06ZNgaRJWtKSEgjDGNuA8UYeWpZkbZ10uj3efu977317j/7/4De/8ef9vCow2VUGGHzRhuQ+t08GvhZb+jy85wOu/68JzwtQSCZedpsvC8SL6NJNNwZoHMaZiMoCrjrPATpGJFxvRCYMKqTCBsyVw8h5B6ROArU3+8HOGLe3Ay+UABow3D4wEcfOakDbjh2h594mikMNcI62ISNzIius0bfeN+QHrv+L7M53FHq1XC29breFgmCjwPHQ/fo88OIg9kvDdQPhB93G8yk6DtRYFT64fR/jQn0NIcIgYHylyFjVHPBboCB7HQ5sXuoZqQCHqKUjtvKNpvxkivqlZe514DOA/Keethib6OkOw204MMTjY3HX8VIGFeITgBEApGRFY3hyKyPeRWK/NNa2huJeLKzBJAimiY7ZQbAh0HwPEP9jxHhs6he37z8+KWqdeD7TCttNwgHftJpfzCq/iOJbKrxap2Ymet8zwVEoNReE7T4aI6t2mBuO4Meyh3vHAeK2+KvLzWHEgSCJpgR5EvP7QPFLyeDWWrqc1iVz6LwPI7GEpOEExCwzVZwtKtDGyzRW5tGyz5WA7HLtfrOIHp9T9kXQB1z7E10eYMytTs5QOuci8E+YIk9W/roj5nxvjVVLaM+30x/09CPGIdQlfsOe/WqxoS9Sf5bVv+drIqyP6uNrQMxFGDPSt1PurVE/UcuV9ci35bmCPTiIjsuZZjZCePj01iMbKBYa7UyVIDI+MDMSAV7sw6CSjKEG0IqwXhEkVtFwFJQ9D3q9q2RE8xEzuxvCN0Bq0pAFH7IMZEW3/zQU6rQ8Dw1bqPE2XCxtht8B/Hsg/yzu3CUcGdb6PW6QCVRs7bYKDwDQfYefmmJO2O/d4LyOzns2kA3kt7Bxrn1ZZ4hlYFs+uYpAnNDyDI36VE+6wLadkEwTwQIdYovCIM8SEVS24D+ktuqjWIT4yWFEN/zEfsqIWkFfKQsW8DNVyLEDKWwZ6ew8x5ojpAmh7DbTuiCGFcW/DXl5hO7Y/BztDCbwqtMaxcanBq59oBYuVIAM2o2twXHduUpDjChd7xinXHoB5OKsvd/jlrN+SnHoir0dn1hWWSbrDzj0Nd6x3PUb1LYyVIpv9AHW9sPW+aEhU8peULyaAG12TddDnq0zVg5S+vfnVLQBwjt3PcU9k0feDfAkCjohqkfBRgeVfcx1xYcTzRYoNbVPbCQ/mmC66x3pMpN7IPDeT7a2+TYYDYj41QNoEoGVQhPLlIPb8k2yMZlM2gNIiEu4nfIZFKeDW08qY9ds2wLoLWIt2yJuYrXnWhNbytRVs1sHIw6qhoE/sYJsJArzFLNdUzxalSOyF3oIBU2ttqZFumoEj6XoZVOHKWSJDoGe+WGZmObQuA4f+uap/u15hOEW1LveusgkSWNvivQRRg7bAQWcd+wUcmN/DTkr6XeHmX/pVnYkebSt/RBNP8PhsXnqFhfUu/ozIH++g98KYa+EnqoRZtFucB/WVPy5MoJEyH+RgSeFoTuDS3Rjpi7Iog/+N2aD7N9oJkprVsWpNOqZ5JsMfDKSID//tUCyQrANUm4Q/czDP1mKVTo2lrM6uuJh9RV3pMc1ylB/5zpYs3EWgR87+hDYZY06VIzFYd+HxTY9FyARG0RytMQAJujsU3Pz/qPlwVVI99+KBosYv4qQOzQP4WWCfPVd5eSjvPMmAkY0LFL9lX5vMfDKgtMADu3pCrNLctVht8XYBr6KRvBkWte8jafxscvmLE7tITB4IxDf4GJ/7YdtklZdgOO6z62Bj4ADitP0UfcQAiwSnoEgw44j+mCCpjb7zL2IcBSOYLS5ArdRgU/EJrsgnLhuAgv6ylO+fTYJZMPiFVUt4bafDNpq8gW2/+Wc1LSVejMjel0a5Yg2kUT1DzSmbB3aGVsieORVfXAq7vYkeQUZKUHxZlufMOFKsneeaJYoxjH4j6q2BObSoPx+o2RkzKti/lyb2uC7h60bB4z9maJ4tnFpvw/fQ8zfJ3IAAiSE6G2X40l/PFI+xGgcAjM+/31BL8p1KGRn8kFaztzEFxsAfOxjR910VTxaqsh6/z5RGNebzyWtoossscYHUPKL91d9BhtQTclREMGf6PoMnmDJ6orHxKl7RZO9DwAIBqRCqlbTHs8hf0fa/1ZcPuxk/I42xYnbafCqgGGatSnGPUaE/1azHhdzw/rok76dX+vslH00lkxaRKfW/wwn3mJTQOH5bu/vzgMJNnTuAvJMFL3p9f90ttxSrfnxNusCI0spKhX0O7XBAHcouivCT56YhuFE+A4vrQr7VfSfeXbsbpt4rbhpwuNPNBagcd8A6DO4PgSzeDQ6lGlIevQ2yGyG3fn49mPgnTNJZqVuLwC8E3FFyBozgL47rtOWlrXOd1s/dRPjgYmLAzl2dWFOGk+bW+PStap2Xm/ERvzJdDYd4fd16N3x3ooL/FzJ8PEPT4H4WRk5ygiRK97yrjHU5p/69gdFfUdLiDlYG0NeFYyjRmZNdLM6mDPgwceejmpR8ek2Pm02WQ3ZqW5nCDTpL9931LtJdladOI0oZjCwoGICD1xZV4cYZxIgzhjekCf9wh4+jDU5IjvsdEm/12T6e0aJ5YqnS7ROWkWBX3FAnboqd7c6kAcAxZwBS3bSAZcH0F6pV/7AkfvSEzW3fzrp1VvQjkL3wetuK7N/CV692ve/zNVq5KYktPLl/CMDhNzFjT6ZOIK3RgxqBaLxgL8Aoc+F8MeP7gFuRpXbCDtlAbL10NvMh/tsocPBVQx9SFIIiN0CNzcipYWwz5GmjGWiarABr7U30U+uUNtF9/saPWDaKnox3JOtzsKvq1INHtwgug+a9C8U+XIiPGGIWaCNg7RE1WFxot+t3g22M6JFGzGOpSzmpS+ODP4Q6RwuwVKDW0f8olQHYv4Iwf51NAr0mmJoXL1TpxX/Jwq9m3b+wiCKtLfiNrWV4I/5xBkDPvnpZ+Q8EN/Czdf1bA+T5A6JpRxP74kwUm8y12j7Jd+fsDMtag5nJvLUigJjbnooZikOBpxD6T+Nk7Ln0kFZlhujYcHz/L1UK05AHRt+gErP4E4f5gKsX+O8TCsbUG1hHj2+vX3Ng7bL0R3a5KytLaPmeay0xND+gBfUj9Phq/2xfYKS87H3ta1Qso4H9Ca6X0hoMdy/IXM7QuhIVg9ZbI2oBRhk6xpX8qoHNrL9POGnrNERY9igV1x61qKLAvFcGoiRcch1N+k7LK/5D0D3eIobCG4s2iADwB67+vJqtk0Tc1TMkgQLKKRG4Bl48I3u2FQq/lO3XbK9g21Br2Wrcyobb2DqyLVhQbWbiwX3JdQGgLjIbjStUiveYGF6IpjdMZj6eyO1pSwXCSByV38TzEY2/VEpeAXdtABk0qq9aZB+cGf+ukGgq26f4iAJfso+9b38L3dfnIImHIwH4TRyf4e78yxS+Uxq6TugN4xw5XDxOoluqXYDJhgyxre24BJr10njnXjpWcTtWbdv4aXNbXQq03s36vFSR1oz9oxk321YuwoQdbNCsfy3tHAmMcnpdcCnnvFu3ffTYs/Ph90bPfqToDdPLPaNcCKivoo0Rwkqbsk1bPVbJpYxGIKUfXH4pK6H8fghaPY13icA4JO+NLuCpoYlHDM9EB75+kNH/n6o9zE+TRnBkkL8xiqWY+Q9ZzaAg4+fLzZjhNfw3w/gUQRFiPz+fPeS0b8aFIJGPC+rr24QY6gIO9YVpEO6A2aaeyYdXRMVVLdKluURo78cBmBt9EtRzeNaKwWKt2E84X3D5pkIp/iAp5BlCgOpbCJAGniU3QBwNA46JmID4zirCmjDcPth6PehZa+zDdAvOqltgXj53q4T5ealBjQn4yoLHxl7ENmhUxeNvsVRYwtikoW6UeUxgr9EMFvwiR9UeuVRYKur4GLqMtLds4H9c7GxNSJGLKubjwZ8TGOXLmgCr4e5uEw7XWCj+lNk1wMUOZOC/mXXfhLtvOu24Kyd7Rq3dEnkuAFo8DA4pyLpJ0zioo44oRxXdESQO1rq81ulq3WDJXbt3ADVNIjWg2a/R+JYnI2PeepVLB6LPzi5eMUa2/jvGWrYA0pIsd2Ax6mPHbLgJuQbN3uQNGGu19WDg/3b6lAnBRn9N3KlQsrLj5LkBOCnwk7P3pLX1ljdnh8cnPPerTvbJmSkWHISCPCTNYii/Dg4JrjaCNS+3DAPRwm9DyJkalkLQz4YsGNLFveiCyw6cE4MzvjUgRAl0jAQclYHdAaYaFVABepI4sP/oeepxPi9oGlSi3tpWIX0FzAOuE71y02MAmdQrbkGPmClGtJGKw+fOHi4cTrPd5qF/4KGkWmwqPqRP9fyB03ZL2FMBtc/W3/43eT17zGJUY+tBegRFjLJktlYf8TKpkmzJai8GvczudWw+UeEPcTZGuLLoFGDpv5YDH7ZFo4P1jmZ3TCjEotNcBqm155Pjm3NzFEKWKF7KcVY72eG4IF507vbNnbj9CwxsimhPW5KBT/cwpfvy/YzvJdcA+6n/B0d85Em9Jpj0SJ6LewBcL7Fw//+NzPSGw1uSqy9jfTmcJuyMzyA57DcJ7BZOkbPIcUXsDPjoMXY/keYYLd0Rax9ZOgJqJzTsb8onXqy1r3kKf8mbdIKVceTSXiiGi4/HR7Pt5tt27+BzW2VM1tj6lqIToB4087XR9bgOfSFKyGf5eeM2J0YhpmrH9/Uu2+28qDSL1av08BUz/i2dTounIci36M4SXJfQvpHifh6TOnD1lTMejVlfZUXf66md5FwdmEaOG1150HxOMK+gQNbgOZs0N1/lb7CJLdA8ILbK7RYCYPhDrXAb+xLMG4f8mFkDpBeyS5+tXLxfxPxJxjk++79i5TfpbnAivqN+HcMfaKsuVEQwkWRTQ6/a5BboYuIP2CsCo3BHucNjYkXfHt7YLxqKU/w4c/bdMrAM0RpawTOtWVdL3+l+Mr9a6KGHjzCdL+Pcs82YJuhXDZ2rh2NZcStekK3eqM4bjnwp/7yMa1OFl1OV3t6QPCo35w0tr2V7Copy7J1Es2x8Vv/HFIPufBxivtOv7nfIH2UelqlYzTdYMRhlOaizWtwONQqix3wIN5egwKRjEqW/h7rM7j0/YG2BRMfQkYeQJUQeo9nCmVps09F9focPDhOOXQUQMjU5dVeslBdgwfdev4kpssy+ovCLglTwJ6SUOXLRMTn3S0pz10x5bTC15u11cl30Nk9Jrzr0xP8nKHV48h0J54cVJqaeI9qlm1gjOB1k0QhXwFP2ObcgC+t0r1ti6P/KzA/SXo/IN0SMFjq9ZuIrLr9A1akw429QOUM5B5UEmUvRmTAe60bM1yWrYMPpCFXI/q4RWB0CWq9rGRvUP6uaKQ/IG34bkpJkt3ViM6N0IEnJx4orp2D+v9I4duJatlZ7BHsJdqYiWJ5E3tNwoeEVCoY2xmtrCoYT1IXAPjUwBP+UKQvs1zFNa06XEMiWsMnUtTlALgZWDlM1hWo28GbMfiUPvgdt/o7pfRflcM/cqANpekRiR1c1GDZum7sabObAKJGAiHtLqegHQC9DUL/UQuHsMQHtHGasfv6lruN/s+g4LNBZ8IJFEA+CQPYmvAjW3wuu8Em2BOLwXwZlFGfMPA9gYvg7ivh8mmQV+jMZCwMKS/nJW8SwW8HazdipRdLct7AJkj40MeOWg3QPwIrXSSc0ovjYScZv/py9VCo137HQyowz7J1BdefseFZXLWQTNmHRNUYHKOArrc1Ld3Tuhw9+iusRlGgUILvkENzEP00tfai71AkRVocwA0+urjxvsVO2au4HpYHBLzTXC5UGH9S7qA+0j8DO6I9fVCSn0La27FII/Qbem53DIga6BQMqMD2zzG2vQobkLxi4skm+av45lv9+w+7UIYVvifAu/74qdQWePGbEC300M0D1rtJrtekESHiIQhLqFk1c20F3oyQ/1MLh3NF2TCvWlpMoB11+RF/m885P9EFQfa2INC4bf0oSDykNB1c7ThJKog6qH/NiRykcxtxc2BiNWPBGQs03Gqy95X23pK3XS3Id6JoO1j/fb+rDEHXOWYCdF5p3D/MD/9Mrf9+0tmM5+43b29zk5/TG88Wc7/BuItg64CzAGDFRsPDYMwC4GPHTsRewpMoEvw7U5wNabW1NhdM5YstTBJvmeCl7EufAXYGheRUrgK3lAcnaBjUtvX7A1YCYrVzG4BI+Fs3u211IAOjITr3qxz1iQhYAzxcC97nqQcC/gNJ/ksGu21JMSvl4BgZhY+tDS2kbAZC/0+j2RmMSIBqxviUr8mBMw5m0irMJ0A6wqp4q7OS54rtv3SYfwE31V4hYBefEWo9yP7E3S6Ry/zAdvd68APdrcHzIBj1kQVNtfTmSN4Y1lvHcX/BxRMGVgizNziT1a+NL4f1ZGrBBLkAbTppStCqqHPLZhyPiDx3SKmtw205TO2WxMEQqkULr7vCn91BzmndvbHWFAu8GiSrgAZyZNMScbS5iAArlhrh5G4HedwL/wH2E6v+bbD1O455A4uBvlNoAUNKwqPsjk9+loTuhkiXwuigelze5UHCb/AJNKw2cc+G4CfE/Z0ZwVsDXSAOfr9R/gpL/ghGMJOL8BA2mOuKNInxFF6AW/7uErMW8sNkEBOBtXXXEbm30CCTJbxe6EOIbec+RTjqvdUflOP7AfgnkC8nhSIm3neEOmts61kCO/o2RP02eqWjJjzYn3A/WgFSoyAwj64gKr0H3nFCK7pZt2FDmwwcSqB3YBMgY3HXWDAoBqr9PHSGIeh/l/QZXZpL2wpO7AylAwZ87Pce3z6xUVvn4SNt0I8zpte4alIJpNWn8cjfSE4UKTvooupk8qPXRvFrmj6smvX17qSIX9baO7HYIjg6IqOvJIEg3tVQ9qyR25F2fx7JpzrMHwCdjgkYRexElPxR1RDICwMQssAVuoCZADE5CJ9ZJS8LV/rUdEFDlFhrI1yQ+/EEZmII9DDLO54bQvrj5cmbQPfa7cH/UOQXdKzucZ2IOklamgTnaRQuwQ/+x1PS39leFqUqIMbQ9x6YH8xs9TiGTviU6lvwehYNuM1i85I+gNg8DiEuTIIk2iOce93t0LQ0udyF6JpSw2dw9G1nJVmKfxT36xJryH6PzgQR9qRD1Mm5e37Mygzm/LbTyeGse9tUbxKBlqB2FtLmQgRT0XuwlEeSNxcWvzw98AE28vXwWr2FlIrAWsXu9Qf2Q3c/wgIo6RZJ5GQlejmceYZfebOaO8nDj/iTnf8s2C9IEEsxD0K57+JXP2Utf9NInQAnGuzKs458w4LXRbgQ9GaWxz4G11+LwAVYeMNM7iHu6gv4qVhtn2OYKeKRJRdJHF61unu1ms8j/2aR7OYTz6aWX1mXRDFnB7aepsLG4BHvkkwVYqa/DYsRNiB3CDPZ2q5Kr5L8oC6j5ULS3/jzu6tf88tQ1tTXmBhfdwgUwXDbbt33gD8woaq7sVQiLnSMXLTtZzY89fkny98x1N8pSu8ETpNAIhg/T8GIQvlae9NA9hx0Nc/krzNurU+PlTodk7+HO9MBugPzcYk8hFtQfN/X7klPxXMLqKf25wcIYKZhb/Htf+L1Uc18kw5jZOGML5c98ZDc5yHfzmVjvWqAh2URb7rTpwH7Z5Z+n7SJeCIdOVzgdwzy80P8Hd9okBHiZ/rd9S+Vrvw4zFlirKiTK6TcVpw1zP5HqVhBXt6RhPfu3IsNMMHfNPSZVSonE3UuRpsMiGM3OJSv93QnDntYsYtdGVuljAmJA47Bndeazv44WQHWORbVjGCIspejDdhnQEoI5OYlcXg5yt52/BHhWJF2Rgxn5H7RStg/JEAf9XnV5j1UAfm2Iy+qgJmEmxTPRFm9jxx0wK5FwlHNEHBPdTZ53Mfs/p00dG2Ren4MbqsBCHPX40CcaD98IfZyAX/LGkYN+CRygtyrER/0WGlb84sVrjlknK7HuCRx0us3BOkONLiBYUCABPNb+cChaP1nBEzlW6DhhQp4wS7EaP8jKzkYuZbKviVem6ZHQsCk7QpfziL22v/or/9J1/1wUns39AYhbg+CwWbwRuSzsQTe07J0eMfvMWHVtaiDsBwCaUJapcqMVu/+bgG9YOOvJ0rvKPZQBrhYhc4Z5hMKxupj1xvFyWmg1W5N56lDJHzoDx/cuAshRzC4RgMiLb4Q2pN8r9bnJc+XUvwe3YZ5fcMVHyusfcuXdpv27i51WA0lbuZsfK3s5de9lWW9zXCCmTWIWhI18QtJZ9RNj1RbAC/ACLbCUo/Cit3JZCjjtKR+f5zdBJtOH2uWGr47tDtauNpKbom3Vu6n4oxtJhFDmzaT2pc62ZPu0gKZ4cnId/Bp195CRRtJRKMX3+4KNbD9NDEARUw+Dj82NV0k8VggVL8EZM8rwKmwWWb4ZiA9mmtNR/6rbulcqybAyYcAajMrvmsCHZJlu0CItUtWhsU38uDA04ET8wqzujLFgSgRRzt+kXEaAKwDm59pL/0Y4byu6kKl7cTK+UR9vb7pvG1tF02qxaRg1uiHnx+g7wOFJdw86CMbIvQEdeeHfeLxFBSPJn5VXZvyXLVsJVZjFpf/G5N9TGEn4xIAIx1aZlnqNx48+fxpszhYt1rUyHKHyqS/reuRCO8KEKE/+p90d4cP7dOZGBZrAe4Q2Cr6VoWFGp7KU8jzB6QbTf++mX28Qt7b0RpHxG638hMdZDlOSXXCsLeIhHkEgDBnDc48xzage9HPIxbGocP0yslbVL0Ed92bnx3d/O9vKImgbfPx20LzQCP7f6r+b/H2tmDTlvc+6g0PHKeaeAe5lUU2I63NVlYI5Hba+5RBXfNRT+s/tQ4/PTEt6013TMhfYY1q4O1CPEUaPZSt/QOqj9rMG3KYH1yhRG/UXcb6yZcW8U+k+wPZPCgBlgpNu8Kf+VLERKyNT9vbszywFAMfMpx9lkOsgwtg4j67egVCDgb+ZEV+Y3qxbUuniUxWX3sxPzIPegZS/ka7kue5Y0IwTZu5WqyB9RSCfE3Uwk57704/vV7o8av3lyOVAoQ+jppahwoMNvpxOGpVqrkEMMvAXy4/1nLZ7CXbF+Kq4DobenxfVH8/pClZz8kcJjJSt/V/IWS/l38JjraIQDwVzDZtH9eDrv81QfiKDZ1jLt12E1ftzmRWhx30rpGsWMCynxugBxI8c3BRcxANJ0r34OFhMkV49Gt40u53T1vkZujkMataE3APzs1g0F8IXsmQDntQsdKFNf6iGH8VLQGmiW3JPBuidQduZTq7OqgW5JykjNnmiYjhbLj8+P7cqCWZYZRrkQTaRDf45QL5RUW9XKQDYn5MF6gY8ryV/nXW3qQrGXcQEKwbvgo4z6HJe/l20BOgwI4GgQJQVMNVFiLM3ZsX3olzj1B2we3+Guo/EO8csQZWY33MdXWPW08uYR5nM+10sH+4/+NzncE/GNbn6voapCiKV4hwCWxfwQ78q7g/B6aP81fbEJ+wCzml/1fZcKYdX5lgUa+LB/huzhEU6bsC/HuPnLhb8Wg6ni/HtV9Ygzwe4IyOGaVdivTDbEOW8wcpQLHx/7eC3Zi8sy8oXu5DhE+kw1u06LV7AqFiBTzxumkfMOCJAaDW1i2H8GXwYpRK1uBaofc2xGWoiG1SfQOZZd0xdeJz8d58GK/YijySB0J9Q+cPTWd/fav6mWhmSO8Q1NbxYhNAcb578XuSsC1uvGTGXkoqnwE2LrPE4WXsNmR+dr37NhPqTXwkhI99/qiruLWDhPRfke3BzfdO0Ym4QFzArH8aMPeu75kh1CseVwnsv8eZgrp91VD2VNU2J07EI+ZuhsZro1D0FpfMsrN9T7l9p9GKTy9r7nBy5t7G3PJk57ic3KRV0fbnLkfXYjF0cMEtFJzX6tUctEsk76FuiYm6EKzekXpHANhG2gts8KgF2qDT9Ady9p3FJLXcvD25D//CQrhEA4ctzFtu/O1u7KgeZ1Lgehq0AnjThaOUIIg7oyTm6DQFQGxYkfvTSD5z57MAe02y8MhnHbc3kWCVWgQS5KFidDa1hijkDgK9HylNiIkH7XUrO8mGx+CxPLJ6RBdr/s20MPBsaIkt9iU5tym3LEP0dJx732kMJwDPoVwVGRLds0r/XgQ5tHsywG8kAgXM0DB7PeFzbWyWa93IoiNSjCBLB+zoOu2+108JuNch6SnYLid74PzEj7llBoIHpx7hDqyxHrF/GasXOcNsJUiWOCPPptVgZcrbrM+/gYSTsRQGWXfwbi+2QpryYDX91ZRFe+c74jbKkPWQeYJdeasX+669/9kssmTPRZwQeXKLpE1E+wMyRDnkcUh+wZGLtPCR7U1wokVAtb7GMvgxlM9qyhlaafSIiZSV2vD+PkAeQIjhlvNRwBAevJgfJOo8qbpPQ2lV3ymUV1TQolwR8JBjKHETgw/91SRAJYKWvUwY46fq3dmcPUTKvlFYHq4cWmVrkV/zqAmy8WLPDahcp4/cpPwdQXMEimgoAXgeHsB/4wcD4WgpYL2kvse//ZIdm06Q86YrrHN/K2SfRJ33m8q3c8ZOC98HW3tg6JanGyYpF7dQgLGiKVfQ9BSfnsWrmyqiJkSrmImzcgVGKVKYrTVWN7tf6d09g6JtyFuSLqhgFsKE9Fy0wFs608u58BMfHhXUar/Ce5muvzisF6JoXe2fcbJTln4mpowiRCwa1bKE6YQTUT9l2z2PjQjcg7OFOC2z8RtLwKey7nwpOL7UIOmIcqMA0iv93CeLhhdhHK4m+WVcKc6sqRqPbXLI16EKsbTpOrc4BMRmvPYq2zwSQVf6zmEllfa8DyVodxwKuwDoOxBniJSY0GaSTDsOqaQq/TpWPIHx64a5xoLT7VUtdG8H8OA3t0HiED0CijKwqttKb740UfZbUfUqGDsNpefiSl7rr/f83Q50h3RzmP+FgiNLqYstIw1HsxCxO+NEcqIwD1RLyafv9PRS1ILpg6J3x9QLGncu4++SB34Fv9pKDJ2lVkflsOoIdszZhLGgK6yT3sT6qIAYAGSBuEik+gu6XOLEgRo4G9MPE8n3jPXHO7aczYZ1+58G+f9MLf5MHd1ldxDeLWLZJoN9pgofnfxs6YhJmWY95DHASjIJ7z4lgpx/SPVFkL0J+49CDoRHdmCHKHKzSLUtPev6OAMuUMQEEHouvSjVNk/k3u7co8aJ+6ADVeEupccQgcHC7UHvmhdNBOLdkMUixyPyK5y5ExMa1LU8oJ3sOnIx+RekN9rAOLaHYPY+Mg+Y7XM8dkgU5p0NAOF36Npi5F2nrS0C9fUadVLAZStsYtK4z94LmF/r8P5vHAT/Fou9Tm8cbjNGvPSpfGe9jhgGmhEpo965JlCczvY8rexaSSe7OVjwZnN2Ob0XkI0+vIwpbCs8lTFWA3WPBZ+j2YdrQXUIbCB4f3E+ES1oGFtWgKXRWKbVP8KnH6tCcoS3ie6H7TTq8e/HEl2l9buU/IptFZByo+5URfMLrQ3UGn29p2sMOyh5u9PYYuA+tOC9Dtsn0O61GrW8Vd1aH6ESfgC5Jg/P8EeGoNSrO1RuOKZ6QOKuKyDdGpj3XS1dR40xjXig7TSGmF9BUEK49IG27ZCocDx5yYHgIKBh8yjbftWO9QPkIibON4Mkgr6TQvea8SNccZVMwuqhXXh1GcPOknL/us4J3nxgC/7gSJD6ZPnuEYD5h5xabgNFEADolRV4z8cp5UeJB0vLK0bCTjKuGoBUQPwToZ9JDn5+w5NxIp4QtgLQBtgfDq1Oc+biHviY+Jm56YXtd9rtk2tlOP76Fb93EUwCcuET2W7HdYPAfxuz11rhA9bgJiSxErg86pGuTrrkL8nelqi1o1VcikcTFPFpXBsQkF9hrfTG5MedxuuME2ltj2r/X8zXK+ZOiW1l5EdKm0wYA6zzCzH/b+cGOyASKNKByGzhU+dk/DSiX2v6GbD0sUznKsJdgSIpDB5vsOUmpSXMKxhQJdBh2zQB9Uga2d7mF1i5Z8Pb/mg0GVkuNZFeFdf6/sQsRJ50cShX0xvFi14EdTAyK5xklct0uG9dU9Ly1BB7e4OdFA2kzjJ4+m4cGSTZsV7nWyCf6oBZWxqinVt+YsTvf6sQA1rUNjuKCtq0KP8EGoOrnXterJwiZH5WDOMJ9wiaTF4E1V6uuU/1KwyzJ+H1nMWLaG9MzrZDB0QJOUnUSxKEth9LU1tb7gYILPvJutypcbbUg/cb8KOPnEjRaCOkwJVQYECuiICK6u6V6FnMA4Qdf4LKiO9CPrEHjf0QCB60rN/YDmrSfSJweSDouFYaper4DVl9KMj8Qq4nhIkrzSCV1VtB8Pv6oXTxphryWz16RTVKqPbbKq9zbQasDtcKWRE9WvP3FNcsICp2kRWQCpSzS+z4+Er1rJgNglbTAWRqrATd8ElRNLkfMfFJWHPwNMPW7vUSOpc9im7UGfizlYOdvT787XWsxMF36s1xPyQov0uMDNuh7HVeyHWziyzKJnJFH1zyJG7twS5yiydQvr+9XtYK/mjNWUEdhgM3TJsWQEK3aaE+HqwUhLE1b65h42a1E3HMqoXuC4BzlnNuEIgryVdgYucd4NsTHd+tf+jBWV+6h6kT2CgOBmdI7gEfBrIYkOCO9tZGY+K770tcEjoG+l/rLT2tDByN06xhRUokM4Ltw8U/fNh/ydTjO4JddSFJ0n6Z9SMiz3lreKURYDM2Z+Szp9+zXvKr6SE29NRrJAGbmRjkSxi3sOErHFrB10tJ2uuT+/tem+j2qexl1P1B2DlgxMa8kS4WHKFWv0vqTQxY7YqnQN8jE+lmv3woeUknMmJciOh8HaLQ2A4uHN+oXYqBkyrckpNz2iLo5vZD/nuEEs/JWzZsCcp2U8YtsPcGQNdIOqvcZRD40+RjBs4WmDr7pU77XhyaIrC93dqsR+qa8BHQOWj4Bu7/Ha59bpCbhRoXY5nTHcgXGvNW2VGXpouirMtJDL3cggbY4AV6rYdtSbnCb2FR0Z3oEVYPa38SZH/o+79XTKl48AVc9BeBWAJbggJXJboVa3PUkSLquk/t1LtVD19MizUfx5LVJ+bJeSq5krVfq1glKB5TIifOV/Do4YI96WDkPPZoWbriIDEdfqy828yhXsnn3/Q6xwJvxVRu4ckHYGnN8zaBRAdlIQwaphWujvdJ4yQCnsPlge7wXDKQuPB5N5wTIyBk/4aw/x/R8SmxQAIM6p4hOxgaYEqGMRpnHcImrDOAMzoXe5VuTKeSPwTmd9FAoKsDOcbGwJsRslfufhCPDSOeWxn4MGty5kg1UIKiP9KtE0xsFPeMLKY0a93YsRVF6su0Tt99uEIYYhogYODAIeFhKqEoyScLyLpjtsnsKTisrwea2HklEPbCjoHgxYi/aPGvA4ZvW8U1dmnMPBgKzwPWT0KUDrRhLPZrT5vB4pMbfon/pNjubIqSAql2YwbQQ66PYVPKvacgMpbKeSS7HSboMBqsLqOFLRlY6bT9QfjaHB7bGfcHQrij1HeGzjphnmbYO359jhvWcLnotM4nsaKU84N3l6nyqRVAQ2K1lrzE659W4Y8ff/hhirkxkgauyvgHNf5Azu8xxk+geLrsjEjx7wK9Z5DodQgqFhp5dO0L4xmvV4M0Y0SFL0OEAVJhhZCKKOnUEM+8TXV/ijaeWGRfwFcNXeQQ4Y7jPytH+ZKzujr6KtApadQaVPlBtAUtg9thT+0kGoo/CvMwOHLTWLuQAvZKzCXc2eFg388gR0yblNUY5JXJ0oFq8N6Et7LKFG367qbWxTUnt3vgemDfAeCT3iMX9+ixihTYoJQGQduFd2K61cIwIDy42PwyyfBAlB69X7pGJWNsTubeIzIBLt1b4a6OQB8ptWFIGIquvVlHu0wqhWx6QJPCQW+8z2h0mDaBT+D9Wddq+oAV60yhIgprTSh7klj8n15U6kkIEZluuJjvLpLZU1QoduLnoIodg37XTJlN/Y0gfKIMzYFZ03d5Wt7iluXVifzY6pDCEoLJ9wOz5Hy6CR/+zuPZFZd4t60NpSxXp6rd3nWq2NfD+YRwSdCNRPK6Lu8LkjZpvlgn+wl0xjLLDD1ixtN0kEMsMAhr8NFsCh6wXAOvrUOc0oEDDrlq9fZH0o8qXnYcv+cXGJweDpW6T2+Lt5q9nFKfv5/JnuxsfcdFm4RMa+wwv/5WLaaPCuv93AxVUQE4R4hKhMQ0H+TkXrcoWciBXUUSWJatVI4SzzvRkzb5PRI+wBz2lOju72rUh1j7mdyWptDkPB/q48dgfBzSCRDyLK/iwy+4+Ndx/I5XmXXV5dlkcnObFaHFJvI5aKgJzGYQ6qpcZ4zooB37BkE9QnAQ5rfxPDVE0hJ2oN6rBryoUXU3OiuuHV/IygkyxwkqeK+YUcsBo5CdWKXw1IC1oZd3U4uKEx93sE1J80d0cKwYmHeqt4jBHVC3p84ObsRrrlbAlJtJcKYXRdj/HwATFUYLcKM1oAAAAABJRU5ErkJggg\x3d\x3d").then(function(b){a._noiseTexture=
new n(a._rctx,{target:3553,pixelFormat:6408,dataType:5121,hasMipmap:!0,width:L,height:L},b);a._requestRender()})}else p.warn("SSAO is not supported for this browser or hardware")};b.prototype.getQuadVAO=function(){if(!this._quadVAO){var a=new Float32Array([-1,-1,1,-1,-1,1,1,1]);this._quadVAO=new q(this._rctx,D.Default3D,{geometry:w.Pos2},{geometry:l.createVertex(this._rctx,35044,a)})}return this._quadVAO};b.prototype.disable=function(){this.getEnableState()&&(this._enabled=!1,this._quadVAO&&this._quadVAO.dispose(!0),
this._noiseTexture&&this._noiseTexture.dispose(),this._blur1FBO.dispose(),this._blur0FBO.dispose(),this._ssaoFBO.dispose(),this._ssaoFBO=this._blur0FBO=this._blur1FBO=this._noiseTexture=this._quadVAO=null)};b.prototype.setAttenuation=function(a){this._attenuation=a};b.prototype.getAttenuation=function(){return this._attenuation};b.prototype.setRadius=function(a){this._radius=a};b.prototype.getRadius=function(){return this._radius};b.prototype.getFilterRadius=function(){return 4};b.prototype.setSamples=
function(a){this._samples=a};b.prototype.getSamples=function(){return this._samples};b.prototype.computeSSAO=function(b,c,f,l){if(this._noiseTexture){a.assert(this.getEnableState());var p=this._rctx,h=f.width,n=f.height,k=h/this._BLUR_F,e=n/this._BLUR_F;this._ssaoFBO.resize(h,n);this._blur0FBO.resize(k,e);this._blur1FBO.resize(k,e);k=1*h;e=1*n;p.bindFramebuffer(this._ssaoFBO);G.set(b.fullViewport,this._viewportToRestore);p.setViewport(0,0,h,n);var d=this._programRep.get(8>=this._samples?"ssao8":16>=
this._samples?"ssao16":32>=this._samples?"ssao32":"ssao64"),g=this._programRep.get("blur"),m=b.projectionMatrix;z[0]=-2/(k*m[0]);z[1]=-2/(e*m[5]);z[2]=(1-m[2])/m[0];z[3]=(1+m[6])/m[5];m=0===m[11];d.setUniform2f("rnmScale",h/L,n/L);d.setUniform3fv("pSphere",8>=this._samples?A:16>=this._samples?J:32>=this._samples?I:K);p.bindProgram(d);d.setUniform1f("numSpiralTurns",this._samples<O.length?O[this._samples]:5779);d.setUniform4fv("projInfo",new Float32Array(z));h=1/b.computePixelSizeAtDist(1);d.setUniform1f("projScale",
1*h);d.setUniform2f("screenDimensions",k,e);m?(d.setUniform2f("nearFar",b.near,b.far),d.setUniform2f("zScale",0,-1)):(d.setUniform2f("nearFar",b.near,b.far),d.setUniform2f("zScale",1,0));var q=2*this._radius,n=F.dist(b.eye,b.center),q=20*b.computePixelSizeAtDist(n),q=Math.max(.1,q);d.setUniform1f("radius",q);d.setUniform1f("intensity",4*this._attenuation/Math.pow(q,6));d.setUniform1i("rnm",0);d.setUniform1i("normalMap",1);d.setUniform1i("depthMap",2);p.bindTexture(this._noiseTexture,0);p.bindTexture(l.colorTexture,
1);p.bindTexture(f.colorTexture,2);f=this.getQuadVAO();p.bindVAO(f);p.drawArrays(5,0,y.vertexCount(f,"geometry"));p.bindTexture(this._ssaoFBO.colorTexture,0);p.setViewport(0,0,k/this._BLUR_F,e/this._BLUR_F);p.bindFramebuffer(this._blur0FBO);g.setUniform2f("screenDimensions",k,e);g.setUniform1i("tex",0);g.setUniform1i("normalMap",1);g.setUniform1i("depthMap",2);g.setUniform2f("blurSize",0,1*this._BLUR_F/e);g.setUniform1i("radius",4);g.setUniform1f("g_BlurFalloff",.08);g.setUniform2f("nearFar",b.near,
b.far);5E4<n&&(h=Math.max(0,h-(n-5E4)));g.setUniform1f("projScale",h);m?g.setUniform2f("zScale",0,-1):g.setUniform2f("zScale",1,0);p.drawArrays(5,0,y.vertexCount(f,"geometry"));g.setUniform2f("blurSize",1*this._BLUR_F/k,0);p.bindFramebuffer(this._blur1FBO);p.bindTexture(this._blur0FBO.colorTexture,0);p.drawArrays(5,0,y.vertexCount(f,"geometry"));p.bindFramebuffer(c);p.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3])}};b.prototype.setUniforms=
function(a){var b=this.getEnableState()&&this._noiseTexture,c=this._rctx;c.bindTexture(b?this._blur1FBO.colorTexture:this._emptyTexture,6);c.setActiveTexture(0);a.setUniform1i("ssaoTex",6);b?a.setUniform4f("viewportPixelSz",this._viewportToRestore[0],this._viewportToRestore[1],1/this._ssaoFBO.width,1/this._ssaoFBO.height):a.setUniform4f("viewportPixelSz",-1,-1,-1,-1)};b.prototype.bindAll=function(a){a=a.getProgramsUsingUniform("viewportPixelSz");for(var b=0;b<a.length;b++)this.setUniforms(a[b])};
b.prototype.drawQuad=function(b){a.assert(this.getEnableState());var c=this._programRep.get("showDepth");this._debugQuadVAO||(this._debugQuadVAO=new q(this._rctx,D.Default3D,{geometry:w.Pos2Tex},{geometry:l.createVertex(this._rctx,35044,P)}));var f=this._rctx;f.setDepthTestEnabled(!1);c.setUniformMatrix4fv("proj",new Float32Array(b));c.setUniform1i("depthTex",0);f.bindTexture(this._ssaoFBO.colorTexture,0);f.bindVAO(this._debugQuadVAO);f.drawArrays(5,0,y.vertexCount(this._debugQuadVAO,"geometry"));
f.setDepthTestEnabled(!0)};b.loadShaders=function(b,f,l,p){a.assert(null==b.samples);b._parse(c);f=new t(p,b.vertexShaderShowDepth,b.fragmentShaderShowDepth,D.Default3D);var n=b.createFsSSAOSrcObscurance,h=new t(p,b.vsUVQuad,n,D.Default3D,{NUM_TAP_SAMPLES:"8"}),k=new t(p,b.vsUVQuad,n,D.Default3D,{NUM_TAP_SAMPLES:"16"}),q=new t(p,b.vsUVQuad,n,D.Default3D,{NUM_TAP_SAMPLES:"32"}),n=new t(p,b.vsUVQuad,n,D.Default3D,{NUM_TAP_SAMPLES:"64"});b=new t(p,b.vsUVQuad,b.fsBlurEdgeAware,D.Default3D,{RADIUS:(4).toString()});
l.add("showDepth",f);l.add("ssao8",h);l.add("ssao16",k);l.add("ssao32",q);l.add("ssao64",n);l.add("blur",b)};return b}();var z=G.create(),A=new Float32Array([.186937,0,0,.677503,0,0,-.782832,.128424,.557187,.248064,.460317,-.659755,.062892,.918659,.312829,-.241031,-.814826,.224206,-.642866,.132138,-.45016,.145727,-.590568,-.626141,.005017,-.002234,.012668]),J=new Float32Array([.186937,0,0,.700542,0,0,-.864858,-.481795,-.111713,-.624773,.102853,-.730153,-.387172,.260319,.007229,-.222367,-.642631,-.707697,
-.01336,-.014956,.169662,.122575,.1544,-.456944,-.177141,.85997,-.42346,-.131631,.814545,.524355,-.779469,.007991,.624833,.308092,.209288,.35969,.359331,-.184533,-.377458,.192633,-.482999,-.065284,.233538,.293706,-.055139,.417709,-.386701,.442449,-.301656,-.836426,.408344]),I=new Float32Array([.837372,0,0,.723531,-.467287,.034157,.169582,-.31169,-.881801,.696236,.455215,-.204568,-.304514,.528086,.626381,-.053116,.222507,.037523,.199755,.311291,.916799,-.681552,-.516264,.501792,-.37127,.021088,.737477,
-.029503,.209188,-.95298,-.573731,.009962,-.154202,-.257345,-.905958,.282747,.370779,.527867,-.669424,-.601758,-.191278,-.708243,.271796,.782684,.535565,-.006867,-.015312,-.017276,.419958,.265628,.233036,-.543898,.554747,-.174055,-.079242,.053475,-.099539,.372042,-.339267,-.357362,.015781,-.011352,.042707,-.340564,-.272507,-.067725,.799249,-.127948,.586808,.450015,.01965,-.416454,-.506524,.323229,.206546,-.087316,-.311097,.466049,.146374,-.34528,-.045904,-.152614,-.926686,-.287529,-.665726,-.032904,
.246643,.248703,.637193,-.062541,-.073706,.495925,-.315143,.05946,-.116042,.075586]),K=new Float32Array([.186937,0,0,.605726,-.313457,-.097616,.003541,.781245,.283011,-.225029,-.373279,.274442,-.047511,.04992,-.226365,.627629,-.623617,-.463628,.133094,-.318299,.528128,.262035,.100234,-.09012,.178335,-.426972,-.666048,-.27306,-.207352,.05514,-.613649,-.063395,.060608,-.283391,-.41382,-.087565,.136768,.506126,.484137,-.593808,-.344603,.453164,.675326,.124799,-.697865,-.33502,.411337,-.09337,-.15271,
.002908,-.063582,.366733,-.699739,.401148,-.519536,-.585625,-.508413,.106482,-.428709,-.260221,.012847,-.118806,.016962,-.188182,.49945,.452364,.586617,.722539,-.23302,.111295,.202827,.066695,-.036503,.315842,.896467,-.039109,-.270116,-.080062,.613435,.508787,.538656,-.352275,.566869,-.666275,.887876,-.138341,-.434135,-.444711,.269156,.119506,-.029457,-.077316,.754474,.274125,-.13876,-.37082,-.73268,.332723,.568545,-.203992,.878922,-.430778,.541154,-.546752,.11786,-3.93E-4,-.083318,.059333,-.341406,
-.117017,-.318568,-.262425,-.457913,.848753,.89229,-.30157,.322416,.742328,.032262,.643827,.048091,-.078044,-.49908,.064858,.549944,-.796252,-.230688,.88978,-.010153,.397241,-.27645,.405666,-.46593,.131187,-.600166,.333834,-.078219,.73837,-.870169,-.411658,-.222175,-.492421,.741454,.293757,-.591244,.389112,-.388324,.792346,.578552,.088459,-.121858,-.437241,-.472535,-.374835,.302427,.721264,.057485,.204085,-.126575,.510325,.481492,-.579888,-.29411,-.82136,.156404,-.819717,-.042466,.456573,.079884,
.07019,.179002,.220279,.970222,-.088025,-.299911,-.234627,-.820794,.912112,.243306,.317869,.241336,.161841,-.721568,.301135,-.635993,-.0939,-.514731,-.089673,.850964,-.905087,.314604,-.098397]),L=64,O=[1,1,1,2,3,2,5,2,3,2,3,3,5,5,3,4,7,5,5,7,9,8,5,5,7,7,7,8,5,8,11,12,7,10,13,8,11,8,7,14,11,11,13,12,13,19,17,13,11,18,19,11,11,14,17,21,15,16,17,18,13,17,11,17,19,18,25,18,19,19,29,21,19,27,31,29,21,18,17,29,31,31,23,18,25,26,25,23,19,34,19,27,21,25,39,29,17,21,27,29],P=new Float32Array([0,0,0,0,512,
0,1,0,0,512,0,1,512,512,1,1]);return x})},"esri/views/3d/webgl-engine/lib/ShadowMap":function(){define("./Camera ./Util ./gl-matrix ../../../../core/Logger ../../../webgl/Texture ../../../webgl/FramebufferObject ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ../../../webgl/Util".split(" "),function(x,r,k,a,b,c,t,n,f,q,l){var y=k.vec2d,B=k.vec3d,v=k.vec4d,w=k.mat3d,D=k.mat4d,F=k.mat4,G=a.getLogger("esri.views.3d.webgl-engine.lib.ShadowMap");
return function(a,k){function p(a,b){B.set3(a[b],a[b+3],a[b+6],xa);return xa}var z=k.gl,I,K=4096,L,O=new b(k,{target:z.TEXTURE_2D,pixelFormat:z.RGBA,dataType:z.UNSIGNED_BYTE,samplingMode:z.NEAREST,width:4,height:4}),P=1,U=2,N=[0,0,0,0,0];this.dispose=function(){O.dispose();O=null};var R=function(){this.camera=new x;this.lightMat=D.create()},S=[],T,V,h;for(T=0;4>T;++T)S[T]=new R;this.getIsSupported=function(){return k.extensions.standardDerivatives};this.setTextureResolution=function(a){K=a};this.getTextureResolution=
function(){return K};this.setMaxNumCascades=function(a){U=r.clamp(Math.floor(a),1,4)};this.getMaxNumCascades=function(){return U};this.setEnableState=function(a){a?this.enable():this.disable()};this.getEnableState=function(){return void 0!==I};this.getDepthTexture=function(){return I};this.enable=function(){this.getEnableState()||(this.getIsSupported()?(I=new b(k,{target:z.TEXTURE_2D,pixelFormat:z.RGBA,dataType:z.UNSIGNED_BYTE,wrapMode:z.CLAMP_TO_EDGE,samplingMode:z.NEAREST,flipped:!0,width:K,height:K}),
L=c.createWithAttachments(k,I,{colorTarget:0,depthStencilTarget:1,width:K,height:K})):G.warn("Shadow maps are not supported for this browser or hardware"))};this.disable=function(){this.getEnableState()&&L&&(L.dispose(),I=L=void 0)};var ca=D.create(),Q=D.create(),e=v.create(),d=Array(8);for(T=0;8>T;++T)d[T]=v.create();var g=B.create(),m=B.create(),u=y.create(),C=y.create(),M=y.create(),Y=y.create(),W=y.create(),da=D.create(),fa=B.create();this.prepare=function(a,b,c,f){r.assert(this.getEnableState());
D.multiply(a.projectionMatrix,a.viewMatrix,ca);var l=f[0],n=f[1];2>l&&(l=2);2>n&&(n=2);l>=n&&(l=2,n=4);P=Math.min(1+Math.floor(r.logWithBase(n/l,4)),U);c=Math.pow(n/l,1/P);for(f=0;f<P+1;++f)N[f]=l*Math.pow(c,f);D.inverse(ca,Q);D.lookAt([0,0,0],[-b[0],-b[1],-b[2]],[0,1,0],da);c=a.viewMatrix;a=a.projectionMatrix;for(f=0;f<P;++f){var q=S[f],l=-N[f],n=-N[f+1],l=(a[10]*l+a[14])/Math.abs(a[11]*l+a[15]),n=(a[10]*n+a[14])/Math.abs(a[11]*n+a[15]);r.assert(l<n);for(V=0;8>V;++V)for(v.set4(0===V%4||3==V%4?-1:
1,0===V%4||1==V%4?-1:1,4>V?l:n,1,e),D.multiplyVec4(Q,e,d[V]),h=0;3>h;++h)d[V][h]/=d[V][3];B.negate(d[0],fa);D.translate(da,fa,q.camera.viewMatrix);for(V=0;8>V;++V)D.multiplyVec3(q.camera.viewMatrix,d[V]);B.set(d[0],g);B.set(d[0],m);for(V=1;8>V;++V)for(h=0;3>h;++h)g[h]=Math.min(g[h],d[V][h]),m[h]=Math.max(m[h],d[V][h]);g[2]-=200;m[2]+=200;q.camera.near=-m[2];q.camera.far=-g[2];l=1/d[0][3];n=1/d[4][3];r.assert(l<n);var t=l+Math.sqrt(l*n),w=Math.sin(Math.acos(c[2]*b[0]+c[6]*b[1]+c[10]*b[2])),t=t/w,l=
d,A=t,F=w,w=u,G=C,I=M,J=Y,t=W;y.set2(0,0,ia);for(var x=void 0,x=0;4>x;++x)y.add(ia,l[x],ia);y.scale(ia,.25);y.set2(0,0,Z);for(x=4;8>x;++x)y.add(Z,l[x],Z);y.scale(Z,.25);y.lerp(l[4],l[5],.5,pa[0]);y.lerp(l[5],l[6],.5,pa[1]);y.lerp(l[6],l[7],.5,pa[2]);y.lerp(l[7],l[4],.5,pa[3]);for(var O=0,T=y.dist2(pa[0],ia),x=1;4>x;++x){var R=y.dist2(pa[x],ia);R<T&&(T=R,O=x)}y.subtract(pa[O],l[O+4],ma);x=ma[0];ma[0]=-ma[1];ma[1]=x;y.subtract(Z,ia,sa);y.lerp(ma,sa,F);y.normalize(ma);O=F=void 0;F=O=y.dot(y.subtract(l[0],
ia,E),ma);for(x=1;8>x;++x)T=y.dot(y.subtract(l[x],ia,E),ma),T<F?F=T:T>O&&(O=T);y.set(ia,w);y.scale(ma,F-A,E);y.add(w,E,w);for(var R=-1,aa=1,x=A=T=0;8>x;++x){y.subtract(l[x],w,na);y.normalize(na);var ea=ma[0]*na[1]-ma[1]*na[0];0<ea?ea>R&&(R=ea,T=x):ea<aa&&(aa=ea,A=x)}r.verify(0<R,"leftArea");r.verify(0>aa,"rightArea");y.scale(ma,F,wa);y.add(wa,ia,wa);y.scale(ma,O,ya);y.add(ya,ia,ya);Ba[0]=-ma[1];Ba[1]=ma[0];G=r.rayRay2D(w,l[A],ya,y.add(ya,Ba,E),1,G);I=r.rayRay2D(w,l[T],ya,E,1,I);J=r.rayRay2D(w,l[T],
wa,y.add(wa,Ba,E),1,J);l=r.rayRay2D(w,l[A],wa,E,1,t);r.verify(G,"rayRay");r.verify(I,"rayRay");r.verify(J,"rayRay");r.verify(l,"rayRay");I=u;l=C;w=Y;J=W;t=q.camera.projectionMatrix;y.scale(y.subtract(w,J,va),.5);ba[0]=va[0];ba[1]=va[1];ba[2]=0;ba[3]=va[1];ba[4]=-va[0];ba[5]=0;ba[6]=va[0]*va[0]+va[1]*va[1];ba[7]=va[0]*va[1]-va[1]*va[0];ba[8]=1;ba[6]=-y.dot(p(ba,0),I);ba[7]=-y.dot(p(ba,1),I);I=y.dot(p(ba,0),w)+ba[6];G=y.dot(p(ba,1),w)+ba[7];x=y.dot(p(ba,0),J)+ba[6];J=y.dot(p(ba,1),J)+ba[7];I=-(I+x)/
(G+J);ba[0]+=ba[1]*I;ba[3]+=ba[4]*I;ba[6]+=ba[7]*I;I=1/(y.dot(p(ba,0),w)+ba[6]);G=1/(y.dot(p(ba,1),w)+ba[7]);ba[0]*=I;ba[3]*=I;ba[6]*=I;ba[1]*=G;ba[4]*=G;ba[7]*=G;ba[2]=ba[1];ba[5]=ba[4];ba[8]=ba[7];ba[7]+=1;I=y.dot(p(ba,1),l)+ba[7];G=y.dot(p(ba,2),l)+ba[8];x=y.dot(p(ba,1),w)+ba[7];J=y.dot(p(ba,2),w)+ba[8];I=-.5*(I/G+x/J);ba[1]+=ba[2]*I;ba[4]+=ba[5]*I;ba[7]+=ba[8]*I;I=y.dot(p(ba,1),l)+ba[7];G=y.dot(p(ba,2),l)+ba[8];x=-G/I;ba[1]*=x;ba[4]*=x;ba[7]*=x;t[0]=ba[0];t[1]=ba[1];t[2]=0;t[3]=ba[2];t[4]=ba[3];
t[5]=ba[4];t[6]=0;t[7]=ba[5];t[8]=0;t[9]=0;t[10]=1;t[11]=0;t[12]=ba[6];t[13]=ba[7];t[14]=0;t[15]=ba[8];q.camera.projectionMatrix[10]=2/(g[2]-m[2]);q.camera.projectionMatrix[14]=-(g[2]+m[2])/(g[2]-m[2]);D.multiply(q.camera.projectionMatrix,q.camera.viewMatrix,q.lightMat);l=K/2;q.camera.viewport[0]=0===f%2?0:l;q.camera.viewport[1]=0===Math.floor(f/2)?0:l;q.camera.viewport[2]=l;q.camera.viewport[3]=l}ga=void 0;N[P]=100*n;k.bindFramebuffer(L);k.bindTexture(null,7);k.setClearColor(1,1,1,1);k.clear(z.COLOR_BUFFER_BIT|
z.DEPTH_BUFFER_BIT);k.setBlendingEnabled(!1)};var aa=[];this.getCascades=function(){for(var a=0;a<P;++a)aa[a]=S[a];aa.length=P;return aa};this.finish=function(a){r.assert(this.getEnableState());k.bindFramebuffer(a)};this.bind=function(a){var b=this.getEnableState();k.bindTexture(b?I:O,7);k.bindProgram(a);a.setUniform1i("depthTex",7);a.setUniform1f("depthHalfPixelSz",b?.5/K:-1);a.setUniform1i("shadowMapNum",P);a.setUniform4f("shadowMapDistance",N[0],N[1],N[2],N[3])};this.bindAll=function(a){a=a.getProgramsUsingUniform("shadowMapDistance");
for(var b=0;b<a.length;b++)this.bind(a[b])};var ea=F.create(),ja=new Float32Array(64),ga;this.bindView=function(a,b){if(this.getEnableState()){if(!ga||ga[0]!==b[0]||ga[1]!==b[1]||ga[2]!==b[2]){var d;ga=ga||B.create();B.set(b,ga);for(V=0;V<P;++V)for(F.translate(S[V].lightMat,b,ea),d=0;16>d;++d)ja[16*V+d]=ea[d]}a.setUniformMatrix4fv("shadowMapMatrix",ja)}};R=new Float32Array(16);R[0]=0;R[1]=0;R[2]=0;R[3]=0;R[4]=256;R[5]=0;R[6]=1;R[7]=0;R[8]=0;R[9]=256;R[10]=0;R[11]=1;R[12]=256;R[13]=256;R[14]=1;R[15]=
1;var la=new t(k,f.Default3D,{geometry:q.Pos2Tex},{geometry:n.createVertex(k,z.STATIC_DRAW,R)});this.drawDebugQuad=function(b){r.assert(this.getEnableState());var d=a.get("showDepth");k.setDepthTestEnabled(!1);k.bindProgram(d);d.setUniformMatrix4fv("proj",b);d.setUniform1i("depthTex",0);k.bindTexture(I,0);k.bindVAO(la);l.assertCompatibleVertexAttributeLocations(la,d);k.drawArrays(z.TRIANGLE_STRIP,0,l.vertexCount(la,"geometry"));k.setDepthTestEnabled(!0)};var ia=y.create(),Z=y.create(),pa=[y.create(),
y.create(),y.create(),y.create()],ma=y.create(),sa=y.create(),E=y.create(),na=y.create(),wa=y.create(),ya=y.create(),Ba=y.create(),xa=B.create(),va=y.create(),ba=w.create()}})},"esri/views/3d/webgl-engine/lib/NearFarCalc":function(){define(["require","exports","./Util","./gl-matrix","./ComponentUtils"],function(x,r,k,a,b){x=a.vec3d;var c=a.vec4d,t=a.mat4d;a=function(){function a(){this._context={content:[],near:[],far:[],nearSpecial:[],farSpecial:[],bestNear:0,bestFar:0,bestNear2:0,bestFar2:0};this._boundingInfoHelper=
new n}a.prototype._resetContext=function(){var a=this._context;a.content.length=0;a.near.length=0;a.far.length=0;a.nearSpecial.length=0;a.farSpecial.length=0;a.bestNear=Number.MAX_VALUE;a.bestFar=-Number.MAX_VALUE;return this._context};a.prototype.calculateSceneNearFar=function(a,c){var f=this._resetContext(),n=a.viewMatrix,k=n[2],p=n[6],q=n[10],t=n[14],v=0,y;for(y in c)if(n=c[y],!b.isAllHidden(n.instanceParameters.componentVisibilities,n.componentOffsets)&&n.castShadow){var r=void 0,w=void 0;n.hasShaderTransformation?
(r=n.getBoundingSphere(n.getShaderTransformation(),null,l),w=l):(r=n.bsRadius,w=n.center);var B=k*w[0]+p*w[1]+q*w[2]+t,w=B-r,r=B+r;f.content[v]=n;f.near[v]=-r;f.far[v]=-w;++v}if(0===v)return[f.bestNear,f.bestFar];for(c=0;c<v;++c)f.near[c]>f.bestFar&&(f.bestFar=f.near[c]),2<f.near[c]&&f.far[c]<f.bestNear&&(f.bestNear=f.far[c]);f.bestNear2=Math.max(.5*f.bestNear,2);f.bestFar2=2*f.bestFar;for(c=p=k=0;c<v;++c)f.near[c]<f.bestNear&&(f.near[c]>=f.bestNear2?f.bestNear=f.near[c]:f.nearSpecial[k++]=c),f.far[c]>
f.bestFar&&(f.far[c]<=f.bestFar2?f.bestFar=f.far[c]:f.farSpecial[p++]=c);if(0===k&&0===p)return[f.bestNear,f.bestFar];f.nearSpecial.length=k;f.farSpecial.length=p;f.nearSpecial.sort(function(a,b){return f.near[a]<f.near[b]?-1:f.near[a]>f.near[b]?1:0});f.farSpecial.sort(function(a,b){return f.far[a]<f.far[b]?1:f.far[a]>f.far[b]?-1:0});this._boundingInfoHelper.init(a,f);for(c=0;c<k;++c)f.near[f.nearSpecial[c]]<f.bestNear&&(n=f.content[f.nearSpecial[c]],a=n.boundingInfo,this._boundingInfoHelper.includeNearBoundingInfoRec(a,
n.getShaderTransformation()));for(c=0;c<p;++c)f.far[f.farSpecial[c]]>f.bestFar&&(n=f.content[f.farSpecial[c]],a=n.boundingInfo,this._boundingInfoHelper.includeFarBoundingInfoRec(a,n.getShaderTransformation()));return[f.bestNear,f.bestFar]};return a}();var n=function(){function a(){this._clippingHelper=new f;this._planes=[c.create(),c.create(),c.create(),c.create(),c.create(),c.create()];this._viewProj=t.create();this._view=t.create()}a.prototype.init=function(a,b){this._context=b;t.set(a.viewMatrix,
this._view);t.multiply(a.projectionMatrix,this._view,this._viewProj);a.copyFrustumPlanes(this._planes);this._clippingHelper.init(b)};a.prototype.includeNearBoundingInfoRec=function(a,b){var c=a.getBSRadius(),f=a.getCenter();t.multiplyVec3(b,f,l);var f=l[0],n=l[1],p=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*f+this._planes[0][1]*n+this._planes[0][2]*p+this._planes[0][3]>c||this._planes[1][0]*
f+this._planes[1][1]*n+this._planes[1][2]*p+this._planes[1][3]>c||this._planes[2][0]*f+this._planes[2][1]*n+this._planes[2][2]*p+this._planes[2][3]>c||this._planes[3][0]*f+this._planes[3][1]*n+this._planes[3][2]*p+this._planes[3][3]>c||(f=this._view[2]*f+this._view[6]*n+this._view[10]*p+this._view[14],n=f+c,2>-(f-c)||-n>=this._context.bestNear)))if(-n>this._context.bestNear2)this._context.bestNear=-n;else{if(100<c&&(c=a.getChildren(),void 0!==c)){for(a=0;8>a;++a)void 0!==c[a]&&this.includeNearBoundingInfoRec(c[a],
b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,b,a.getBBMin(),a.getBBMax())}};a.prototype.includeFarBoundingInfoRec=function(a,b){var c=a.getBSRadius(),f=a.getCenter();t.multiplyVec3(b,f,l);var f=l[0],n=l[1],p=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*f+this._planes[0][1]*n+this._planes[0][2]*p+this._planes[0][3]>c||this._planes[1][0]*f+this._planes[1][1]*n+this._planes[1][2]*
p+this._planes[1][3]>c||this._planes[2][0]*f+this._planes[2][1]*n+this._planes[2][2]*p+this._planes[2][3]>c||this._planes[3][0]*f+this._planes[3][1]*n+this._planes[3][2]*p+this._planes[3][3]>c||(f=this._view[2]*f+this._view[6]*n+this._view[10]*p+this._view[14]-c,-f<=this._context.bestFar)))if(-f<this._context.bestFar2)this._context.bestFar=-f;else{if(100<c&&(c=a.getChildren(),void 0!==c)){for(a=0;8>a;++a)void 0!==c[a]&&this.includeFarBoundingInfoRec(c[a],b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,
b,a.getBBMin(),a.getBBMax())}};return a}(),f=function(){function a(){this._clipP=Array(8);for(var a=0;8>a;++a)this._clipP[a]=c.create()}a.prototype.init=function(a){this._context=a};a.prototype.intersectFrustumAABB=function(a,b,c,f){t.multiply(a,b,y);for(a=0;8>a;++a){b=this._clipP[a];var l=0===a||3===a||4===a||7===a?c[0]:f[0],p=0===a||1===a||4===a||5===a?c[1]:f[1],n=4>a?c[2]:f[2];b[0]=y[0]*l+y[4]*p+y[8]*n+y[12];b[1]=y[1]*l+y[5]*p+y[9]*n+y[13];b[2]=y[2]*l+y[6]*p+y[10]*n+y[14];b[3]=y[3]*l+y[7]*p+y[11]*
n+y[15]}for(a=0;12>a;++a){c=this._clipTriangle(this._clipP[q[a][0]],this._clipP[q[a][1]],this._clipP[q[a][2]]);f=!0;for(b=0;b<c.length;++b)if(l=c[b][3],2<=l){f=!1;break}if(!f)for(b=0;b<c.length;++b)l=c[b][3],l<this._context.bestNear&&(this._context.bestNear=l),l>this._context.bestFar&&(this._context.bestFar=l)}};a.prototype._inside=function(a,b){if(0===b)return a[0]>=-a[3];if(1===b)return a[1]>=-a[3];if(2===b)return a[0]<=a[3];if(3===b)return a[1]<=a[3];k.assert(!1)};a.prototype._intersect=function(a,
b,f){var l=0;0===f?l=(-a[3]-a[0])/(b[0]-a[0]+b[3]-a[3]):1===f?l=(-a[3]-a[1])/(b[1]-a[1]+b[3]-a[3]):2===f?l=(a[3]-a[0])/(b[0]-a[0]-b[3]+a[3]):3===f&&(l=(a[3]-a[1])/(b[1]-a[1]-b[3]+a[3]));return c.lerp(a,b,l,c.create())};a.prototype._clipTriangle=function(a,b,c){a=[a,b,c];for(b=0;4>b;++b){c=a;a=[];for(var f=0;f<c.length;++f){var l=c[f],p=c[(f+1)%c.length];this._inside(p,b)?(this._inside(l,b)||a.push(this._intersect(l,p,b)),a.push(p)):this._inside(l,b)&&a.push(this._intersect(l,p,b))}}return a};return a}(),
q=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],l=x.create(),y=t.create();return a})},"esri/views/3d/webgl-engine/lib/HighlightHelper":function(){define("require exports ./Util ./gl-matrix dojo/text!../materials/internal/highlight.xml ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations ../../support/debugFlags".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){var w=a.vec4d;return function(){function a(a,b,c){this._grid={coverageMipmap:null,vao:null,verticalCellCount:0,horizontalCellCount:0,cellPixelSize:0,mipmapLevels:0,viewportWidth:0,viewportHeight:0};this.blur1Fbo=this.blur0Fbo=this.quadVAO=null;this._rctx=c;this.viewportToRestore=w.create();this.programRep=a;this.defaultOptions={color:new Float32Array([1,0,1,1]),haloOpacity:1,fillOpacity:.2,haloOpacityOccluded:.25,fillOpacityOccluded:.05}}a.prototype._gridUpdateResources=
function(a,b){var l=this._rctx,k=this._grid,q=!1;null===k.coverageMipmap&&(k.coverageMipmap=[a],q=!0);if(k.viewportWidth!==a.width||k.viewportHeight!==a.height)q=!0,k.viewportWidth=a.width,k.viewportHeight=a.height;k.coverageMipmap[0]=a;k.cellPixelSize!==b&&(k.cellPixelSize=b,q=!0);if(q){for(b=1;b<k.coverageMipmap.length;b++)k.coverageMipmap[b].dispose();k.mipmapLevels=Math.ceil(Math.log(k.cellPixelSize)*Math.LOG2E);k.coverageMipmap.length=k.mipmapLevels+1;for(b=0;b<k.mipmapLevels;b++)q=k.coverageMipmap[b],
q=c.createWithAttachments(l,{target:3553,pixelFormat:6407,dataType:33635,samplingMode:9729,wrapMode:33071,width:Math.ceil(q.width/2),height:Math.ceil(q.height/2)},{colorTarget:0,depthStencilTarget:0,width:Math.ceil(q.width/2),height:Math.ceil(q.height/2)}),k.coverageMipmap[b+1]=q}var q=Math.ceil(a.height/k.cellPixelSize),t=Math.ceil(a.width/k.cellPixelSize);if(!k.vao||k.verticalCellCount!==q||k.horizontalCellCount!==t){k.verticalCellCount=q;k.horizontalCellCount=t;a=q+1;b=t+1;for(var q=1/q,t=1/t,
v=new Float32Array(24*a*b),r=0,w=0;w<a;w++)for(var D=0;D<b;D++)v[r+0]=(D-.5)*t*2-1,v[r+1]=(w-.5)*q*2-1,v[r+2]=D*t,v[r+3]=w*q,v[r+4]=(D+.5)*t*2-1,v[r+5]=(w-.5)*q*2-1,v[r+6]=D*t,v[r+7]=w*q,v[r+8]=(D-.5)*t*2-1,v[r+9]=(w+.5)*q*2-1,v[r+10]=D*t,v[r+11]=w*q,v[r+12]=(D-.5)*t*2-1,v[r+13]=(w+.5)*q*2-1,v[r+14]=D*t,v[r+15]=w*q,v[r+16]=(D+.5)*t*2-1,v[r+17]=(w-.5)*q*2-1,v[r+18]=D*t,v[r+19]=w*q,v[r+20]=(D+.5)*t*2-1,v[r+21]=(w+.5)*q*2-1,v[r+22]=D*t,v[r+23]=w*q,r+=24;k.vao&&k.vao.dispose(!0);k.vao=new n(l,B.Default3D,
{geometry:y.Pos2Tex},{geometry:f.createVertex(l,35044,v)})}};a.prototype._gridComputeMipmap=function(){var a=this._rctx,b=this._grid,c=this.programRep.get("conservative-downsample");a.bindVAO(this.quadVAO);for(var f=0;f<b.mipmapLevels;f++){a.bindFramebuffer(b.coverageMipmap[f+1]);a.bindTexture(b.coverageMipmap[f].colorTexture,0);var l=b.coverageMipmap[f+1].width,n=b.coverageMipmap[f+1].height;a.bindProgram(c);c.setUniform1i("tex",0);c.setUniform2f("invFramebufferDim",1/l,1/n);a.setViewport(0,0,l,
n);a.drawArrays(5,0,q.vertexCount(this.quadVAO,"geometry"))}};a.prototype.createQuadVAO=function(){var a=this._rctx,b=new Float32Array([-1,-1,1,-1,-1,1,1,1]);return new n(a,B.Default3D,{geometry:y.Pos2},{geometry:f.createVertex(a,35044,b)})};Object.defineProperty(a.prototype,"profilingCallback",{get:function(){return v.HIGHLIGHTS_PROFILE_TO_CONSOLE?function(a){return console.log(a)}:null},enumerable:!0,configurable:!0});a.prototype.getIsSupported=function(){return!0};a.prototype.setEnableState=function(a){a?
this.enable():this.disable()};a.prototype.getEnableState=function(){return null!==this.blur0Fbo};a.prototype.enable=function(){this.quadVAO=this.createQuadVAO();var a={colorTarget:0,depthStencilTarget:0,width:0,height:0},b={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,height:0};this.blur0Fbo=c.createWithAttachments(this._rctx,b,a);this.blur1Fbo=c.createWithAttachments(this._rctx,b,a)};a.prototype.disable=function(){this.getEnableState()&&(this.quadVAO.dispose(!0),
this.blur1Fbo.dispose(),this.blur0Fbo.dispose(),this.blur1Fbo=this.blur0Fbo=this.quadVAO=null)};a.prototype.getHighlightFBO=function(){return this.blur0Fbo};a.prototype.render=function(a,b,c){var f=!v.HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED,l=v.HIGHLIGHTS_VISUALIZE_BLOCKS,p=this._rctx;k.assert(this.getEnableState());w.set(a.fullViewport,this.viewportToRestore);a=Math.ceil(c.width/1);var n=Math.ceil(c.height/1);this.blur0Fbo.resize(a,n);this.blur1Fbo.resize(a,n);p.bindVAO(this.quadVAO);p.setDepthWriteEnabled(!1);
p.setDepthTestEnabled(!1);p.setBlendingEnabled(!1);var t=null,y=t=null,r=null;if(f){var B=this._grid;this._gridUpdateResources(c,32);this._gridComputeMipmap();y=B.vao;r=4;t=this.programRep.get("highlight-blur-grid-5");p.bindProgram(t);p.bindTexture(B.coverageMipmap[B.mipmapLevels].colorTexture,1);t.setUniform1i("coverageTex",1)}else y=this.quadVAO,r=5,t=this.programRep.get("highlight-blur-5"),p.bindProgram(t);p.bindVAO(y);p.bindFramebuffer(this.blur0Fbo);p.setViewport(0,0,a,n);p.setClearColor(0,0,
0,0);p.clear(p.gl.COLOR_BUFFER_BIT);t.setUniform1i("tex",0);p.bindTexture(c.colorTexture,0);t.setUniform2f("blurSize",1/a,0);p.drawArrays(r,0,q.vertexCount(y,"geometry"));p.bindFramebuffer(this.blur1Fbo);p.clear(p.gl.COLOR_BUFFER_BIT);p.bindTexture(this.blur0Fbo.colorTexture,0);t.setUniform2f("blurSize",0,1/n);p.drawArrays(r,0,q.vertexCount(y,"geometry"));p.bindFramebuffer(b);p.setBlendingEnabled(!0);p.setBlendFunctionSeparate(770,771,1,771);p.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],
this.viewportToRestore[2],this.viewportToRestore[3]);f?(t=this.programRep.get(l?"highlight-apply-grid-debug":"highlight-apply-grid"),p.bindProgram(t),t.setUniform1i("coverageTex",2),p.bindTexture(this._grid.coverageMipmap[this._grid.mipmapLevels].colorTexture,2)):(t=this.programRep.get("highlight-apply"),p.bindProgram(t));t.setUniform1i("tex",0);p.bindTexture(this.blur1Fbo.colorTexture,0);t.setUniform1i("origin",1);p.bindTexture(c.colorTexture,1);t.setUniform4fv("color",this.defaultOptions.color);
t.setUniform1f("outlineSize",8.6);t.setUniform1f("blurSize",.4);t.setUniform4f("opacities",this.defaultOptions.haloOpacity,this.defaultOptions.haloOpacityOccluded,this.defaultOptions.fillOpacity,this.defaultOptions.fillOpacityOccluded);p.drawArrays(r,0,q.vertexCount(y,"geometry"));p.bindVAO(null);p.setDepthWriteEnabled(!0);p.setDepthTestEnabled(!0);p.setBlendingEnabled(!1)};a.prototype.setDefaultOptions=function(a){this.defaultOptions=a};a.loadShaders=function(a,c,f,l){a._parse(b);c=0;for(var p=["3",
"5","7","9"];c<p.length;c++){var n=p[c];f.add("highlight-blur-"+n,new t(l,a.vsHighlightBlurFastGaussian,a.fsHighlightBlurFastGaussian,B.Default3D,{GAUSSIAN_SAMPLES:n}));f.add("highlight-blur-grid-"+n,new t(l,a.vsHighlightBlurFastGaussian,a.fsHighlightBlurFastGaussian,B.Default3D,{GAUSSIAN_SAMPLES:n,GRID_OPTIMIZATION:"true"}))}f.add("highlight-apply",new t(l,a.vsHighlightApply,a.fsHighlightApply,B.Default3D));f.add("highlight-apply-grid",new t(l,a.vsHighlightApply,a.fsHighlightApply,B.Default3D,["GRID_OPTIMIZATION"]));
f.add("highlight-apply-grid-debug",new t(l,a.vsHighlightApply,a.fsHighlightApply,B.Default3D,["GRID_OPTIMIZATION","GRID_DEBUG"]));f.add("conservative-downsample",new t(l,a.vsConservativeDownsample,a.fsConservativeDownsample,B.Default3D))};return a}()})},"esri/views/3d/webgl-engine/lib/RenderOccludedHelper":function(){define("require exports ./Util ./gl-matrix dojo/text!../materials/internal/occluded.xml ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ../../../webgl/Util ../../../webgl/enums ./DefaultVertexBufferLayouts ./DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){var v=a.vec4d;return function(){function a(a,b,c){this._quadVAO=null;this._rctx=c;this._colorFBO=void 0;this._viewportToRestore=v.create();this.programRep=a}Object.defineProperty(a.prototype,"colorFBO",{get:function(){return this._colorFBO},enumerable:!0,configurable:!0});a.prototype.createQuadVAO=function(){var a=this._rctx,b=new Float32Array([-1,-1,1,-1,-1,1,1,1]);return new n(a,B.Default3D,{geometry:y.Pos2},{geometry:f.createVertex(a,35044,b)})};a.prototype.setEnableState=
function(a){a?this.enable():this.disable()};a.prototype.getEnableState=function(){return void 0!==this._colorFBO};a.prototype.enable=function(){this._quadVAO=this.createQuadVAO();this._colorFBO=c.createWithAttachments(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:1})};a.prototype.disable=function(){this.getEnableState()&&(this._quadVAO.dispose(!0),this._quadVAO=void 0,this._colorFBO.dispose(),this._colorFBO=
void 0)};a.prototype.setupFBOs=function(a){k.assert(this.getEnableState());this._viewportToRestore=a=a.fullViewport;this._width=a[2];this._height=a[3];this._rctx.setViewport(0,0,this._width,this._height)};a.prototype.prepareColorPass=function(){k.assert(this.getEnableState());var a=this._rctx,b=a.gl;this._colorFBO.resize(this._width,this._height);a.bindFramebuffer(this._colorFBO);a.setClearColor(0,0,0,0);a.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};a.prototype.finish=function(a){var b=this._rctx;
b.bindFramebuffer(a);b.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3])};a.prototype.apply=function(){var a=this._rctx,b=this.programRep.get("render-occluded-apply");a.bindProgram(b);a.bindVAO(this._quadVAO);a.bindTexture(this._colorFBO.colorTexture,0);b.setUniform1i("occludedColorMap",0);a.setDepthWriteEnabled(!1);a.setDepthTestEnabled(!1);a.setBlendingEnabled(!0);a.setBlendFunction(770,771);a.drawArrays(5,0,q.vertexCount(this._quadVAO,
"geometry"));a.bindVAO(null);a.setDepthWriteEnabled(!0);a.setDepthTestEnabled(!0);a.setBlendingEnabled(!1)};a.loadShaders=function(a,c,f,l){a._parse(b);f.add("render-occluded-apply",new t(l,a.vsRenderOccludedApply,a.fsRenderOccludedApply,B.Default3D))};return a}()})},"esri/views/3d/webgl-engine/materials/repository":function(){define("dojo/text!./internal/util.xml dojo/text!./internal/hud.xml ./BillboardMaterial ./ColorMaterial ./HUDMaterial ./LineCalloutMaterial ./LeafCardMaterial ./Material ./RibbonLineMaterial ./WaterMaterial ./MeasurementArrowMaterial ./internal/SimpleGLMaterial ./internal/TexOnlyGLMaterial ./internal/BlendLayers".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){return{initializeShaders:function(w,D,F,G){w._parse(x);w._parse(r);y.loadShaders(w,D,F,G);B.loadShaders(w,D,F,G);n.loadShaders(w,D,F,G);k.loadShaders(w,D,F,G);b.loadShaders(w,D,F,G);c.loadShaders(w,D,F,G);t.loadShaders(w,D,F,G);f.loadShaders(w,D,F,G);q.loadShaders(w,D,F,G);v.loadShaders(w,D,F,G);a.loadShaders(w,D,F,G);l.loadShaders(w,D,F,G)}}})},"esri/views/3d/webgl-engine/materials/BillboardMaterial":function(){define("dojo/text!./BillboardMaterial.xml ./internal/MaterialUtil ../lib/RenderSlot ../../../webgl/Program ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t){var n=function(a,b){r.basicMaterialConstructor(this,b);var n=c.Pos3NormTex;this.getSize=function(){return 1.05};this.dispose=function(){};this.getTextureId=function(){return a};this.getOutputAmount=function(a){var b=t.getStride(n)/4;return a*b*6};this.getVertexBufferLayout=function(){return n};this.fillInterleaved=function(a,b,c,f,l,n){f=r.fill;var p=a.indices.va,k=a.vertexAttr.va.data,q=a.vertexAttr.tc4.data,t=a.vertexAttr.n0.data,v=a.vertexAttr.n1.data,y=a.vertexAttr.n2.data;
a=a.vertexAttr.n3.data;for(var w=0;w<p.length;++w){var B=4*p[w],z=3*p[w];n+=f(k,B,l,n,b,3);n+=f(t,z,l,n,c,3);l[n++]=q[B];l[n++]=q[B+1];n+=f(k,B,l,n,b,3);n+=f(v,z,l,n,c,3);l[n++]=q[B+2]+1;l[n++]=q[B+1];n+=f(k,B,l,n,b,3);n+=f(y,z,l,n,c,3);l[n++]=q[B+2]+1;l[n++]=q[B+3]+1;n+=f(k,B,l,n,b,3);n+=f(y,z,l,n,c,3);l[n++]=q[B+2]+1;l[n++]=q[B+3]+1;n+=f(k,B,l,n,b,3);n+=f(a,z,l,n,c,3);l[n++]=q[B];l[n++]=q[B+3]+1;n+=f(k,B,l,n,b,3);n+=f(t,z,l,n,c,3);l[n++]=q[B];l[n++]=q[B+1]}};this.intersect=function(){};this.getGLMaterials=
function(){return{color:f,depthShadowMap:l,normal:void 0,depth:q,highlight:void 0}};this.getAllTextureIds=function(){return[a]}},f=function(a,b,c){r.basicGLMaterialConstructor(this,a);var f=k.TRANSPARENT_MATERIAL,l=b.get("billboard");r.singleTextureGLMaterialConstructor(this,c,{textureId:a.getTextureId()});this.beginSlot=function(a){return f===a};this.getProgram=function(){return l};this.bind=function(a,b){a.bindProgram(l);this.bindTexture(a,l);a.setBlendingEnabled(!0);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,
a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0)};this.release=function(a){};this.bindView=function(a,b){r.bindView(b.origin,b.view,l)};this.bindInstance=function(a,b){l.setUniformMatrix4fv("model",b.transformation);l.setUniformMatrix4fv("modelNormal",b.transformationNormal)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},q=function(a,b,c,f){r.basicGLMaterialConstructor(this,a);var l=k.TRANSPARENT_MATERIAL,n=null==f?b.get("billboardDepth"):b.get("billboardDepthShadowMap");
r.singleTextureGLMaterialConstructor(this,c,{textureId:a.getTextureId()});this.beginSlot=function(a){return l===a};this.getProgram=function(){return n};this.bind=function(a,b){a.bindProgram(n);this.bindTexture(a,n);n.setUniform2fv("nearFar",b.nearFar)};this.release=function(a){};this.bindView=function(a,b){r.bindView(b.origin,b.view,n)};this.bindInstance=function(a,b){n.detUniformMatrix4fv("model",b.transformation)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},l=function(a,b,c){q.call(this,
a,b,c,!0)};n.loadShaders=function(c,f,l,n){c._parse(x);var k=new a(n,c.vertexShaderBillboard,c.fragmentShaderBillboard,b.Default3D),q=f.get("fsDepthTextured");f=f.get("fsDepthTexturedShadowMap");q=new a(n,c.vertexShaderBillboardDepth,q.source,b.Default3D,q.defines);c=new a(n,c.vertexShaderBillboardDepth,f.source,b.Default3D,f.defines);l.add("billboard",k);l.add("billboardDepth",q);l.add("billboardDepthShadowMap",c)};return n})},"esri/views/3d/webgl-engine/materials/ColorMaterial":function(){define("dojo/_base/lang dojo/text!./ColorMaterial.xml ./internal/MaterialUtil ../lib/RenderSlot ../lib/Util ../lib/ShaderVariations ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t,n,f){b=function(a,b){k.basicMaterialConstructor(this,b);a=a||{};a.color=a.color||[1,1,1,1];a.polygonOffset=a.polygonOffset||!1;a.vertexColors=a.vertexColors||!1;var c=n.Pos3Col;this.getParams=function(){return a};this.setColor=function(b){a.color=b;this.notifyDirty("matChanged")};this.getColor=function(){return a.color};this.setTransparent=function(b){a.transparent=b;this.notifyDirty("matChanged")};this.getTransparent=function(b){return a.transparent};this.dispose=function(){};
this.getOutputAmount=function(a){var b=f.getStride(c)/4;return a*b};this.getVertexBufferLayout=function(){return c};this.fillInterleaved=function(a,b,f,l,p,n,q){k.fillInterleaved(a,b,f,l,c,p,n,q)};this.intersect=k.intersectTriangleGeometry;this.getGLMaterials=function(){return{color:q,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:l}};this.getAllTextureIds=function(){return[]}};var q=function(b,c,f){k.basicGLMaterialConstructor(this,b);var l=x.clone(b.getParams()),n=c.getShaderVariationsProgram("colorMaterial",
[l.vertexColors]),q=b.getColor();this.beginSlot=function(b){return b===(1>q[3]?a.TRANSPARENT_MATERIAL:a.OPAQUE_MATERIAL)};this.getProgram=function(){return n};this.updateParameters=function(){l.color=b.getColor();l.transparent=b.getTransparent()};this.bind=function(a,b){a.bindProgram(n);n.setUniform4fv("eColor",l.color);a.setFaceCullingEnabled(!1);l.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1));l.transparent&&(a.setBlendingEnabled(!0),a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,
a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA));a.setDepthTestEnabled(!0)};this.release=function(a){a.setPolygonOffsetFillEnabled(!1);l.transparent&&a.setBlendingEnabled(!1)};this.bindView=function(a,b){k.bindView(b.origin,b.view,n)};this.bindInstance=function(a,b){n.setUniformMatrix4fv("model",b.transformation)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},l=function(b,c,f){k.basicGLMaterialConstructor(this,b);var l=x.clone(b.getParams()),n=c.getShaderVariationsProgram("colorMaterial",
[l.vertexColors]),q=[1,1,1,1];this.beginSlot=function(b){return b===(1>q[3]?a.TRANSPARENT_MATERIAL:a.OPAQUE_MATERIAL)};this.getProgram=function(){return n};this.updateParameters=function(){l.color=b.getColor();l.transparent=b.getTransparent()};this.bind=function(a,b){a.bindProgram(n);n.setUniform4fv("eColor",l.color);a.setFaceCullingEnabled(!1);l.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1))};this.release=function(a){a.setPolygonOffsetFillEnabled(!1)};this.bindView=function(a,
b){k.bindView(b.origin,b.view,n)};this.bindInstance=function(a,b){n.setUniformMatrix4fv("model",b.transformation)};this.getDrawMode=function(a){return a.gl.TRIANGLES}};b.programs=null;b.loadShaders=function(a,b,f,l){a._parse(r);a=new c("colorMaterial",["vertexShaderColorMaterial","fragmentShaderColorMaterial"],null,f,b,a,l,t.Default3D);a.addDefine("Color","VERTEXCOLORS");f.addShaderVariations("colorMaterial",a)};return b})},"esri/views/3d/webgl-engine/materials/LineCalloutMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./LineCalloutMaterial.xml ./internal/MaterialUtil ../lib/Util ../../../webgl/Util ./internal/MaterialBase ./internal/GLMaterialBase ../lib/RenderSlot ../lib/ShaderVariations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){function y(a,b,c){3===c.length?a.setUniform4f(b,c[0],c[1],c[2],1):a.setUniform4fv(b,c)}var B=c.VertexAttrConstants,v=[{name:"position",count:3,type:5126,offset:0,stride:48,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:48,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:48,normalized:!1},{name:"auxpos1",count:4,type:5126,offset:32,stride:48,normalized:!1}],w={verticalOffset:null,screenSizePerspective:null,screenOffset:[0,0],color:[0,0,
0,1],size:1,borderColor:null,occlusionTest:!1,shaderPolygonOffset:1E-5,depthHUDAlignStart:!1,centerOffsetUnits:"world"};x=function(c){function f(a,l){l=c.call(this,l)||this;l.params=b.copyParameters(a,w);l._uniqueMaterialIdentifier=f.uniqueMaterialIdentifier(l.params);return l}k(f,c);Object.defineProperty(f.prototype,"uniqueMaterialIdentifier",{get:function(){return this._uniqueMaterialIdentifier},enumerable:!0,configurable:!0});f.prototype.dispose=function(){};f.prototype.getGLMaterials=function(){return{color:D,
depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};f.prototype.getAllTextureIds=function(){return[]};f.prototype.fillAttributeData=function(a,c,f,l,p,n){var k=a.indices[c];a=a.vertexAttr[c].data;if(k&&a)for(c=f+t.findAttribute(v,c).offset/4,f=0;f<k.length;f++)for(var q=l*k[f],y=0;6>y;y++)b.fill(a,q,n,c,p,l),c+=12};f.prototype.fillInterleaved=function(a,b,c,f,l,p,n){this.fillAttributeData(a,B.POSITION,p,3,b,l);this.fillAttributeData(a,B.NORMAL,p,3,c,l);this.fillAttributeData(a,B.AUXPOS1,
p,4,null,l);a=p+t.findAttribute(v,B.UV0).offset/4;b=0;for(c=F;b<c.length;b++)f=c[b],l[a+0]=f[0],l[a+1]=f[1],a+=12};f.prototype.getOutputAmount=function(a){return 288*a};f.prototype.getInstanceBufferLayout=function(){};f.prototype.getVertexBufferLayout=function(){return v};f.prototype.intersect=function(a,b,c,f,l,p,n,k){};f.prototype.getParameterValues=function(){var a=this.params;return{verticalOffset:a.verticalOffset,screenSizePerspective:a.screenSizePerspective,screenOffset:a.screenOffset,centerOffsetUnits:a.centerOffsetUnits,
color:[a.color[0],a.color[1],a.color[2],a.color[3]],size:a.size,borderColor:a.borderColor,occlusionTest:a.occlusionTest,shaderPolygonOffset:a.shaderPolygonOffset,depthHUDAlignStart:a.depthHUDAlignStart}};f.prototype.setParameterValues=function(a){b.updateParameters(this.params,a)&&(this._uniqueMaterialIdentifier=f.uniqueMaterialIdentifier(this.params),this.notifyDirty("matChanged"))};f.uniqueMaterialIdentifier=function(a){return JSON.stringify({screenOffset:a.screenOffset||[0,0],centerOffsetUnits:a.centerOffsetUnits||
"world"})};f.loadShaders=function(b,c,f,p){b._parse(a);b=new l("lineCallout",["vertexShaderLineCallout","fragmentShaderLineCallout"],null,f,c,b,p);b.addDefine("occlTest","OCCL_TEST");b.addDefine("verticalOffset","VERTICAL_OFFSET");b.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");b.addDefine("depthHud","DEPTH_HUD");b.addDefine("depthHudAlignStart","DEPTH_HUD_ALIGN_START");b.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN");f.addShaderVariations("line-callout-material-shader-variations",
b)};return f}(n.MaterialBase);var D=function(a){function c(b,c,f){b=a.call(this,b,c,f)||this;b.isRenderSlot=!0;b.programRep=c;b.updateParameters();return b}k(c,a);c.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};c.prototype.selectProgram=function(){var a=this.params;this.renderProgram=this.programRep.getShaderVariationsProgram("line-callout-material-shader-variations",[!!a.occlusionTest,!!a.verticalOffset,!!a.screenSizePerspective,!1,!!a.depthHUDAlignStart,
"screen"===a.centerOffsetUnits]);this.depthProgram=this.programRep.getShaderVariationsProgram("line-callout-material-shader-variations",[!!a.occlusionTest,!!a.verticalOffset,!!a.screenSizePerspective,!0,!!a.depthHUDAlignStart,"screen"===a.centerOffsetUnits])};c.prototype.beginSlot=function(a){switch(a){case q.LINE_CALLOUTS:return this.isRenderSlot=!0;case q.LINE_CALLOUTS_HUD_DEPTH:return this.isRenderSlot=!1,!0}return!1};Object.defineProperty(c.prototype,"program",{get:function(){return this.isRenderSlot?
this.renderProgram:this.depthProgram},enumerable:!0,configurable:!0});c.prototype.getAllPrograms=function(){return[this.renderProgram,this.depthProgram]};c.prototype.getProgram=function(){return this.program};c.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};c.prototype.bind=function(a,c){var f=c.cameraAboveGround?1:-1,l=this.program,p=this.params;a.bindProgram(l);l.setUniform1f("cameraGroundRelative",f);l.setUniform1f("polygonOffset",p.shaderPolygonOffset);l.setUniform4fv("viewport",c.viewport);
l.setUniformMatrix4fv("viewNormal",c.viewInvTransp);l.setUniform1i("hudVisibilityTexture",0);a.bindTexture(c.hudVisibilityTexture,0);y(l,"color",p.color);l.setUniform2f("screenOffset",p.screenOffset[0],p.screenOffset[1]);this.bindBorder(a,c);b.bindVerticalOffset(p.verticalOffset,c,l);this.bindSizing(a,c);b.bindScreenSizePerspective(p.screenSizePerspective,l);this.isRenderSlot?this.bindRender(a,c):this.bindHUDDepth(a,c)};c.prototype.bindRender=function(a,b){a.setBlendFunctionSeparate(1,771,770,771);
a.setBlendingEnabled(!0);a.setDepthWriteEnabled(!1)};c.prototype.bindHUDDepth=function(a,b){a.setColorMask(!1,!1,!1,!1);a.setDepthWriteEnabled(!0);a.setBlendingEnabled(!1);a.setDepthTestEnabled(!0)};c.prototype.bindView=function(a,c){a=this.program;b.bindView(c.origin,c.view,a);b.bindCamPos(c.origin,c.viewInvTransp,a)};c.prototype.bindInstance=function(a,b){a=this.program;a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};c.prototype.release=
function(a,b){this.isRenderSlot?this.releaseRender(a,b):this.releaseHUDDepth(a,b)};c.prototype.releaseRender=function(a,b){a.setBlendingEnabled(!1);a.setBlendFunction(770,771);a.setDepthWriteEnabled(!0)};c.prototype.releaseHUDDepth=function(a,b){a.setColorMask(!0,!0,!0,!0)};c.prototype.bindSizing=function(a,b){a=this.program;var c=this.params;a.setUniform2f("pixelToNDC",2/b.viewport[2],2/b.viewport[3]);a.setUniform1f("lineSize",Math.ceil(c.size))};c.prototype.bindBorder=function(a,b){a=this.program;
b=this.params;null!==b.borderColor?(y(a,"borderColor",b.borderColor),a.setUniform1f("borderSize",1)):(a.setUniform4f("borderColor",0,0,0,0),a.setUniform1f("borderSize",0))};return c}(f.GLMaterialBase),F=[[0,0],[1,0],[0,1],[1,0],[1,1],[0,1]];return x})},"esri/views/3d/webgl-engine/materials/LeafCardMaterial":function(){define("dojo/text!./LeafCardMaterial.xml ./internal/MaterialUtil ../lib/Util ../lib/gl-matrix ../lib/RenderSlot ../../../webgl/Program ../lib/DefaultVertexAttributeLocations ../../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t,n){function f(){D=(9301*D+49297)%233280;return D/233280}var q=a.vec3,l=a.mat4,y=a.mat4d;a=function(a,b,c,t,A,D){r.basicMaterialConstructor(this,D);var p=[{name:"position",count:3,type:5126,offset:0,stride:44,normalized:!1},{name:"normal",count:4,type:5126,offset:12,stride:44,normalized:!1},{name:"uv0",count:4,type:5126,offset:28,stride:44,normalized:!1}],z=n.getStride(p)/4;this.getAmbient=function(){return b};this.getDiffuse=function(){return c};this.getSpecular=function(){return t};
this.getShininess=function(){return A};this.dispose=function(){};this.getTextureId=function(){return a};this.getOutputAmount=function(a){var b=0,c;for(c=0;c<a/6;c++)0===c%1&&(b+=6);a=b;for(c=b=0;c<a/6;c++)0===c%1&&(b+=6);return b*z};this.getVertexBufferLayout=function(){return p};this.reduce=function(a,b){var c=a.position,f=a.normal;a=a.uv0;for(var l=[],p=[],n=[],k=0,q=0;q<c.length/6;q++)if(0===q%b)for(var h=0;6>h;h++)l[k]=c[6*q+h],p[k]=f[6*q+h],n[k]=a[6*q+h],k++;return{position:l,normal:p,uv0:n}};
this.fillInterleaved=function(a,b,c,p,n,t){p=r.fill;var v=this.reduce(a.indices,1),v=this.reduce(v,1),w=this.getOutputAmount(a.indices.position.length);k.assert(w===v.position.length*z);var B=v.position,h=v.normal,A=v.uv0,v=a.vertexAttr.position.data,D=a.vertexAttr.normal.data,e=a.vertexAttr.uv0.data,d=q.create();a=B.length/6;for(var w=t,g=q.createFrom(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),m=q.createFrom(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=0;u<a;++u){for(var C=q.create(),
F=q.create(),I=[100,100,-100,-100],L=q.create(),K=0;6>K;++K){var G=6*u+K,J=3*B[G],x=3*h[G],G=2*A[G];C[0]+=v[J+0];C[1]+=v[J+1];C[2]+=v[J+2];F[0]+=D[x+0];F[1]+=D[x+1];F[2]+=D[x+2];x=e[G+0];G=e[G+1];I[0]=Math.min(I[0],x);I[1]=Math.min(I[1],G);I[2]=Math.max(I[2],x);I[3]=Math.max(I[3],G);0===K&&q.set3(v[J+0],v[J+1],v[J+2],L)}C[0]/=6;C[1]/=6;C[2]/=6;F[0]/=6;F[1]/=6;F[2]/=6;C[0]+=.1*(2*f()-1);C[1]+=.1*(2*f()-1);C[2]+=.1*(2*f()-1);void 0!==b&&(y.multiplyVec3(b,L,L),y.multiplyVec3(b,C,C),y.multiplyVec3(c,
F,F));q.add(C,d,d);q.max(g,C,g);q.min(m,C,m);I[0]+=.01;I[1]+=.01;I[2]-=.01;I[3]-=.01;for(K=0;4>K;K++)I[K]=Math.min(I[K],.99999);K=2*f()*Math.PI;L=1.41*q.dist(L,C);t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,3);n[t++]=0;n[t++]=I[0];n[t++]=I[1];n[t++]=K;n[t++]=L;t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,3);n[t++]=0;n[t++]=I[2]+1;n[t++]=I[1];n[t++]=K;n[t++]=L;t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,3);n[t++]=0;n[t++]=I[2]+1;n[t++]=I[3]+1;n[t++]=K;n[t++]=L;t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,
3);n[t++]=0;n[t++]=I[2]+1;n[t++]=I[3]+1;n[t++]=K;n[t++]=L;t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,3);n[t++]=0;n[t++]=I[0];n[t++]=I[3]+1;n[t++]=K;n[t++]=L;t+=p(C,0,n,t,void 0,3);t+=p(F,0,n,t,void 0,3);n[t++]=0;n[t++]=I[0];n[t++]=I[1];n[t++]=K;n[t++]=L}d[0]/=a;d[1]/=a;d[2]/=a;b=q.create();q.add(g,m,b);q.scale(b,.5,b);t=q.create();q.subtract(g,m,t);t[0]=Math.abs(t[0])/2;t[1]=Math.abs(t[1])/2;t[2]=Math.abs(t[2])/2;B=q.create(d);B[1]-=(g[1]-m[1])/3;g=q.create();m=q.create();v=q.create();h=[q.create(),
q.create(),q.create(),q.create()];d=[0,0,0,0];A=l.create();for(u=0;u<a;++u){q.set3(n[w],n[w+1],n[w+2],v);q.subtract(v,B,g);q.normalize(g,g);m=q.subtract(v,b,m);q.normalize(m,m);e=Math.abs(q.dot(m,[1,0,0]));K=Math.abs(q.dot(m,[0,1,0]));D=Math.abs(q.dot(m,[0,0,1]));e=e*Math.abs(b[0]-v[0])/t[0];e+=K*Math.abs(b[1]-v[1])/t[1];e+=D*Math.abs(b[2]-v[2])/t[2];for(K=0;4>K;K++)l.identity(A),l.rotate(A,.8*(2*f()-1),[0,1,0],A),l.rotate(A,.8*(2*f()-1),[1,0,0],A),l.multiplyVec3(A,g,h[K]),d[K]=.5+.5*e-.2*(2*f()-
1);D=.8+.3*(2*f()-1);for(K=0;6>K;++K){var O;switch(K){case 0:O=0;break;case 1:O=1;break;case 2:O=2;break;case 3:O=2;break;case 4:O=3;break;case 5:O=0}w+=3;w+=p(h[O],0,n,w,c,3);n[w++]=d[O];w+=3;n[w++]*=D}}};this.intersect=function(){};this.getGLMaterials=function(){return{color:B,depthShadowMap:w,normal:void 0,depth:v,highlight:void 0}};this.getAllTextureIds=function(){return[a]}};var B=function(a,c,f){r.basicGLMaterialConstructor(this,a);var l=b.TRANSPARENT_MATERIAL,p=c.get("leafCard");r.singleTextureGLMaterialConstructor(this,
f,{textureId:a.getTextureId()});this.beginSlot=function(a){return l===a};this.getProgram=function(){return p};var n=a.getAmbient(),k=a.getDiffuse(),q=a.getSpecular(),t=a.getShininess();this.bind=function(a,b){a.bindProgram(p);this.bindTexture(a,p);p.setUniform3fv("ambient",n);p.setUniform3fv("diffuse",k);p.setUniform3fv("specular",q);p.setUniform1f("shininess",t);p.setUniform1f("trafoScale",1);a.setBlendingEnabled(!1);a.setDepthTestEnabled(!0)};this.release=function(a){};this.bindView=function(a,
b){r.bindView(b.origin,b.view,p);r.bindCamPos(b.origin,b.viewInvTransp,p)};this.bindInstance=function(a,b){p.setUniformMatrix4fv("model",b.transformation);p.setUniformMatrix4fv("modelNormal",b.transformationNormal);a=b.transformation;p.setUniform1f("trafoScale",(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8])+Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])+Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))/3)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},v=function(a,c,f,l){r.basicGLMaterialConstructor(this,a);
var p=b.TRANSPARENT_MATERIAL,n=null==l?c.get("leafCardDepth"):c.get("leafCardDepthShadowMap");r.singleTextureGLMaterialConstructor(this,f,{textureId:a.getTextureId()});this.beginSlot=function(a){return p===a};this.getProgram=function(){return n};this.bind=function(a,b){a.bindProgram(n);this.bindTexture(a,n);n.setUniform2fv("nearFar",b.nearFar)};this.release=function(a){};this.bindView=function(a,b){r.bindView(b.origin,b.view,n)};this.bindInstance=function(a,b){n.setUniformMatrix4fv("model",b.transformation);
a=b.transformation;n.setUniform1f("trafoScale",(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8])+Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])+Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))/3)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},w=function(a,b,c){v.call(this,a,b,c,!0)};a.loadShaders=function(a,b,f,l){a._parse(x);var p=new c(l,a.vertexShaderLeafCard,a.fragmentShaderLeafCard,t.Default3D),n=b.get("fsDepthTextured");b=b.get("fsDepthTexturedShadowMap");n=new c(l,a.vertexShaderLeafCardDepth,n.source,
t.Default3D,n.defines);a=new c(l,a.vertexShaderLeafCardDepth,b.source,t.Default3D,b.defines);f.add("leafCard",p);f.add("leafCardDepth",n);f.add("leafCardDepthShadowMap",a)};var D=1234;return a})},"esri/views/3d/webgl-engine/materials/Material":function(){define("dojo/text!./Material.xml ./internal/MaterialUtil ../../../webgl/Program ../lib/ShaderVariations ../lib/Util ../lib/gl-matrix ../lib/RenderSlot ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../../../webgl/Util ../../layers/graphics/graphicUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){function y(a,b){var d=b.vvSizeEnabled;b.vvSizeEnabled?(a.setUniform3fv("vvSizeMinSize",b.vvSizeMinSize),a.setUniform3fv("vvSizeMaxSize",b.vvSizeMaxSize),a.setUniform3fv("vvSizeOffset",b.vvSizeOffset),a.setUniform3fv("vvSizeFactor",b.vvSizeFactor)):d&&a.setUniform3fv("vvSizeValue",b.vvSizeValue);d&&(a.setUniform3fv("vvSymbolAnchor",b.vvSymbolAnchor),l.computeObjectRotation(b.vvSymbolRotation[2],b.vvSymbolRotation[0],b.vvSymbolRotation[1],p.identity(I)),a.setUniformMatrix3fv("vvSymbolRotation",
p.toMat3(I,J)));b.vvColorEnabled&&(a.setUniform1fv("vvColorValues",b.vvColorValues),a.setUniform4fv("vvColorColors",b.vvColorColors))}function B(a,b){a.vvSizeEnabled=b.vvSizeEnabled;a.vvSizeMinSize=b.vvSizeMinSize;a.vvSizeMaxSize=b.vvSizeMaxSize;a.vvSizeOffset=b.vvSizeOffset;a.vvSizeFactor=b.vvSizeFactor;a.vvSizeValue=b.vvSizeValue;a.vvSymbolAnchor=b.vvSymbolAnchor;a.vvSymbolRotation=b.vvSymbolRotation}function v(a,b){F.set(a,A);return F.multiply(b,A)}var w=b.assert,D=c.vec3,F=c.vec4,G=c.mat3,p=c.mat4,
z,A=F.create(),J=G.create(),I=p.create(),K=D.create(),L=D.create(),O=D.createFrom(0,0,1),P=D.create(),U=D.create(),N=D.create(),R=D.create(),S=function(a,b){r.basicMaterialConstructor(this,b);a=a||{};a.ambient=a.ambient||[.2,.2,.2];a.diffuse=a.diffuse||[.8,.8,.8];a.specular=a.specular||[0,0,0];a.externalColor=a.externalColor||[1,1,1,1];a.colorMixMode=a.colorMixMode||"multiply";a.shininess=a.shininess||10;a.opacity=void 0!==a.opacity?a.opacity:1;a.layerOpacity=void 0!==a.layerOpacity?a.layerOpacity:
1;a.blendModeOneOne=a.blendModeOneOne||!1;a.inverseWindingOrder=a.inverseWindingOrder||!1;a.vertexColors=a.vertexColors||!1;a.symbolColors=a.symbolColors||!1;a.flipV=a.flipV||!1;a.doubleSided=a.doubleSided||!1;a.cullFace=a.cullFace||void 0;a.instanced=a.instanced||!1;this.instanced=!!a.instanced;a.groundNormalShading=a.groundNormalShading||!1;a.writeStencil=a.writeStencil||!1;a.textureId||(a.reflTextureId=void 0);a.receiveSSAO=void 0!==a.receiveSSAO?a.receiveSSAO:!0;a.castShadows=void 0!==a.castShadows?
a.castShadows:!0;a.verticalOffset=a.verticalOffset||null;a.screenSizePerspective=a.screenSizePerspective||null;a.vvSizeEnabled=a.vvSizeEnabled||!1;a.vvSizeMinSize=a.vvSizeMinSize||[1,1,1];a.vvSizeMaxSize=a.vvSizeMaxSize||[100,100,100];a.vvSizeOffset=a.vvSizeOffset||[0,0,0];a.vvSizeFactor=a.vvSizeFactor||[1,1,1];a.vvSizeValue=a.vvSizeValue||[1,1,1];a.vvColorEnabled=a.vvColorEnabled||!1;a.vvColorValues=a.vvColorValues||[0,0,0,0,0,0,0,0];a.vvColorColors=a.vvColorColors||[1,0,0,0,1,0,0,0,1,0,0,0,1,0,
0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0];a.vvSymbolAnchor=a.vvSymbolAnchor||[0,0,0];a.vvSymbolRotation=a.vvSymbolRotation||[0,0,0];var c=S.getVertexBufferLayout(a),f=null;a.instanced&&(f=[],q.addDescriptor(f,"model",16,5126,!1,1),q.addDescriptor(f,"modelNormal",16,5126,!1,1),-1<a.instanced.indexOf("color")&&q.addDescriptor(f,"instanceColor",4,5126,!1,1),-1<a.instanced.indexOf("featureAttribute")&&q.addDescriptor(f,"instanceFeatureAttribute",4,5126,!1,1));var h=this.isVisible.bind(this);this.isVisible=
function(){return h()&&0<a.opacity&&0<a.layerOpacity};this.dispose=function(){};this.getParams=function(){return a};this.getParameterValues=function(){var b={ambient:a.ambient,diffuse:a.diffuse,specular:a.specular,externalColor:a.externalColor,colorMixMode:a.colorMixMode,shininess:a.shininess,opacity:a.opacity,layerOpacity:a.layerOpacity,transparent:a.transparent,polygonOffset:a.polygonOffset,reflectivity:a.reflectivity,atlasRegions:a.atlasRegions,flipV:a.flipV,doubleSided:a.doubleSided,cullFace:a.cullFace,
writeStencil:a.writeStencil,receiveSSAO:a.receiveSSAO,castShadows:a.castShadows,verticalOffset:a.verticalOffset,screenSizePerspective:a.screenSizePerspective,vvSizeEnabled:a.vvSizeEnabled,vvSizeMinSize:a.vvSizeMinSize,vvSizeMaxSize:a.vvSizeMaxSize,vvSizeOffset:a.vvSizeOffset,vvSizeFactor:a.vvSizeFactor,vvSizeValue:a.vvSizeValue,vvColorEnabled:a.vvColorEnabled,vvColorValues:a.vvColorValues,vvColorColors:a.vvColorColors,groundNormalShading:a.groundNormalShading,vvSymbolAnchor:a.vvSymbolAnchor,vvSymbolRotation:a.vvSymbolRotation};
a.textureId&&(b.textureId=a.textureId,b.initTexture=a.initTexture);return b};this.setParameterValues=function(b){for(var d in b)"textureId"===d&&w(a.textureId,"Can only change texture of material that already has a texture"),"castShadows"===d&&w(b.castShadows===a.castShadows,"Can not change shadow casting behavior."),a[d]=b[d];this.notifyDirty("matChanged")};this.getOutputAmount=function(a){var b=q.getStride(c)/4;return a*b};this.getVertexBufferLayout=function(){return c};this.getInstanceBufferLayout=
function(){return f};this.fillInterleaved=function(a,b,d,e,g,f,h){r.fillInterleaved(a,b,d,e,c,g,f,h)};this.intersect=function(b,d,e,c,g,f,h,m){if(null!=a.verticalOffset){m=c.camera;D.set3(e[12],e[13],e[14],N);var l=D.subtract(N,m.eye,R),p=D.length(l),n=D.scale(l,1/p),k=null,l=null;switch(c.viewingMode){case "global":l=D.normalize(N,P);break;case "local":l=D.set(O,P)}a.screenSizePerspective&&(k=D.dot(l,n));m=r.verticalOffsetAtDistance(m,p,a.verticalOffset,k,a.screenSizePerspective);D.scale(l,m);G.multiplyVec3(c.transformInverseRotation,
l,U);g=D.subtract(g,U,K);f=D.subtract(f,U,L)}r.intersectTriangleGeometry(b,d,e,c,g,f,h)};this.getGLMaterials=function(){return{color:ca,depthShadowMap:a.castShadows?e:null,normal:d,depth:Q,highlight:g}};this.getAllTextureIds=function(){var b=[];a.textureId&&b.push(a.textureId);a.reflTextureId&&b.push(a.reflTextureId);return b}};S.paramsFromOldConstructor=function(a,b,d,e,c,g,f,h,l,p,n,k,q){return{textureId:a,transparent:b,ambient:d,diffuse:e,specular:c,shininess:g,opacity:f,polygonOffset:h,initTexture:l,
reflTextureId:p,reflectivity:n,flipV:k,doubleSided:q,cullFace:void 0}};var T=function(a,b){var d=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!1):(a.setFaceCullingEnabled(!0),"front"===b.cullFace&&a.setCullFace(d.FRONT))},V=function(a,b){var d=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!0):(a.setFaceCullingEnabled(!1),"front"===b.cullFace&&a.setCullFace(d.BACK))},h=function(a,b){return a?t.TRANSPARENT_MATERIAL:b?t.STENCIL_MATERIAL:t.OPAQUE_MATERIAL},
ca=function(a,b,d){r.basicGLMaterialConstructor(this,a);var e=r.copyParameters(a.getParams()),c=h(e.transparent,e.writeStencil);r.singleTextureGLMaterialConstructor(this,d,e);var g=r.aquireIfNotUndefined(e.reflTextureId,e.reflInitTexture,d);g&&(g=g.getGLTexture());w(!(e.atlasRegions&&e.reflTextureId),"Atlas texture with reflection is not yet supported");var f=e.textureId?e.atlasRegions?"AtlasTextured":"Textured":"none";this.instanced=z&&e.instanced;var m=!!this.instanced&&-1<this.instanced.indexOf("color"),
l=!z&&e.instanced&&-1<e.instanced.indexOf("color"),p=[[null,null],[null,null]],n,k=null;this._loadPrograms=function(){p[0][0]=this._loadProgram(!1,!1);p[1][0]=this._loadProgram(!0,!1);e.receiveSSAO?(p[0][1]=this._loadProgram(!1,!0),p[1][1]=this._loadProgram(!0,!0),n=p[0].concat(p[1])):(p[0][1]=p[0][0],p[1][1]=p[1][0],n=[p[0][0],p[1][0]])};this._loadProgram=function(a,d){return b.getShaderVariationsProgram("material",[f,!!e.reflTextureId,e.vertexColors,e.symbolColors,e.flipV,e.doubleSided,!!this.instanced,
m,a,d,!!e.vvSizeEnabled,!!e.vvColorEnabled,null!=e.verticalOffset,null!=e.screenSizePerspective,e.groundNormalShading])};this._loadPrograms();var q="AtlasTextured"===f,t=this.dispose;this.dispose=function(){t();r.releaseIfNotUndefined(e.reflTextureId,d)};this.beginSlot=function(a){return c===a};this.getProgram=function(){return k||p[0][0]};this.getAllPrograms=function(){return n};this.updateParameters=function(){var b=a.getParams();e.ambient=b.ambient;e.diffuse=b.diffuse;e.specular=b.specular;e.externalColor=
b.externalColor;e.colorMixMode=b.colorMixMode;e.shininess=b.shininess;e.opacity=b.opacity;e.layerOpacity=b.layerOpacity;e.polygonOffset=b.polygonOffset;e.reflectivity=b.reflectivity;e.flipV=b.flipV;e.doubleSided=b.doubleSided;e.cullFace=b.cullFace;e.receiveSSAO=b.receiveSSAO;e.castShadows=b.castShadows;e.verticalOffset=b.verticalOffset;e.screenSizePerspective=b.screenSizePerspective;B(e,b);e.vvColorEnabled=b.vvColorEnabled;e.vvColorValues=b.vvColorValues;e.vvColorColors=b.vvColorColors;e.transparent!=
b.transparent&&(c=h(b.transparent),e.transparent=b.transparent);e.groundNormalShading=b.groundNormalShading;e.initTexture=b.initTexture;this.updateTexture(b.textureId);b.atlasRegions&&(e.atlasRegions=b.atlasRegions);e.blendModeOneOne=b.blendModeOneOne;e.inverseWindingOrder=b.inverseWindingOrder;this._loadPrograms()};this.bind=function(a,b){var d=a.gl;k=p[b.shadowMappingEnabled?1:0][b.ssaoEnabled?1:0];a.bindProgram(k);k.setUniform3fv("ambient",e.ambient);k.setUniform3fv("diffuse",e.diffuse);k.setUniform3fv("specular",
e.specular);k.setUniform4fv("externalColor",e.externalColor);k.setUniform1i("colorMixMode",r.colorMixModes[e.colorMixMode]);k.setUniform1f("shininess",e.shininess);k.setUniform1f("opacity",e.opacity);k.setUniform1f("layerOpacity",e.layerOpacity);r.bindVerticalOffset(e.verticalOffset,b,k);r.bindScreenSizePerspective(e.screenSizePerspective,k);y(k,e);this.bindTexture(a,k);q&&this.bindTextureSize(a,k);a.setBlendFunctionSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA);void 0!==
g&&(k.setUniform1i("reflTex",1),a.bindTexture(g,1),k.setUniform1f("reflectivity",e.reflectivity));e.inverseWindingOrder&&a.setFrontFace(d.CW);e.transparent?(a.setBlendingEnabled(!0),e.blendModeOneOne?(a.setBlendFunction(d.ONE,d.ONE),a.setDepthWriteEnabled(!1)):a.setBlendFunctionSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)):a.setBlendingEnabled(!1);e.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(2,2));T(a,e);a.setDepthTestEnabled(!0)};this.release=
function(a,b){b=a.gl;a.setPolygonOffsetFillEnabled(!1);V(a,e);a.setBlendingEnabled(!1);a.setBlendFunctionSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA);a.setDepthWriteEnabled(!0);a.setFrontFace(b.CCW)};this.bindView=function(a,b){k=p[b.shadowMappingEnabled?1:0][b.ssaoEnabled?1:0];a=b.origin;r.bindView(a,b.view,k);r.bindCamPos(a,b.viewInvTransp,k);b.shadowMappingEnabled&&b.shadowMap.bindView(k,a)};this.bindInstance=function(a,b){k.setUniformMatrix4fv("model",b.transformation);
k.setUniformMatrix4fv("modelNormal",b.transformationNormal);b.instanceParameters&&l&&(a=b.instanceParameters.color)&&k.setUniform4fv("externalColor",v(a,e.externalColor))};this.getDrawMode=function(a){return a.gl.TRIANGLES}},Q=function(a,b,d,e){r.basicGLMaterialConstructor(this,a);var c=r.copyParameters(a.getParams());this.instanced=z&&c.instanced;var g=q.hasAttribute(a.getVertexBufferLayout(),"uv0")?"Textured":"none",f=b.getShaderVariationsProgram("material-depth",[g,c.flipV,!!this.instanced,!!e,
!!c.vvSizeEnabled,null!=c.verticalOffset,null!=c.screenSizePerspective]),m=h(c.transparent,c.writeStencil);r.singleTextureGLMaterialConstructor(this,d,c);this.beginSlot=function(a){return m===a};this.getProgram=function(){return f};this.updateParameters=function(){var b=a.getParams();c.initTexture=b.initTexture;c.cullFace=b.cullFace;c.inverseWindingOrder=b.inverseWindingOrder;c.flipV=b.flipV;B(c,b);this.updateTexture(b.textureId)};this.bind=function(a,b){var d=a.gl;a.bindProgram(f);f.setUniform2fv("nearFar",
b.nearFar);c.inverseWindingOrder&&a.setFrontFace(d.CW);r.bindVerticalOffset(c.verticalOffset,b,f);r.bindScreenSizePerspective(c.screenSizePerspective,f);y(f,c);this.bindTexture(a,f);T(a,c);a.setDepthTestEnabled(!0)};this.release=function(a){var b=a.gl;V(a,c);c.inverseWindingOrder&&a.setFrontFace(b.CCW)};this.bindView=function(a,b){r.bindView(b.origin,b.view,f);c.screenSizePerspective&&r.bindCamPos(b.origin,b.viewInvTransp,f)};this.bindInstance=function(a,b){f.setUniformMatrix4fv("model",b.transformation)};
this.getDrawMode=function(a){return a.gl.TRIANGLES}},e=function(a,b,d){Q.call(this,a,b,d,!0)},d=function(a,b,d){r.basicGLMaterialConstructor(this,a);var e=r.copyParameters(a.getParams()),c=q.hasAttribute(a.getVertexBufferLayout(),"uv0")?"Textured":"none";this.instanced=z&&e.instanced;var g=b.getShaderVariationsProgram("material-normal",[c,e.flipV,!!this.instanced,!!e.vvSizeEnabled,null!=e.verticalOffset,null!=e.screenSizePerspective]),f=h(e.transparent,e.writeStencil);r.singleTextureGLMaterialConstructor(this,
d,e);this.beginSlot=function(a){return f===a};this.getProgram=function(){return g};this.updateParameters=function(){var b=a.getParams();e.initTexture=b.initTexture;e.cullFace=b.cullFace;e.inverseWindingOrder=b.inverseWindingOrder;e.flipV=b.flipV;B(e,b);this.updateTexture(b.textureId)};this.bind=function(a,b){var d=a.gl;a.bindProgram(g);this.bindTexture(a,g);g.setUniformMatrix4fv("viewNormal",b.viewInvTransp);r.bindVerticalOffset(e.verticalOffset,b,g);r.bindScreenSizePerspective(e.screenSizePerspective,
g);y(g,e);T(a,e);e.inverseWindingOrder&&a.setFrontFace(d.CW);a.setDepthTestEnabled(!0)};this.release=function(a){var b=a.gl;V(a,e);e.inverseWindingOrder&&a.setFrontFace(b.CCW)};this.bindView=function(a,b){r.bindView(b.origin,b.view,g);e.screenSizePerspective&&r.bindCamPos(b.origin,b.viewInvTransp,g)};this.bindInstance=function(a,b){g.setUniformMatrix4fv("model",b.transformation);g.setUniformMatrix4fv("modelNormal",b.transformationNormal)};this.getDrawMode=function(a){return a.gl.TRIANGLES}},g=function(a,
b,d,e){r.basicGLMaterialConstructor(this,a);var c=r.copyParameters(a.getParams());e=q.hasAttribute(a.getVertexBufferLayout(),"uv0")?"Textured":"none";this.instanced=z&&c.instanced;var g=b.getShaderVariationsProgram("material-highlight",[e,c.flipV,!!this.instanced,!!c.vvSizeEnabled,null!=c.verticalOffset,null!=c.screenSizePerspective]),f=h(c.transparent,c.writeStencil);r.singleTextureGLMaterialConstructor(this,d,c);this.beginSlot=function(a){return f===a};this.getProgram=function(){return g};this.updateParameters=
function(){var b=a.getParams();c.initTexture=b.initTexture;c.cullFace=b.cullFace;c.inverseWindingOrder=b.inverseWindingOrder;c.flipV=b.flipV;B(c,b);this.updateTexture(b.textureId)};this.bind=function(a,b){var d=a.gl;a.bindProgram(g);this.bindTexture(a,g);r.bindVerticalOffset(c.verticalOffset,b,g);r.bindScreenSizePerspective(c.screenSizePerspective,g);y(g,c);T(a,c);c.inverseWindingOrder&&a.setFrontFace(d.CW);a.setDepthTestEnabled(!0)};this.release=function(a){var b=a.gl;V(a,c);c.inverseWindingOrder&&
a.setFrontFace(b.CW)};this.bindView=function(a,b){r.bindView(b.origin,b.view,g);c.screenSizePerspective&&r.bindCamPos(b.origin,b.viewInvTransp,g)};this.bindInstance=function(a,b){g.setUniformMatrix4fv("model",b.transformation);g.setUniformMatrix4fv("modelNormal",b.transformationNormal)};this.getDrawMode=function(a){return a.gl.TRIANGLES}};S.getVertexBufferLayout=function(a){var b="Pos3";a.groundNormalShading||(b+="Norm");a.textureId&&(b=a.atlasRegions?b+"TexRegion":b+"Tex");a.vertexColors&&(b+="Col");
a.symbolColors&&(b+="Symcol");return f[b]};S.loadShaders=function(b,d,e,c){b._parse(x);z=c.extensions.angleInstancedArrays;c.extensions.shaderTextureLOD;c.extensions.standardDerivatives;var g=new a("phong",["vsPhong","fsPhong"],null,e,d,b,c);g.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);g.addBinaryShaderSnippetSuffix("Refl","Refl",[!1,!0]);g.addDefine("Color","VERTEXCOLORS");g.addDefine("symbolColor","SYMBOLVERTEXCOLORS");
g.addDefine("FlipV","FLIPV");g.addDefine("DoubleSided","DOUBLESIDED");g.addDefine("Instanced","INSTANCED");g.addDefine("InstColor","INSTANCEDCOLOR");g.addDefine("ReceiveShadows","RECEIVE_SHADOWS");g.addDefine("ReceiveSSAO","RECEIVE_SSAO");g.addDefine("vvSize","VV_SIZE");g.addDefine("vvColor","VV_COLOR");g.addDefine("VerticalOffset","VERTICAL_OFFSET");g.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");g.addDefine("groundNormalShading","GROUND_NORMAL_SHADING");e.addShaderVariations("material",
g);g=new a("depth",["vsDepth","fsDepth"],null,e,d,b,c);g.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);g.addDefine("FlipV","FLIPV");g.addDefine("Instanced","INSTANCED");g.addDefine("ShadowMap","BIAS_SHADOWMAP");g.addDefine("vvSize","VV_SIZE");g.addDefine("VerticalOffset","VERTICAL_OFFSET");g.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");e.addShaderVariations("material-depth",g);g=new a("normal",["vsNormal",
"fsNormal"],null,e,d,b,c);g.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);g.addDefine("FlipV","FLIPV");g.addDefine("Instanced","INSTANCED");g.addDefine("vvSize","VV_SIZE");g.addDefine("VerticalOffset","VERTICAL_OFFSET");g.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");e.addShaderVariations("material-normal",g);g=new a("highlight",["vsHighlight","fsHighlight"],null,e,d,b,c);g.addNaryShaderSnippetSuffix([{value:"none",
programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);g.addDefine("FlipV","FLIPV");g.addDefine("Instanced","INSTANCED");g.addDefine("vvSize","VV_SIZE");g.addDefine("VerticalOffset","VERTICAL_OFFSET");g.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");e.addShaderVariations("material-highlight",g);var g=new k(c,b.vsDepth,b.fsDepth,n.Default3D,["BIAS_SHADOWMAP 1"]),f=new k(c,b.vsDepthTextured,b.fsDepthTextured,n.Default3D,["BIAS_SHADOWMAP 1"]),h=new k(c,
b.vsDepth,b.fsDepth,n.Default3D),m=new k(c,b.vsDepthTextured,b.fsDepthTextured,n.Default3D),l=new k(c,b.vsNormal,b.fsNormal,n.Default3D),p=new k(c,b.vsNormalTextured,b.fsNormalTextured,n.Default3D),q=new k(c,b.vsHighlight,b.fsHighlight,n.Default3D);c=new k(c,b.vsHighlightTextured,b.fsHighlightTextured,n.Default3D);e.add("depthShadowMap",g);e.add("depthTexturedShadowMap",f);e.add("depth",h);e.add("depthTextured",m);e.add("normal",l);e.add("normalTextured",p);e.add("highlight",q);e.add("highlightTextured",
c);d.add("fsDepth",{source:b.fsDepth});d.add("fsDepthTextured",{source:b.fsDepthTextured});d.add("fsDepthShadowMap",{source:b.fsDepthShadowMap,defines:["BIAS_SHADOWMAP 1"]});d.add("fsDepthTexturedShadowMap",{source:b.fsDepthTextured,defines:["BIAS_SHADOWMAP 1"]});d.add("vsDepth",{source:b.vsDepth});d.add("fsNormal",{source:b.fsNormal})};return S})},"esri/views/3d/layers/graphics/graphicUtils":function(){define(["require","exports","../../../../geometry","../../../../geometry/support/webMercatorUtils",
"../../lib/glMatrix"],function(x,r,k,a,b){function c(b,c){var f=b.spatialReference;f.equals(c)||(f.isWebMercator&&c.wkid===k.SpatialReference.WGS84.wkid?a.webMercatorToGeographic(b,!1,b):c.isWebMercator&&f.wkid===k.SpatialReference.WGS84.wkid&&a.geographicToWebMercator(b,!1,b))}function t(a){if(Array.isArray(a)){for(var b=0;b<a.length;b++)if(!t(a[b]))return!1;return!0}return null==a||0<=a}Object.defineProperty(r,"__esModule",{value:!0});var n=b.vec4d,f=b.mat4d,q=[1,1,1];r.computeCentroid=function(a,
b){if("extent"===a.type)return a.center;if("polygon"===a.type)return a.centroid;for(var f=0,l=0,n=0,q=a.hasZ,t=0,y=0,p=a.paths;y<p.length;y++){for(var r=p[y],A=0,J=r;A<J.length;A++){var I=J[A],f=f+I[0],l=l+I[1];q&&(n+=I[2])}t+=r.length}a=new k.Point({x:f/t,y:l/t,z:q?n/t:void 0,spatialReference:a.spatialReference});b&&c(a,b);return a};r.convertToSR=c;r.enlargeExtent=function(a,b,c){if(a){b||(b=n.create());var f=.5*a.width*(c-1);c=.5*a.height*(c-1);a.width<1E-7*a.height?f+=c/20:a.height<1E-7*a.width&&
(c+=f/20);n.set4(a.xmin-f,a.ymin-c,a.xmax+f,a.ymax+c,b);return b}return null};r.updateVertexAttributeAuxpos1w=function(a,b){for(var c=0;c<a.geometries.length;++c){var f=a.geometries[c].data.vertexAttributes.auxpos1;f&&f.data[3]!==b&&(f.data[3]=b,a.geometryVertexAttrsUpdated(c))}};r.mixinColorAndOpacity=function(a,b){var c=[1,1,1,1];null!=a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2]);null!==b&&void 0!==b?c[3]=b:null!=a&&3<a.length&&(c[3]=a[3]);return c};r.overrideColor=function(a,b,c,f,n){n=[n[0],n[1],n[2],n[3]];
for(var l=0;3>l;++l)a&&null!=a[l]?n[l]=a[l]:c&&null!=c[l]&&(n[l]=c[l]);null!=b?n[3]=b:null!=f&&(n[3]=f);return n};r.computeObjectScale=function(a,b,c,f){void 0===a&&(a=q);void 0===f&&(f=1);var l=Array(3);if(null==b||null==c)l[0]=1,l[1]=1,l[2]=1;else{for(var n=void 0,k=0,t=2;0<=t;t--){var p=a[t],v=void 0,y=null!=p,r=0===t&&!n&&!y,B=c[t];"symbolValue"===p||r?v=0!==B?b[t]/B:1:y&&"proportional"!==p&&isFinite(p)&&(v=0!==B?p/B:1);null!=v&&(n=l[t]=v,k=Math.max(k,Math.abs(v)))}for(t=2;0<=t;t--)null==l[t]?
l[t]=n:0===l[t]&&(l[t]=.001*k)}for(t=2;0<=t;t--)l[t]/=f;return l};r.computeSizeWithResourceSize=function(a,b){var c=b.width,f=b.depth,l=b.height;b=b.isPrimitive?10:1;if(null==c&&null==l&&null==f)return[b*a[0],b*a[1],b*a[2]];for(var c=[c,f,l],n,f=0;3>f;f++)if(l=c[f],null!=l){n=l/a[f];break}for(f=0;3>f;f++)null==c[f]&&(c[f]=a[f]*n);return c};r.validateSymbolLayerSize=function(a){null!=a.isPrimitive&&(a=[a.width,a.depth,a.height]);return t(a)?null:"Symbol sizes may not be negative values"};r.computeObjectRotation=
function(a,b,c,n){void 0===n&&(n=f.identity());a=a||0;b=b||0;c=c||0;0!==a&&f.rotateZ(n,-a/180*Math.PI,n);0!==b&&f.rotateX(n,b/180*Math.PI,n);0!==c&&f.rotateY(n,c/180*Math.PI,n);return n}})},"esri/views/3d/webgl-engine/materials/RibbonLineMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./RibbonLineMaterial.xml ./internal/MaterialUtil ./internal/MaterialBase ./internal/GLMaterialBase ../lib/Util ../lib/gl-matrix ../lib/RenderSlot ../lib/ComponentUtils ../lib/DefaultVertexBufferLayouts ../lib/ShaderVariations ../../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){x=function(c){function q(a,f){f=c.call(this,f)||this;f.params=b.copyParameters(a,P);"miter"!==f.params.join&&(f.params.miterLimit=0);f.numVertsAtJoin="wall"===f.params.type?2:4;f.numVertsAtCap=2;f.canBeMerged="screen"===f.params.type&&null==f.params.stippleLength;return f}k(q,c);q.prototype.setColor=function(a){this.params.color=a;this.notifyDirty("matChanged")};q.prototype.getColor=function(){return this.params.color};q.prototype.dispose=function(){};q.prototype.getParams=
function(){return this.params};q.prototype.getParameterValues=function(){var a=this.params;return{color:a.color,width:a.width,type:a.type,join:a.join,polygonOffset:a.polygonOffset,miterLimit:a.miterLimit,stippleLength:a.stippleLength}};q.prototype.setParameterValues=function(a){for(var b in a)n.assert("type"!==b,"RibbonLineMaterial: type cannot be changed after creation"),n.assert("stippleLength"!==b||null!=a[b]===(null!=this.params[b]),"RibbonLineMaterial: stippleLength on/off cannot be changed after creation"),
this.params[b]=a[b];"miter"!==this.params.join&&(this.params.miterLimit=0);this.notifyDirty("matChanged")};q.prototype.getOutputAmount=function(a){a=(a/2+1-2)*this.numVertsAtJoin+2*this.numVertsAtCap;this.canBeMerged&&(a+=2);return a*v.getStride(N)/4};q.prototype.getInstanceBufferLayout=function(){};q.prototype.getVertexBufferLayout=function(){return"wall"===this.params.type?U:N};q.prototype.fillInterleaved=function(a,b,c,f,l,e){c=a.vertexAttr[n.VertexAttrConstants.POSITION].data;f=a.vertexAttr[n.VertexAttrConstants.COLOR]?
a.vertexAttr[n.VertexAttrConstants.COLOR].data:F;var d=a.vertexAttr[n.VertexAttrConstants.SIZE]?a.vertexAttr[n.VertexAttrConstants.SIZE].data:G;(a=a.indices&&a.indices[n.VertexAttrConstants.POSITION])&&a.length!==2*(c.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");"wall"===this.params.type?this.fillWithoutAuxpos(c,b,l,e):this.fillWithAuxpos(c,f,d,b,l,e)};q.prototype.intersect=function(a,b,c,k,q,e,d,g){if(k.isSelection&&!l.isAllHidden(b.componentVisibilities,a.data.componentOffsets)){b=
a.getData();a=b.getVertexAttr()[n.VertexAttrConstants.POSITION].data;b=b.getVertexAttr()[n.VertexAttrConstants.SIZE];b=(b&&b.data[0])+this.params.width;q=Number.MAX_VALUE;var h,t;e=k.camera;g=k.point;for(var v=0;v<a.length-5;v+=3){p[0]=a[v];p[1]=a[v+1];p[2]=a[v+2];f.mat4d.multiplyVec3(c,p);z[0]=a[v+3];z[1]=a[v+4];z[2]=a[v+5];f.mat4d.multiplyVec3(c,z);e.projectPoint(p,I);e.projectPoint(z,K);if(0>I[2]&&0<K[2])f.vec3d.subtract(p,z,A),h=e.frustumPlanes,t=-(f.vec3d.dot(h[4],p)+h[4][3]),h=t/f.vec3d.dot(A,
h[4]),f.vec3d.scale(A,h,A),f.vec3d.add(p,A,p),e.projectPoint(p,I);else if(0<I[2]&&0>K[2])f.vec3d.subtract(z,p,A),h=e.frustumPlanes,t=-(f.vec3d.dot(h[4],z)+h[4][3]),h=t/f.vec3d.dot(A,h[4]),f.vec3d.scale(A,h,A),f.vec3d.add(z,A,z),e.projectPoint(z,K);else if(0>I[2]&&0>K[2])continue;h=n.pointLineSegmentDistance2D(I,K,g);h<q&&(q=h,f.vec3d.set(p,L),f.vec3d.set(z,O))}c=k.p0;k=k.p1;q<b/2+4&&(a=n.lineSegmentLineSegmentDistance3D(L,O,c,k),b=Number.MAX_VALUE,a[0]&&(f.vec3d.subtract(a[2],c,J),b=f.vec3d.length(J)/
f.vec3d.dist(c,k)),d(b,J))}};q.prototype.getGLMaterials=function(){return{color:w,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:D}};q.prototype.getAllTextureIds=function(){return[]};q.prototype.fillWithAuxpos=function(a,b,c,f,l,e){var d=a.length/3,g=a[0],h=a[1],p=a[2],n=0,k=e,q=v.getStride(this.getVertexBufferLayout())/4;this.canBeMerged&&(e+=q);f&&(g=f[0]*g+f[4]*h+f[8]*p+f[12],h=f[1]*g+f[5]*h+f[9]*p+f[13],p=f[2]*g+f[6]*h+f[10]*p+f[14]);var t=g,y=h,r=p,w=a[3],B=a[4],A=a[5];f&&(w=f[0]*
w+f[4]*B+f[8]*A+f[12],B=f[1]*w+f[5]*B+f[9]*A+f[13],A=f[2]*w+f[6]*B+f[10]*A+f[14]);for(var z=0;z<d;z++){var D=3*z;z<d-1&&(w=a[D+3],B=a[D+4],A=a[D+5],f&&(w=f[0]*w+f[4]*B+f[8]*A+f[12],B=f[1]*w+f[5]*B+f[9]*A+f[13],A=f[2]*w+f[6]*B+f[10]*A+f[14]));n+=Math.sqrt((t-g)*(t-g)+(y-h)*(y-h)+(r-p)*(r-p));l[e++]=t;l[e++]=y;l[e++]=r;l[e++]=n;l[e++]=0===z?-1.2:-1;l[e++]=g;l[e++]=h;l[e++]=p;l[e++]=w;l[e++]=B;l[e++]=A;l[e++]=b[0];l[e++]=b[1];l[e++]=b[2];l[e++]=b[3];l[e++]=c[0];l[e++]=t;l[e++]=y;l[e++]=r;l[e++]=n;l[e++]=
0===z?1.2:1;l[e++]=g;l[e++]=h;l[e++]=p;l[e++]=w;l[e++]=B;l[e++]=A;l[e++]=b[0];l[e++]=b[1];l[e++]=b[2];l[e++]=b[3];l[e++]=c[0];0<z&&z<d-1&&(l[e++]=t,l[e++]=y,l[e++]=r,l[e++]=n,l[e++]=-1.2,l[e++]=g,l[e++]=h,l[e++]=p,l[e++]=w,l[e++]=B,l[e++]=A,l[e++]=b[0],l[e++]=b[1],l[e++]=b[2],l[e++]=b[3],l[e++]=c[0],l[e++]=t,l[e++]=y,l[e++]=r,l[e++]=n,l[e++]=1.2,l[e++]=g,l[e++]=h,l[e++]=p,l[e++]=w,l[e++]=B,l[e++]=A,l[e++]=b[0],l[e++]=b[1],l[e++]=b[2],l[e++]=b[3],l[e++]=c[0]);g=t;h=y;p=r;t=w;y=B;r=A}if(this.canBeMerged){for(z=
k;z<k+q;z++)l[z]=l[z+q];a=e-q;for(z=0;z<q;z++)l[e++]=l[a++]}};q.prototype.fillWithoutAuxpos=function(a,b,c,f){for(var h=a.length/3,e=0,d=a[0],g=a[1],l=a[2],p,n,k,q=0;q<h;q++){var t=3*q;p=d;n=g;k=l;d=a[t];g=a[t+1];l=a[t+2];b&&(d=b[0]*d+b[4]*g+b[8]*l+b[12],g=b[1]*d+b[5]*g+b[9]*l+b[13],l=b[2]*d+b[6]*g+b[10]*l+b[14]);e+=Math.sqrt((d-p)*(d-p)+(g-n)*(g-n)+(l-k)*(l-k));c[f++]=d;c[f++]=g;c[f++]=l;c[f++]=e;c[f++]=-1;c[f++]=d;c[f++]=g;c[f++]=l;c[f++]=e;c[f++]=1}};q.loadShaders=function(b,c,f,l){b._parse(a);
var h=function(a){a.addDefine("Screen","SCREENSCALE");a.addDefine("Strip","STRIP");a.addDefine("Wall","WALL");a.addDefine("Stipple","STIPPLE")},e=new B("ribbon-line",["vsRibbonLine","fsRibbonLine"],null,f,c,b,l);h(e);f.addShaderVariations("ribbon-line-material-shader-variations",e);b=new B("ribbon-line",["vsRibbonLine","fsRibbonLineHighlight"],null,f,c,b,l);h(b);f.addShaderVariations("ribbon-line-material-highlight-shader-variations",b)};return q}(c.MaterialBase);var w=function(a){function c(c,f){var h=
a.call(this,c,f)||this;h.params=b.copyParameters(c.getParams());delete h.params.join;h.program=f.getShaderVariationsProgram("ribbon-line-material-shader-variations",["screen"===h.params.type,"strip"===h.params.type,"wall"===h.params.type,null!=h.params.stippleLength]);return h}k(c,a);c.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.polygonOffset=a.polygonOffset;b.color=a.color;b.width=a.width;b.miterLimit="miter"===a.join?a.miterLimit:0;b.stippleLength=a.stippleLength};
c.prototype.beginSlot=function(a){return a===q.TRANSPARENT_MATERIAL};c.prototype.getProgram=function(){return this.program};c.prototype.bind=function(a,b){var c=this.program,f=this.params;a.bindProgram(c);c.setUniform4fv("eColor",f.color);c.setUniform1f("miterLimit",f.miterLimit);c.setUniform1f("nearPlane",b.nearFar[0]);"screen"===f.type?(c.setUniform2fv("screenSize",[b.viewport[2],b.viewport[3]]),c.setUniform1f("extLineWidth",f.width*b.pixelRatio)):c.setUniform1f("extLineWidth",f.width);null!=f.stippleLength&&
c.setUniform1f("stippleLengthDoubleInv",f.stippleLength?1/(2*f.stippleLength):0);f.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));a.setFaceCullingEnabled(!1);a.setBlendingEnabled(!0);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(1<=f.color[3])};c.prototype.release=function(a){this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1);a.setBlendingEnabled(!1);a.setDepthWriteEnabled(!0)};
c.prototype.bindView=function(a,c){b.bindView(c.origin,c.view,this.program)};c.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};c.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};return c}(t.GLMaterialBase),D=function(a){function c(c,f){var h=a.call(this,c,f)||this;h.params=b.copyParameters(c.getParams());delete h.params.join;h.program=f.getShaderVariationsProgram("ribbon-line-material-highlight-shader-variations",["screen"===h.params.type,
"strip"===h.params.type,"wall"===h.params.type,null!=h.params.stippleLength]);return h}k(c,a);c.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.polygonOffset=a.polygonOffset;b.color=a.color;b.width=a.width;b.miterLimit="miter"===a.join?a.miterLimit:0;b.stippleLength=a.stippleLength};c.prototype.beginSlot=function(a){return a===q.OPAQUE_MATERIAL};c.prototype.getProgram=function(){return this.program};c.prototype.bind=function(a,b){var c=this.program,f=this.params;
a.bindProgram(c);c.setUniform4fv("eColor",f.color);c.setUniform1f("miterLimit",f.miterLimit);c.setUniform1f("nearPlane",b.nearFar[0]);"screen"===f.type?(c.setUniform2fv("screenSize",[b.viewport[2],b.viewport[3]]),c.setUniform1f("extLineWidth",f.width*b.pixelRatio)):c.setUniform1f("extLineWidth",f.width);null!=f.stippleLength&&c.setUniform1f("stippleLengthDoubleInv",f.stippleLength?1/(2*f.stippleLength):0);f.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));a.setFaceCullingEnabled(!1);
a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(1<=f.color[3])};c.prototype.release=function(a){this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1);a.setDepthWriteEnabled(!0)};c.prototype.bindView=function(a,c){b.bindView(c.origin,c.view,this.program)};c.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};c.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};return c}(t.GLMaterialBase),F=[255,255,255,255],G=[0,0,0,0],p=f.vec3d.create(),
z=f.vec3d.create(),A=f.vec3d.create(),J=f.vec3d.create(),I=f.vec2d.create(),K=f.vec2d.create(),L=f.vec3d.create(),O=f.vec3d.create(),P={color:[1,1,1,1],width:0,type:"screen",join:"miter",miterLimit:5,polygonOffset:!1,stippleLength:null},U=y.Pos3Tex,N=[{name:"position",count:3,type:5126,offset:0,stride:64,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:64,normalized:!1},{name:"auxpos1",count:3,type:5126,offset:20,stride:64,normalized:!1},{name:"auxpos2",count:3,type:5126,offset:32,stride:64,
normalized:!1},{name:"color",count:4,type:5126,offset:44,stride:64,normalized:!1},{name:"size",count:1,type:5126,offset:60,stride:64,normalized:!1}];return x})},"esri/views/3d/webgl-engine/materials/WaterMaterial":function(){define("dojo/text!./WaterMaterial.xml ./internal/MaterialUtil ../lib/RenderSlot ../../../webgl/Program ../lib/DefaultVertexAttributeLocations ../lib/DefaultVertexBufferLayouts ../../../webgl/Util".split(" "),function(x,r,k,a,b,c,t){var n=function(a,b,n,k,v,w){r.basicMaterialConstructor(this,
w);var l=c.Pos3;this.dispose=function(){};this.getNoiseTextureId=function(){return a};this.getReflTextureId=function(){return b};this.getColor=function(){return n};this.getScale=function(){return k};this.getSpeed=function(){return v};this.getOutputAmount=function(a){return a*t.getStride(l)/4};this.getVertexBufferLayout=function(){return l};this.fillInterleaved=function(a,b,c,f,n,k,q){r.fillInterleaved(a,b,c,f,l,n,k,q)};this.intersect=r.intersectTriangleGeometry;this.getGLMaterials=function(){return{color:f,
depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};this.getAllTextureIds=function(){return[a,b]}},f=function(a,b,c){r.basicGLMaterialConstructor(this,a);var f=k.TRANSPARENT_MATERIAL,l=b.get("water");b={noiseTextureId:a.getNoiseTextureId(),reflTextureId:a.getReflTextureId()};r.multiTextureGLMaterialConstructor(this,c,b,[["noiseTextureId",void 0,"noiseTex"],["reflTextureId",void 0,"reflTex"]]);var n=a.getColor(),q=a.getScale(),t=a.getSpeed(),y=Date.now();this.beginSlot=function(a){return f===
a};this.getProgram=function(){return l};this.bind=function(a,b){a.bindProgram(l);this.bindTextures(a,l);l.setUniform3fv("color",n);l.setUniform1f("scale",q);a=(Date.now()-y)/1E5*t;a-=Math.floor(a);l.setUniform1f("speed",a);b.shadowMappingEnabled||l.setUniform1f("depthHalfPixelSz",-1)};this.release=function(a){};this.bindView=function(a,b){a=b.origin;r.bindView(a,b.view,l);r.bindCamPos(a,b.viewInvTransp,l);b.shadowMappingEnabled&&b.shadowMap.bindView(l,a)};this.bindInstance=function(a,b){l.setUniformMatrix4fv("model",
b.transformation)};this.getDrawMode=function(a){return a.gl.TRIANGLES}};n.loadShaders=function(c,f,n,k){c._parse(x);c=new a(k,c.vertexShaderWater,c.fragmentShaderWater,b.Default3D);n.add("water",c)};return n})},"esri/views/3d/webgl-engine/materials/MeasurementArrowMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./MeasurementArrowMaterial.xml ./internal/MaterialUtil ../lib/Util ../../../webgl/Util ./internal/MaterialBase ./internal/GLMaterialBase ../lib/gl-matrix ../lib/RenderSlot ../lib/ShaderVariations".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){var B=q.vec3d,v=q.mat4d,w=[{name:c.VertexAttrConstants.POSITION,count:3,type:5126,offset:0,stride:36,normalized:!1},{name:c.VertexAttrConstants.NORMAL,count:3,type:5126,offset:12,stride:36,normalized:!1},{name:c.VertexAttrConstants.UV0,count:2,type:5126,offset:24,stride:36,normalized:!1},{name:c.VertexAttrConstants.AUXPOS1,count:1,type:5126,offset:32,stride:36,normalized:!1}],D={width:32,outlineSize:.2,outlineColor:[1,.5,0,1],stripeLength:1,stripeEvenColor:[1,1,1,
1],stripeOddColor:[1,.5,0,1],polygonOffset:!1};x=function(f){function l(a,c){c=f.call(this,c)||this;c.canBeMerged=!1;c.params=b.copyParameters(a,D);return c}k(l,f);l.prototype.dispose=function(){};l.prototype.getParameterValues=function(){var a=this.params;return{width:a.width,outlineSize:a.outlineSize,outlineColor:a.outlineColor,stripeLength:a.stripeLength,stripeEvenColor:a.stripeEvenColor,stripeOddColor:a.stripeOddColor,polygonOffset:a.polygonOffset}};l.prototype.setParameterValues=function(a){b.updateParameters(this.params,
a)&&this.notifyDirty("matChanged")};l.prototype.getParams=function(){return this.params};l.prototype.getOutputAmount=function(a){return 18*(a/2+1)};l.prototype.getInstanceBufferLayout=function(){};l.prototype.getVertexBufferLayout=function(){return w};l.prototype.fillInterleaved=function(a,f,l,n,k,q){n=a.vertexAttr[c.VertexAttrConstants.POSITION].data;var y=a.vertexAttr[c.VertexAttrConstants.NORMAL].data,r=n.length/3;(a=a&&a.indices&&a.indices.position)&&a.length!==2*(r-1)&&console.warn("MeasurementArrowMaterial does not support indices");
a=q+t.findAttribute(w,c.VertexAttrConstants.POSITION).offset/4;var D=q+t.findAttribute(w,c.VertexAttrConstants.NORMAL).offset/4,h=q+t.findAttribute(w,c.VertexAttrConstants.UV0).offset/4;q+=t.findAttribute(w,c.VertexAttrConstants.AUXPOS1).offset/4;for(var F=G,I=p,e=z,d=A,g=J,m=0,u=0;u<r;++u){var C=3*u;B.set3(n[C],n[C+1],n[C+2],F);u<r-1&&(C=3*(u+1),B.set3(n[C],n[C+1],n[C+2],I),B.set3(y[C],y[C+1],y[C+2],g),B.normalize(g),B.subtract(I,F,e),B.normalize(e),B.cross(g,e,d),B.normalize(d));C=B.dist(F,I);f&&
l&&(v.multiplyVec3(f,F),v.multiplyVec3(f,I),v.multiplyVec3(l,d));b.fill(F,0,k,a,void 0,3);a+=9;b.fill(F,0,k,a,void 0,3);a+=9;b.fill(d,0,k,D,void 0,3);D+=9;b.fill(d,0,k,D,void 0,3);D+=9;k[h]=m;k[h+1]=-1;h+=9;k[h]=m;k[h+1]=1;h+=9;u<r-1&&(m+=C)}for(u=0;u<r;++u)k[q]=m,q+=9,k[q]=m,q+=9};l.prototype.intersect=function(a,b,c,f,l,p,n,k){};l.prototype.getGLMaterials=function(){return{color:F,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};l.prototype.getAllTextureIds=function(){return[]};
l.loadShaders=function(b,c,f,l){b._parse(a);b=new y("measurement-arrow",["vsMeasurementArrow","fsMeasurementArrow"],null,f,c,b,l);f.addShaderVariations("measurement-arrow-material-shader-variations",b)};return l}(n.MaterialBase);var F=function(a){function c(c,f,l){l=a.call(this,c,f,l)||this;l.programRep=f;l.params=b.copyParameters(c.getParams());l.selectProgram();return l}k(c,a);c.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("measurement-arrow-material-shader-variations",
[])};c.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};c.prototype.beginSlot=function(a){return a===l.OPAQUE_MATERIAL};c.prototype.getProgram=function(){return this.program};c.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};c.prototype.bind=function(a,b){b=this.program;a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);a.setFaceCullingEnabled(!1);a.setBlendingEnabled(!1);this.params.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),
a.setPolygonOffset(0,-4));a.bindProgram(b);b.setUniform1f("width",this.params.width);b.setUniform1f("outlineSize",this.params.outlineSize);b.setUniform4fv("outlineColor",this.params.outlineColor);b.setUniform1f("stripeLength",this.params.stripeLength);b.setUniform4fv("stripeEvenColor",this.params.stripeEvenColor);b.setUniform4fv("stripeOddColor",this.params.stripeOddColor)};c.prototype.bindView=function(a,c){a=c.origin;var f=this.getProgram();b.bindView(a,c.view,f)};c.prototype.bindInstance=function(a,
b){this.getProgram().setUniformMatrix4fv("model",b.transformation)};c.prototype.release=function(a){a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);a.setBlendingEnabled(!1);this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1)};return c}(f.GLMaterialBase),G=B.create(),p=B.create(),z=B.create(),A=B.create(),J=B.create();f=v.create();v.identity(f);return x})},"esri/views/3d/webgl-engine/materials/internal/SimpleGLMaterial":function(){define("require exports dojo/text!./SimpleGLMaterial.xml ./MaterialUtil ../../lib/RenderSlot ../../../../webgl/Program ../../../../webgl/enums ../../lib/DefaultVertexAttributeLocations".split(" "),
function(x,r,k,a,b,c,t,n){return function(){function f(b,c,f,n){void 0===n&&(n=4);this.id=a.__GLMaterial_id++;this.program=b.get("simple");this.color=c;this.depthFunc=f;this.drawMode=n}f.prototype.getId=function(){return this.id};f.prototype.beginSlot=function(a){return a===b.INTERNAL_MATERIAL};f.prototype.getProgram=function(){return this.program};f.prototype.bind=function(b,c){b.bindProgram(this.program);this.program.setUniformMatrix4fv("model",a.IDENTITY);this.program.setUniformMatrix4fv("proj",
c.proj);this.program.setUniform4fv("color",this.color);b.setBlendingEnabled(!0);b.setBlendFunctionSeparate(b.gl.SRC_ALPHA,b.gl.ONE_MINUS_SRC_ALPHA,b.gl.ONE,b.gl.ONE_MINUS_SRC_ALPHA);b.setDepthTestEnabled(!0);void 0!==this.depthFunc&&b.setDepthFunction(this.depthFunc)};f.prototype.release=function(a){void 0!==this.depthFunc&&a.setDepthFunction(513);a.setBlendingEnabled(!1)};f.prototype.bindView=function(b,c){a.bindView(c.origin,c.view,this.program)};f.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",
b.transformation)};f.prototype.getDrawMode=function(a){return this.drawMode};f.loadShaders=function(a,b,f,t){a._parse(k);a=new c(t,a.vertexShaderSimple,a.fragmentShaderSimple,n.Default3D);f.add("simple",a)};return f}()})},"esri/views/3d/webgl-engine/materials/internal/BlendLayers":function(){define(["dojo/text!./BlendLayers.xml","../../../../webgl/Program","../../lib/DefaultVertexAttributeLocations"],function(x,r,k){return{loadShaders:function(a,b,c,t){a._parse(x);a=new r(t,a.vertexShaderBlendLayers,
a.fragmentShaderBlendLayers,k.Default3D);c.add("blendLayers",a)}}})},"esri/views/3d/webgl-engine/lib/tracer":function(){define(["require","exports","./webgl-debug"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});var a=null,b=[];r.enabled=!1;r.begin=function(){r.enabled&&(a=[])};r.trace=function(b){r.enabled&&null!=a&&a.push(b)};r.end=function(){if(r.enabled){var c=a;a=null;c&&(b.forEach(function(a){return a(c)}),b.length=0);return c}};r.instrumentContext=function(b){return r.enabled?
k.makeDebugContext(b,void 0,function(b,c){r.enabled&&a&&a.push("gl."+b+"("+k.glFunctionArgsToString(b,c)+")")}):b};r.request=function(a){b.push(a)}})},"esri/views/3d/webgl-engine/lib/webgl-debug":function(){define([],function(){function x(a){if(null==f){f={};q={};for(var b in a)"number"==typeof a[b]&&(f[a[b]]=b,q[b]=a[b])}}function r(){if(null==f)throw"WebGLDebugUtils.init(ctx) not called";}function k(a){r();var b=f[a];return void 0!==b?"gl."+b:"/*UNKNOWN WebGL ENUM*/ 0x"+a.toString(16)+""}function a(a,
b,c,f){a=n[a];if(void 0!==a&&(a=a[b],void 0!==a&&a[c])){if("object"===typeof a[c]&&void 0!==a[c].enumBitwiseOr){b=a[c].enumBitwiseOr;c=0;a=[];for(var l=0;l<b.length;++l){var t=q[b[l]];0!==(f&t)&&(c|=t,a.push(k(t)))}return c===f?a.join(" | "):k(f)}return k(f)}return null===f?"null":void 0===f?"undefined":f.toString()}function b(a,b,c){a.__defineGetter__(c,function(){return b[c]});a.__defineSetter__(c,function(a){b[c]=a})}function c(f,n,q,t){function l(a,b){return function(){q&&q(b,arguments);var c=
a[b].apply(a,arguments),f=t.getError();0!=f&&(v[f]=!0,n(f,b,arguments));return c}}t=t||f;x(f);n=n||function(b,c,f){for(var l="",p=f.length,n=0;n<p;++n)l+=(0==n?"":", ")+a(c,p,n,f[n]);b="WebGL error "+k(b)+" in "+c+"("+l+")";window.console&&window.console.error?window.console.error(b):window.console&&window.console.log&&window.console.log(b)};var v={},y={},r;for(r in f)if("function"==typeof f[r])if("getExtension"!=r)y[r]=l(f,r);else{var p=l(f,r);y[r]=function(){var a=p.apply(f,arguments);return c(a,
n,q,t)}}else b(y,f,r);y.getError=function(){for(var a in v)if(v.hasOwnProperty(a)&&v[a])return v[a]=!1,a;return f.NO_ERROR};return y}function t(a){var b=a.getParameter(a.MAX_VERTEX_ATTRIBS),c=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,c);for(var f=0;f<b;++f)a.disableVertexAttribArray(f),a.vertexAttribPointer(f,4,a.FLOAT,!1,0,0),a.vertexAttrib1f(f,0);a.deleteBuffer(c);b=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);for(f=0;f<b;++f)a.activeTexture(a.TEXTURE0+f),a.bindTexture(a.TEXTURE_CUBE_MAP,null),
a.bindTexture(a.TEXTURE_2D,null);a.activeTexture(a.TEXTURE0);a.useProgram(null);a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);a.bindFramebuffer(a.FRAMEBUFFER,null);a.bindRenderbuffer(a.RENDERBUFFER,null);a.disable(a.BLEND);a.disable(a.CULL_FACE);a.disable(a.DEPTH_TEST);a.disable(a.DITHER);a.disable(a.SCISSOR_TEST);a.blendColor(0,0,0,0);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.ONE,a.ZERO);a.clearColor(0,0,0,0);a.clearDepth(1);a.clearStencil(-1);a.colorMask(!0,!0,!0,!0);
a.cullFace(a.BACK);a.depthFunc(a.LESS);a.depthMask(!0);a.depthRange(0,1);a.frontFace(a.CCW);a.hint(a.GENERATE_MIPMAP_HINT,a.DONT_CARE);a.lineWidth(1);a.pixelStorei(a.PACK_ALIGNMENT,4);a.pixelStorei(a.UNPACK_ALIGNMENT,4);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);a.UNPACK_COLORSPACE_CONVERSION_WEBGL&&a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);a.polygonOffset(0,0);a.sampleCoverage(1,!1);a.scissor(0,0,a.canvas.width,a.canvas.height);
a.stencilFunc(a.ALWAYS,0,4294967295);a.stencilMask(4294967295);a.stencilOp(a.KEEP,a.KEEP,a.KEEP);a.viewport(0,0,a.canvas.width,a.canvas.height);for(a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT|a.STENCIL_BUFFER_BIT);a.getError(););}var n={enable:{1:{0:!0}},disable:{1:{0:!0}},getParameter:{1:{0:!0}},drawArrays:{3:{0:!0}},drawElements:{4:{0:!0,2:!0}},createShader:{1:{0:!0}},getShaderParameter:{2:{1:!0}},getProgramParameter:{2:{1:!0}},getShaderPrecisionFormat:{2:{0:!0,1:!0}},getVertexAttrib:{2:{1:!0}},
vertexAttribPointer:{6:{2:!0}},bindTexture:{2:{0:!0}},activeTexture:{1:{0:!0}},getTexParameter:{2:{0:!0,1:!0}},texParameterf:{3:{0:!0,1:!0}},texParameteri:{3:{0:!0,1:!0,2:!0}},texImage2D:{9:{0:!0,2:!0,6:!0,7:!0},6:{0:!0,2:!0,3:!0,4:!0}},texSubImage2D:{9:{0:!0,6:!0,7:!0},7:{0:!0,4:!0,5:!0}},copyTexImage2D:{8:{0:!0,2:!0}},copyTexSubImage2D:{8:{0:!0}},generateMipmap:{1:{0:!0}},compressedTexImage2D:{7:{0:!0,2:!0}},compressedTexSubImage2D:{8:{0:!0,6:!0}},bindBuffer:{2:{0:!0}},bufferData:{3:{0:!0,2:!0}},
bufferSubData:{3:{0:!0}},getBufferParameter:{2:{0:!0,1:!0}},pixelStorei:{2:{0:!0,1:!0}},readPixels:{7:{4:!0,5:!0}},bindRenderbuffer:{2:{0:!0}},bindFramebuffer:{2:{0:!0}},checkFramebufferStatus:{1:{0:!0}},framebufferRenderbuffer:{4:{0:!0,1:!0,2:!0}},framebufferTexture2D:{5:{0:!0,1:!0,2:!0}},getFramebufferAttachmentParameter:{3:{0:!0,1:!0,2:!0}},getRenderbufferParameter:{2:{0:!0,1:!0}},renderbufferStorage:{4:{0:!0,1:!0}},clear:{1:{0:{enumBitwiseOr:["COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT"]}}},
depthFunc:{1:{0:!0}},blendFunc:{2:{0:!0,1:!0}},blendFuncSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},blendEquation:{1:{0:!0}},blendEquationSeparate:{2:{0:!0,1:!0}},stencilFunc:{3:{0:!0}},stencilFuncSeparate:{4:{0:!0,1:!0}},stencilMaskSeparate:{2:{0:!0}},stencilOp:{3:{0:!0,1:!0,2:!0}},stencilOpSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},cullFace:{1:{0:!0}},frontFace:{1:{0:!0}},drawArraysInstancedANGLE:{4:{0:!0}},drawElementsInstancedANGLE:{5:{0:!0,2:!0}},blendEquationEXT:{1:{0:!0}}},f=null,q=null;return{init:x,mightBeEnum:function(a){r();
return void 0!==f[a]},glEnumToString:k,glFunctionArgToString:a,glFunctionArgsToString:function(b,c){for(var f="",l=c.length,n=0;n<l;++n)f+=(0==n?"":", ")+a(b,l,n,c[n]);return f},makeDebugContext:c,makeLostContextSimulatingCanvas:function(a){function c(a){return"function"==typeof a?a:function(b){a.handleEvent(b)}}function f(){for(var a=Object.keys(N),b=0;b<a.length;++b)delete N[a]}function l(){++x;I||L==x&&a.loseContext()}function n(a,b){var c=a[b];return function(){l();if(!I)return c.apply(a,arguments)}}
function k(a){return{statusMessage:a,preventDefault:function(){P=!0}}}function q(a){for(var c in a)"function"==typeof a[c]?p[c]=n(a,c):b(p,a,c);p.getError=function(){l();if(!I)for(var a;a=r.getError();)N[a]=!0;for(a in N)if(N[a])return delete N[a],a;return p.NO_ERROR};var f="createBuffer createFramebuffer createProgram createRenderbuffer createShader createTexture".split(" ");for(c=0;c<f.length;++c){var k=f[c];p[k]=function(b){return function(){l();if(I)return null;var c=b.apply(a,arguments);c.__webglDebugContextLostId__=
J;K.push(c);return c}}(a[k])}f="getActiveAttrib getActiveUniform getBufferParameter getContextAttributes getAttachedShaders getFramebufferAttachmentParameter getParameter getProgramParameter getProgramInfoLog getRenderbufferParameter getShaderParameter getShaderInfoLog getShaderSource getTexParameter getUniform getUniformLocation getVertexAttrib".split(" ");for(c=0;c<f.length;++c)k=f[c],p[k]=function(b){return function(){l();return I?null:b.apply(a,arguments)}}(p[k]);f="isBuffer isEnabled isFramebuffer isProgram isRenderbuffer isShader isTexture".split(" ");
for(c=0;c<f.length;++c)k=f[c],p[k]=function(b){return function(){l();return I?!1:b.apply(a,arguments)}}(p[k]);p.checkFramebufferStatus=function(b){return function(){l();return I?p.FRAMEBUFFER_UNSUPPORTED:b.apply(a,arguments)}}(p.checkFramebufferStatus);p.getAttribLocation=function(b){return function(){l();return I?-1:b.apply(a,arguments)}}(p.getAttribLocation);p.getVertexAttribOffset=function(b){return function(){l();return I?0:b.apply(a,arguments)}}(p.getVertexAttribOffset);p.isContextLost=function(){return I};
return p}var r,p,z=[],A=[];p={};var J=1,I=!1,K=[],L=0,x=0,P=!1,U=0,N={};a.getContext=function(b){return function(){var c=b.apply(a,arguments);if(c instanceof WebGLRenderingContext){if(c!=r){if(r)throw"got different context";r=c;p=q(r)}return p}return c}}(a.getContext);(function(a){var b=a.addEventListener;a.addEventListener=function(f,l,h){switch(f){case "webglcontextlost":z.push(c(l));break;case "webglcontextrestored":A.push(c(l));break;default:b.apply(a,arguments)}}})(a);a.loseContext=function(){if(!I){I=
!0;L=0;for(++J;r.getError(););f();N[r.CONTEXT_LOST_WEBGL]=!0;var b=k("context lost"),c=z.slice();setTimeout(function(){for(var f=0;f<c.length;++f)c[f](b);0<=U&&setTimeout(function(){a.restoreContext()},U)},0)}};a.restoreContext=function(){I&&A.length&&setTimeout(function(){if(!P)throw"can not restore. webglcontestlost listener did not call event.preventDefault";for(var a=0;a<K.length;++a){var b=K[a];b instanceof WebGLBuffer?r.deleteBuffer(b):b instanceof WebGLFramebuffer?r.deleteFramebuffer(b):b instanceof
WebGLProgram?r.deleteProgram(b):b instanceof WebGLRenderbuffer?r.deleteRenderbuffer(b):b instanceof WebGLShader?r.deleteShader(b):b instanceof WebGLTexture&&r.deleteTexture(b)}t(r);I=!1;x=0;P=!1;for(var a=A.slice(),b=k("context restored"),c=0;c<a.length;++c)a[c](b)},0)};a.loseContextInNCalls=function(a){if(I)throw"You can not ask a lost contet to be lost";L=x+a};a.getNumCalls=function(){return x};a.setRestoreTimeout=function(a){U=a};return a},resetToInitialState:t}})},"esri/views/webgl/RenderingContext":function(){define(["require",
"exports","./enums","./Extensions"],function(x,r,k,a){return function(){function b(b,k){this.gl=null;this._extensions=void 0;this._blendEnabled=!1;this._blendColorState={r:0,g:0,b:0,a:0};this._blendFunctionState={srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0};this._blendEquationState={mode:32774,modeAlpha:32774};this._colorMaskState={r:!0,g:!0,b:!0,a:!0};this._polygonCullingEnabled=!1;this._cullFace=1029;this._frontFace=2305;this._scissorTestEnabled=!1;this._scissorRect={x:0,y:0,width:0,height:0};this._depthTestEnabled=
!1;this._depthFunction=513;this._clearDepth=1;this._depthWriteEnabled=!0;this._depthRange={zNear:0,zFar:1};this._viewport=null;this._polygonOffsetFillEnabled=this._stencilTestEnabled=!1;this._polygonOffset=[0,0];this._stencilFunction={face:1032,func:519,ref:0,mask:1};this._clearStencil=0;this._stencilWriteMask=1;this._stencilOperation={face:1032,fail:7680,zFail:7680,zPass:7680};this._lineWidth=1;this._clearColor={r:0,g:0,b:0,a:0};this._activeFramebuffer=this._activeIndexBuffer=this._activeVertexBuffer=
this._activeShaderProgram=null;this._activeTextureUnit=0;this._textureUnitMap={};this.gl=b;this._extensions=new a(b,k);k=b.getParameter(b.VIEWPORT);this._viewport={x:k[0],y:k[1],width:k[2],height:k[3]};k=this.extensions.textureFilterAnisotropic;this._parameters={versionString:b.getParameter(b.VERSION),maxVertexTextureImageUnits:b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:b.getParameter(b.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:k?b.getParameter(k.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
void 0,maxTextureImageUnits:b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS)};this.enforceState()}Object.defineProperty(b.prototype,"extensions",{get:function(){return this._extensions},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"contextAttributes",{get:function(){return this.gl.getContextAttributes()},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0});b.prototype.dispose=function(){this.bindVAO(null);
this.unbindBuffer(34962);this.unbindBuffer(34963);this._textureUnitMap={};this.gl=null};b.prototype.setBlendingEnabled=function(a){this._blendEnabled!==a&&(!0===a?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._blendEnabled=a)};b.prototype.setBlendColor=function(a,b,n,f){if(a!==this._blendColorState.r||b!==this._blendColorState.g||n!==this._blendColorState.b||f!==this._blendColorState.a)this.gl.blendColor(a,b,n,f),this._blendColorState.r=a,this._blendColorState.g=b,this._blendColorState.b=
n,this._blendColorState.a=f};b.prototype.setBlendFunction=function(a,b){if(a!==this._blendFunctionState.srcRGB||b!==this._blendFunctionState.dstRGB)this.gl.blendFunc(a,b),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=a,this._blendFunctionState.dstRGB=b,this._blendFunctionState.dstAlpha=b};b.prototype.setBlendFunctionSeparate=function(a,b,n,f){if(this._blendFunctionState.srcRGB!==a||this._blendFunctionState.srcAlpha!==n||this._blendFunctionState.dstRGB!==b||this._blendFunctionState.dstAlpha!==
f)this.gl.blendFuncSeparate(a,b,n,f),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=n,this._blendFunctionState.dstRGB=b,this._blendFunctionState.dstAlpha=f};b.prototype.setBlendEquation=function(a){this._blendEquationState.mode!==a&&(this.gl.blendEquation(a),this._blendEquationState.mode=a,this._blendEquationState.modeAlpha=a)};b.prototype.setBlendEquationSeparate=function(a,b){if(this._blendEquationState.mode!==a||this._blendEquationState.modeAlpha!==b)this.gl.blendEquationSeparate(a,
b),this._blendEquationState.mode=a,this._blendEquationState.modeAlpha=b};b.prototype.setColorMask=function(a,b,n,f){if(this._colorMaskState.r!==a||this._colorMaskState.g!==b||this._colorMaskState.b!==n||this._colorMaskState.a!==f)this.gl.colorMask(a,b,n,f),this._colorMaskState.r=a,this._colorMaskState.g=b,this._colorMaskState.b=n,this._colorMaskState.a=f};b.prototype.setClearColor=function(a,b,n,f){if(this._clearColor.r!==a||this._clearColor.g!==b||this._clearColor.b!==n||this._clearColor.a!==f)this.gl.clearColor(a,
b,n,f),this._clearColor.r=a,this._clearColor.g=b,this._clearColor.b=n,this._clearColor.a=f};b.prototype.setFaceCullingEnabled=function(a){this._polygonCullingEnabled!==a&&(!0===a?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._polygonCullingEnabled=a)};b.prototype.setPolygonOffsetFillEnabled=function(a){this._polygonOffsetFillEnabled!==a&&(!0===a?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._polygonOffsetFillEnabled=a)};b.prototype.setPolygonOffset=
function(a,b){if(this._polygonOffset[0]!==a||this._polygonOffset[1]!==b)this._polygonOffset[0]=a,this._polygonOffset[1]=b,this.gl.polygonOffset(a,b)};b.prototype.setCullFace=function(a){this._cullFace!==a&&(this.gl.cullFace(a),this._cullFace=a)};b.prototype.setFrontFace=function(a){this._frontFace!==a&&(this.gl.frontFace(a),this._frontFace=a)};b.prototype.setScissorTestEnabled=function(a){this._scissorTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),
this._scissorTestEnabled=a)};b.prototype.setScissorRect=function(a,b,n,f){if(this._scissorRect.x!==a||this._scissorRect.y!==b||this._scissorRect.width!==n||this._scissorRect.height!==f)this.gl.scissor(a,b,n,f),this._scissorRect.x=a,this._scissorRect.y=b,this._scissorRect.width=n,this._scissorRect.height=f};b.prototype.setDepthTestEnabled=function(a){this._depthTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTestEnabled=a)};b.prototype.setClearDepth=
function(a){this._clearDepth!==a&&(this.gl.clearDepth(a),this._clearDepth=a)};b.prototype.setDepthFunction=function(a){this._depthFunction!==a&&(this.gl.depthFunc(a),this._depthFunction=a)};b.prototype.setDepthWriteEnabled=function(a){this._depthWriteEnabled!==a&&(this.gl.depthMask(a),this._depthWriteEnabled=a)};b.prototype.setDepthRange=function(a,b){if(this._depthRange.zNear!==a||this._depthRange.zFar!==b)this.gl.depthRange(a,b),this._depthRange.zNear=a,this._depthRange.zFar=b};b.prototype.setStencilTestEnabled=
function(a){this._stencilTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTestEnabled=a)};b.prototype.setClearStencil=function(a){a!==this._clearStencil&&(this.gl.clearStencil(a),this._clearStencil=a)};b.prototype.setStencilFunction=function(a,b,n){if(this._stencilFunction.func!==a||this._stencilFunction.ref!==b||this._stencilFunction.mask!==n)this.gl.stencilFunc(a,b,n),this._stencilFunction.face=1032,this._stencilFunction.func=a,this._stencilFunction.ref=
b,this._stencilFunction.mask=n};b.prototype.setStencilFunctionSeparate=function(a,b,n,f){if(this._stencilFunction.face!==a||this._stencilFunction.func!==b||this._stencilFunction.ref!==n||this._stencilFunction.mask!==f)this.gl.stencilFuncSeparate(a,b,n,f),this._stencilFunction.face=a,this._stencilFunction.func=b,this._stencilFunction.ref=n,this._stencilFunction.mask=f};b.prototype.setStencilWriteMask=function(a){this._stencilWriteMask!==a&&(this.gl.stencilMask(a),this._stencilWriteMask=a)};b.prototype.setStencilOp=
function(a,b,n){if(this._stencilOperation.fail!==a||this._stencilOperation.zFail!==b||this._stencilOperation.zPass!==n)this.gl.stencilOp(a,b,n),this._stencilOperation.face=1032,this._stencilOperation.fail=a,this._stencilOperation.zFail=b,this._stencilOperation.zPass=n};b.prototype.setStencilOpSeparate=function(a,b,n,f){if(this._stencilOperation.face!==a||this._stencilOperation.fail!==b||this._stencilOperation.zFail!==n||this._stencilOperation.zPass!==f)this.gl.stencilOpSeparate(a,b,n,f),this._stencilOperation.face=
a,this._stencilOperation.face=a,this._stencilOperation.fail=b,this._stencilOperation.zFail=n,this._stencilOperation.zPass=f};b.prototype.setLineWidth=function(a){var b=this._lineWidth;this._lineWidth!==a&&(this.gl.lineWidth(a),this._lineWidth=a);return b};b.prototype.setActiveTexture=function(a){var b=this._activeTextureUnit;0<=a&&a!==this._activeTextureUnit&&(this.gl.activeTexture(k.BASE_TEXTURE_UNIT+a),this._activeTextureUnit=a);return b};b.prototype.clear=function(a){a&&this.gl.clear(a)};b.prototype.drawArrays=
function(a,b,n){this.gl.drawArrays(a,b,n)};b.prototype.drawElements=function(a,b,n,f){5123===n?this.gl.drawElements(a,b,n,f):5125===n&&this._extensions.elementIndexUint?this.gl.drawElements(a,b,n,f):console.warn("Data type is uint however extension OES_Element_index_unit is not supported therefore this draw call cannot be made")};b.prototype.drawArraysInstanced=function(a,b,n,f){this._extensions.angleInstancedArrays?this._extensions.angleInstancedArrays.drawArraysInstancedANGLE(a,b,n,f):console.error("Extension ANGLE_instanced_arrays isn't supported!")};
b.prototype.drawElementsInstanced=function(a,b,n,f,k){this._extensions.angleInstancedArrays?5125!==n||this._extensions.elementIndexUint?this._extensions.angleInstancedArrays.drawElementsInstancedANGLE(a,b,n,f,k):console.error("Extension OES_Element_index_unit is not supported!"):console.error("Extension ANGLE_instanced_arrays isn't supported!")};b.prototype.setViewport=function(a,b,n,f){var c=this._viewport;if(c.x!==a||c.y!==b||c.width!==n||c.height!==f)c.x=a,c.y=b,c.width=n,c.height=f,this.gl.viewport(a,
b,n,f)};b.prototype.getViewport=function(){return{x:this._viewport.x,y:this._viewport.y,width:this._viewport.width,height:this._viewport.height}};b.prototype.bindProgram=function(a){a?this._activeShaderProgram!==a&&(a.initialize(),this.gl.useProgram(a.glName),this._activeShaderProgram=a):(this.gl.useProgram(null),this._activeShaderProgram=null)};b.prototype.bindTexture=function(a,k){void 0===k&&(k=0);-1===b._MAX_TEXTURE_IMAGE_UNITS&&(b._MAX_TEXTURE_IMAGE_UNITS=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS));
(k>=b._MAX_TEXTURE_IMAGE_UNITS||0>k)&&console.error("Input texture unit is out of range of available units!");var c=this._textureUnitMap[k];this.setActiveTexture(k);null==a||null==a.glName?(null!=c&&(this.gl.bindTexture(c.descriptor.target,null),c.setBoundToUnit(k,!1)),this._textureUnitMap[k]=null):c&&c.id===a.id?a.applyChanges():(this.gl.bindTexture(a.descriptor.target,a.glName),a.setBoundToUnit(k,!0),a.applyChanges(),this._textureUnitMap[k]=a)};b.prototype.bindFramebuffer=function(a){a?this._activeFramebuffer!==
a&&(a.initialize()||this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a.glName),this._activeFramebuffer=a):(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this._activeFramebuffer=null)};b.prototype.bindBuffer=function(a){a&&(34962===a.bufferType?this._activeVertexBuffer=b._bindBuffer(this.gl,a,a.bufferType,this._activeVertexBuffer):this._activeIndexBuffer=b._bindBuffer(this.gl,a,a.bufferType,this._activeIndexBuffer))};b.prototype.unbindBuffer=function(a){34962===a?this._activeVertexBuffer=b._bindBuffer(this.gl,
null,a,this._activeVertexBuffer):this._activeIndexBuffer=b._bindBuffer(this.gl,null,a,this._activeIndexBuffer)};b.prototype.bindVAO=function(a){a?this._activeVertexArrayObject&&this._activeVertexArrayObject.id===a.id||(a.bind(),this._activeVertexArrayObject=a):this._activeVertexArrayObject&&(this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null)};b.prototype.getBoundTexture=function(a){return this._textureUnitMap[a]};b.prototype.getBoundFramebufferObject=function(){return this._activeFramebuffer};
b.prototype.getBoundVAO=function(){return this._activeVertexArrayObject};b.prototype.resetState=function(){this.bindProgram(null);this.bindVAO(null);this.bindFramebuffer(null);this.unbindBuffer(34962);this.unbindBuffer(34963);for(var a=0;a<this.parameters.maxTextureImageUnits;a++)this.bindTexture(null,a);this.setBlendingEnabled(!1);this.setBlendFunction(1,0);this.setBlendEquation(32774);this.setBlendColor(0,0,0,0);this.setFaceCullingEnabled(!1);this.setCullFace(1029);this.setFrontFace(2305);this.setPolygonOffsetFillEnabled(!1);
this.setPolygonOffset(0,0);this.setScissorTestEnabled(!1);this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height);this.setDepthTestEnabled(!1);this.setDepthFunction(513);this.setDepthRange(0,1);this.setStencilTestEnabled(!1);this.setStencilFunction(519,0,0);this.setStencilOp(7680,7680,7680);this.setClearColor(0,0,0,0);this.setClearDepth(1);this.setClearStencil(0);this.setColorMask(!0,!0,!0,!0);this.setStencilWriteMask(4294967295);this.setDepthWriteEnabled(!0);this.setViewport(0,0,this.gl.canvas.width,
this.gl.canvas.height)};b.prototype.enforceState=function(){var a=this.gl,b=this._extensions.vao;b&&b.bindVertexArrayOES(null);for(var n=0;n<this.parameters.maxVertexAttributes;n++)a.disableVertexAttribArray(n);this._activeVertexBuffer?a.bindBuffer(this._activeVertexBuffer.bufferType,this._activeVertexBuffer.glName):a.bindBuffer(34962,null);this._activeIndexBuffer?a.bindBuffer(this._activeIndexBuffer.bufferType,this._activeIndexBuffer.glName):a.bindBuffer(34963,null);if(b&&this._activeVertexArrayObject){if(b=
this._activeVertexArrayObject)this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null;this.bindVAO(b)}a.bindFramebuffer(a.FRAMEBUFFER,this._activeFramebuffer?this._activeFramebuffer.glName:null);a.useProgram(this._activeShaderProgram?this._activeShaderProgram.glName:null);a.blendColor(this._blendColorState.r,this._blendColorState.g,this._blendColorState.b,this._blendColorState.a);!0===this._blendEnabled?a.enable(this.gl.BLEND):a.disable(this.gl.BLEND);a.blendEquationSeparate(this._blendEquationState.mode,
this._blendEquationState.modeAlpha);a.blendFuncSeparate(this._blendFunctionState.srcRGB,this._blendFunctionState.dstRGB,this._blendFunctionState.srcAlpha,this._blendFunctionState.dstAlpha);a.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a);a.clearDepth(this._clearDepth);a.clearStencil(this._clearStencil);a.colorMask(this._colorMaskState.r,this._colorMaskState.g,this._colorMaskState.b,this._colorMaskState.a);a.cullFace(this._cullFace);a.depthFunc(this._depthFunction);
a.depthRange(this._depthRange.zNear,this._depthRange.zFar);!0===this._depthTestEnabled?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST);a.depthMask(this._depthWriteEnabled);a.frontFace(this._frontFace);a.lineWidth(this._lineWidth);!0===this._polygonCullingEnabled?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE);a.polygonOffset(this._polygonOffset[0],this._polygonOffset[1]);!0===this._polygonOffsetFillEnabled?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL);a.scissor(this._scissorRect.x,
this._scissorRect.y,this._scissorRect.width,this._scissorRect.height);!0===this._scissorTestEnabled?a.enable(a.SCISSOR_TEST):a.disable(a.SCISSOR_TEST);a.stencilFunc(this._stencilFunction.func,this._stencilFunction.ref,this._stencilFunction.mask);a.stencilOpSeparate(this._stencilOperation.face,this._stencilOperation.fail,this._stencilOperation.zFail,this._stencilOperation.zPass);!0===this._stencilTestEnabled?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST);a.stencilMask(this._stencilWriteMask);for(b=
0;b<this.parameters.maxTextureImageUnits;b++)a.activeTexture(k.BASE_TEXTURE_UNIT+b),a.bindTexture(3553,null),(n=this._textureUnitMap[b])&&a.bindTexture(n.descriptor.target,n.glName);a.activeTexture(k.BASE_TEXTURE_UNIT+this._activeTextureUnit);a.viewport(this._viewport.x,this._viewport.y,this._viewport.width,this._viewport.height)};b._bindBuffer=function(a,b,n,f){if(!b)return a.bindBuffer(n,null),null;if(f===b)return f;a.bindBuffer(n,b.glName);return b};b._MAX_TEXTURE_IMAGE_UNITS=-1;return b}()})},
"esri/views/webgl/Extensions":function(){define(["require","exports"],function(x,r){return function(){function k(a,b){this._colorBufferFloatInit=this._textureFloatLinearInit=this._textureFloatInit=this._disjointTimerQueryInit=this._compressedTextureS3TCInit=this._shaderTextureLODInit=this._textureFilterAnisotropicInit=this._depthTextureInit=this._elementIndexUintInit=this._standardDerivativesInit=this._angleInstancedArraysInit=this._vaoInit=!1;this._gl=a;b&&b.disabledExtensions&&(a=b.disabledExtensions,
a.vao&&(this._vao=null,this._vaoInit=!0),a.angleInstancedArrays&&(this._angleInstancedArrays=null,this._angleInstancedArraysInit=!0),a.standardDerivatives&&(this._standardDerivatives=null,this._standardDerivativesInit=!0),a.elementIndexUint&&(this._elementIndexUint=null,this._elementIndexUintInit=!0),a.depthTexture&&(this._depthTexture=null,this._depthTextureInit=!0),a.textureFilterAnisotropic&&(this._textureFilterAnisotropic=null,this._textureFilterAnisotropicInit=!0),a.compressedTextureS3TC&&(this._compressedTextureS3TC=
null,this._compressedTextureS3TCInit=!0),a.shaderTextureLOD&&(this._shaderTextureLOD=null,this._shaderTextureLODInit=!0),a.disjointTimerQuery&&(this._disjointTimerQuery=null,this._disjointTimerQueryInit=!0),a.textureFloat&&(this._textureFloat=null,this._textureFloatInit=!0),a.textureFloatLinear&&(this._textureFloatLinear=null,this._textureFloatLinearInit=!0),a.colorBufferFloat&&(this._colorBufferFloat=null,this._colorBufferFloatInit=!0))}Object.defineProperty(k.prototype,"vao",{get:function(){this._vaoInit||
(this._vao=this._gl.getExtension("OES_vertex_array_object")||this._gl.getExtension("MOZ_OES_vertex_array_object")||this._gl.getExtension("WEBKIT_OES_vertex_array_object"),this._vaoInit=!0);return this._vao},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"angleInstancedArrays",{get:function(){this._angleInstancedArraysInit||(this._angleInstancedArrays=this._gl.getExtension("ANGLE_instanced_arrays"),this._angleInstancedArraysInit=!0);return this._angleInstancedArrays},enumerable:!0,
configurable:!0});Object.defineProperty(k.prototype,"standardDerivatives",{get:function(){this._standardDerivativesInit||(this._standardDerivatives=this._gl.getExtension("OES_standard_derivatives"),this._standardDerivativesInit=!0);return this._standardDerivatives},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"elementIndexUint",{get:function(){this._elementIndexUintInit||(this._elementIndexUint=this._gl.getExtension("OES_element_index_uint"),this._elementIndexUintInit=!0);return this._elementIndexUint},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"depthTexture",{get:function(){this._depthTextureInit||(this._depthTexture=this._gl.getExtension("WEBGL_depth_texture")||this._gl.getExtension("MOZ_WEBGL_depth_texture")||this._gl.getExtension("WEBKIT_WEBGL_depth_texture"),this._depthTextureInit=!0);return this._depthTexture},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"textureFilterAnisotropic",{get:function(){this._textureFilterAnisotropicInit||(this._textureFilterAnisotropic=
this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this._textureFilterAnisotropicInit=!0);return this._textureFilterAnisotropic},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"shaderTextureLOD",{get:function(){this._shaderTextureLODInit||(this._shaderTextureLOD=this._gl.getExtension("EXT_shader_texture_lod"),this._shaderTextureLODInit=!0);return this._shaderTextureLOD},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"compressedTextureS3TC",{get:function(){this._compressedTextureS3TCInit||(this._compressedTextureS3TC=this._gl.getExtension("WEBGL_compressed_texture_s3tc"),this._compressedTextureS3TCInit=!0);return this._compressedTextureS3TC},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"disjointTimerQuery",{get:function(){this._disjointTimerQueryInit||(this._disjointTimerQuery=this._gl.getExtension("EXT_disjoint_timer_query"),
this._disjointTimerQueryInit=!0);return this._disjointTimerQuery},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"textureFloat",{get:function(){this._textureFloatInit||(this._textureFloat=this._gl.getExtension("OES_texture_float"),this._textureFloatInit=!0);return this._textureFloat},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"textureFloatLinear",{get:function(){this._textureFloatLinearInit||(this._textureFloatLinear=this._gl.getExtension("OES_texture_float_linear"),
this._textureFloatLinearInit=!0);return this._textureFloatLinear},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"colorBufferFloat",{get:function(){this._colorBufferFloatInit||(this._colorBufferFloat=this._gl.getExtension("EXT_color_buffer_float"),this._colorBufferFloatInit=!0);return this._colorBufferFloat},enumerable:!0,configurable:!0});return k}()})},"esri/views/3d/webgl-engine/lib/ProgramRepository":function(){define(["require","exports","./Util"],function(x,r,k){return function(){function a(){this.shaderVariators=
{};this._nextId=0;this._programsByName={};this._namesById=[];this._programRefCount=[];this._commonUniforms={model:[],modelNormal:[],lightDirection:[],proj:[],shadowMapDistance:[],viewportPixelSz:[],lightingMainDirection:[]}}a.prototype.dispose=function(){for(var a in this._programsByName)this._programsByName[a].dispose();this._programRefCount=this._namesById=this._programsByName=null};a.prototype.add=function(a,c){k.assert(null==this._programsByName[a]);this._programsByName[a]=c;this._namesById[c.id]=
a};a.prototype.get=function(a){return this._programsByName[a]};a.prototype.addShaderVariations=function(a,c){this.shaderVariators[a]=c};a.prototype.getShaderVariations=function(a){return this.shaderVariators[a]};a.prototype.getShaderVariationsProgram=function(a,c,k,n){return(a=this.getShaderVariations(a))&&a.getProgram(c,k,n)};a.prototype.getProgramsUsingUniform=function(a){return this._commonUniforms[a]||[]};a.prototype.increaseRefCount=function(a){var b=a.id;this._programRefCount[b]?this._programRefCount[b]++:
(this._programRefCount[b]=1,this._findCommonUniforms(a))};a.prototype.decreaseRefCount=function(a){var b=a.id;1<this._programRefCount[b]?this._programRefCount[b]--:(this._forgetCommonUniforms(a),this._programRefCount[b]=0)};a.prototype._getNextId=function(){return this._nextId++};a.prototype._findCommonUniforms=function(a){for(var b in this._commonUniforms)a.hasUniform(b)&&(k.assert(-1===this._commonUniforms[b].indexOf(a),"common uniforms of program have already been determined"),this._commonUniforms[b].push(a))};
a.prototype._forgetCommonUniforms=function(a){for(var b in this._commonUniforms){var k=this._commonUniforms[b],n=k.indexOf(a);-1<n&&(k[n]=k[k.length-1],k.pop())}};return a}()})},"esri/views/3d/support/CombinedElevationProvider":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ./Evented".split(" "),function(x,r,k,a,b,c,t){return function(c){function f(a){var b=c.call(this)||
this;b.providers={im:[],ground:[],scene:[]};b.handles=new Map;b.elevationChange=function(a){b.emit("elevation-change",a)};return b}k(f,c);f.prototype.getElevation=function(a,b){var c=-Infinity,f=!1;if("scene"===b)for(var l=0,n=this.providers.im;l<n.length;l++){var k=n[l],k=k.getElevation(a,b);null!=k&&(c=Math.max(k,c),!f&&isFinite(c)&&(f=!0))}if(!f)for(f=0,l=this.providers.ground;f<l.length;f++)k=l[f],k=k.getElevation(a,b),null!=k&&(c=Math.max(k,c));if("scene"===b)for(f=0,l=this.providers.scene;f<
l.length;f++)k=l[f],k=k.getElevation(a,b),null!=k&&(c=Math.max(k,c));return isFinite(c)?c:null};f.prototype.register=function(a,b){this.handles.set(b,b.on("elevation-change",this.elevationChange));this.providers[a].push(b)};f.prototype.unregister=function(a){this.handles.has(a)&&(this.handles.get(a).remove(),this.handles.delete(a));for(var b=0,c=Object.keys(this.providers);b<c.length;b++){var f=c[b],n=this.providers[f].indexOf(a);-1<n&&this.providers[f].splice(n,1)}};a([b.property({constructOnly:!0})],
f.prototype,"view",void 0);a([b.property({readOnly:!0,aliasOf:"view.basemapTerrain.spatialReference"})],f.prototype,"spatialReference",void 0);return f=a([b.subclass("esri.views.3d.support.CombinedElevationProvider")],f)}(b.declared(c,t.Evented))})},"esri/views/3d/support/HighlightOptions":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../Color".split(" "),
function(x,r,k,a,b,c,t){return function(c){function f(){var a=null!==c&&c.apply(this,arguments)||this;a.color=new t([0,255,255]);a.haloOpacity=1;a.fillOpacity=.25;return a}k(f,c);f.toEngineOptions=function(a){return{color:new Float32Array(t.toUnitRGBA(a.color)),haloOpacity:a.haloOpacity,haloOpacityOccluded:.25*a.haloOpacity,fillOpacity:a.fillOpacity,fillOpacityOccluded:.25*a.fillOpacity}};a([b.property({type:t})],f.prototype,"color",void 0);a([b.property()],f.prototype,"haloOpacity",void 0);a([b.property()],
f.prototype,"fillOpacity",void 0);return f=a([b.subclass()],f)}(b.declared(c))})},"esri/views/3d/support/RenderCoordsHelper":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../geometry/SpatialReference ../../../geometry/Point ../../../geometry/support/scaleUtils ../lib/glMatrix ./earthUtils ./projectionUtils ../webgl-engine/lib/BufferVectorMath ../webgl-engine/lib/Util".split(" "),function(x,r,k,a,b,c,t,n,f,q,l){Object.defineProperty(r,"__esModule",{value:!0});r.createRenderCoordsHelper=
function(a,b){return"global"===a?new y(b):new B(b)};x=function(){function c(a,b){this.spatialReference=a;this.unitInMeters=b}c.prototype.toRenderCoords=function(a,c,l){return a instanceof b?f.pointToVector(a,c,this.spatialReference):f.vectorToVector(a,c,l,this.spatialReference)};c.prototype.fromRenderCoords=function(c,l,n){return l instanceof b?f.vectorToPoint(c,this.spatialReference,l,n):l instanceof a?f.vectorToPoint(c,this.spatialReference,l):f.vectorToVector(c,this.spatialReference,l,n)};return c}();
r.RenderCoordsHelper=x;var y=function(a){function b(b){return a.call(this,b||f.SphericalECEFSpatialReference,1)||this}k(b,a);b.prototype.getAltitude=function(a,b){void 0===b&&(b=0);return q.Vec3Compact.length(a,b)-n.earthRadius};b.prototype.setAltitude=function(a,b){a=(a+n.earthRadius)/q.Vec3Compact.length(b,0);q.Vec3Compact.scale(b,0,a)};b.prototype.setAltitudeOfTransformation=function(a,b){a=(a+n.earthRadius)/q.Vec3Compact.length(b,12);q.Vec3Compact.scale(b,12,a)};b.prototype.worldUpAtPosition=
function(a,b){return t.vec3d.normalize(a||[0,0,0],b)};b.prototype.intersectManifold=function(a,b,c,f){void 0===f&&(f=t.vec3d.create());if(!l.raySphere(a,b,null,n.earthRadius+c,w)||0>t.vec3d.dot(t.vec3d.direction(w,a,D),b))return!1;t.vec3d.set(w,f);return!0};return b}(x),B=function(a){function b(b){b=a.call(this,b,c.getMetersPerUnitForSR(b))||this;b.worldUp=[0,0,1];return b}k(b,a);b.prototype.getAltitude=function(a,b){return b?a[b+2]:a[2]};b.prototype.setAltitude=function(a,b){b[2]=a};b.prototype.setAltitudeOfTransformation=
function(a,b){b[14]=a};b.prototype.worldUpAtPosition=function(a,b){return t.vec3d.set(this.worldUp,b)};b.prototype.intersectManifold=function(a,b,c,f){void 0===f&&(f=t.vec3d.create());t.vec4d.set4(this.worldUp[0],this.worldUp[1],this.worldUp[2],-c,v);if(!l.rayPlane(a,b,v,w)||0>t.vec3d.dot(t.vec3d.direction(w,a,D),b))return!1;t.vec3d.set(w,f);return!0};return b}(x),v=t.vec4d.create(),w=t.vec3d.create(),D=t.vec3d.create()})},"esri/views/3d/support/MapCoordsHelper":function(){define("dojo/Evented dojo/Deferred ../../../core/declare ../../../portal/support/geometryServiceUtils ../../../tasks/support/ProjectParameters ../../../geometry/SpatialReference ../../../geometry/Point ../../../geometry/support/scaleUtils".split(" "),
function(x,r,k,a,b,c,t,n){return k(x,{unitInMeters:1,spatialReference:null,constructor:function(b,c,l){this.spatialReference=c;this.unitInMeters=n.getMetersPerUnitForSR(this.spatialReference);(this.geometryService=l)||a.create(b&&b.portalItem).then(function(a){this.geometryService=a}.bind(this)).otherwise(function(){})},toGeographic:function(a){var f=new r,l=!0,n=this.spatialReference;if(!this.geometryService)return f.reject("Must specify geometryService in esri/config"),f;Array.isArray(a[0])&&"number"!==
typeof a[0]||(a=[a],l=!1);a.forEach(function(b,c){b instanceof t||(a[c]=new t(b,n))});var k=new b({geometries:a,outSR:c.WGS84});this.geometryService.project(k).then(function(a){try{a=a.map(function(a){return[a.x,a.y]}),f.resolve(l?a:a[0])}catch(w){f.reject(w)}},function(a){f.reject(a)});return f.promise},canProject:function(){return!!this.geometryService}})})},"esri/views/3d/support/ResourceController":function(){define("../../../core/declare ../../../core/Scheduler ../../../core/HandleRegistry ./StreamDataSupplier ./StreamDataLoader ./PreallocArray ../webgl-engine/lib/Util".split(" "),
function(x,r,k,a,b,c,t){function n(a){this.budget=this.begin=0;this.performance=a;this.enabled=!0}var f=t.assert,q={TERRAIN:"terrain",SCENE:"scene",SYMBOLOGY:"symbols"},l=new c(20);n.prototype.now=function(){return this.performance.now()};n.prototype.reset=function(a){this.begin=this.now();this.budget=this.enabled?a:Number.MAX_VALUE};n.prototype.done=function(){return this.enabled&&this.elapsed()>=this.budget};n.prototype.remaining=function(){return Math.max(this.budget-this.elapsed(),0)};n.prototype.elapsed=
function(){return this.now()-this.begin};x=x(null,{constructor:function(a,c,f){f=f||t.performance;this._clients=[];this._frameWorker=null;this._budget=new n(f);this._idleFrameWorkers=[];this._idleFrameWorkerRobin=0;this._idleUpdatesStartFired=!1;this._lastTargetChangeTime=f.now();this.navigationTimeout=300;this.animatingFrameTimeBudget=10;this.idleFrameWorkerBudget=30;this.idleFrameTimeBudget=50;f={};for(var l in q)f[q[l]]=0;f[q.TERRAIN]=15;f[q.SCENE]=20;f[q.SYMBOLOGY]=5;this._maxGpuMemory=500;this.streamDataLoader=
new b(f);this._cameraListeners=new k;this._cameraListeners.add([a.watch("state.camera",this._cameraChangedHandler.bind(this),!0)]);c||(c=r);this._frameTask=c.addFrameTask({update:this._frameUpdate.bind(this)});this._view=a;this.stats={frameUpdateTime:new y,idleUpdateTime:new y};this.frameUpdateNavigation=null},destroy:function(){this._frameTask.remove();this._frameTask=null;this._cameraListeners.remove();this.streamDataLoader.destroy();this.streamDataLoader=null},setEnableBudget:function(a){this._budget.enabled=
!!a},registerClient:function(b,c,f){this._clients.push({client:b,type:c});"function"===typeof b.setMaxGpuMemory&&b.setMaxGpuMemory(this._maxGpuMemory);return new a(c,this.streamDataLoader,f)},deregisterClient:function(a){for(var b=0;b<this._clients.length;b++)if(this._clients[b].client===a){this._clients[b]=this._clients[this._clients.length-1];this._clients.pop();return}console.warn("deregistering an unregistered client.")},setMaxGpuMemory:function(a){this._maxGpuMemory=a;for(var b=0;b<this._clients.length;b++){var c=
this._clients[b].client;"function"===typeof c.setMaxGpuMemory&&c.setMaxGpuMemory(a)}},registerIdleFrameWorker:function(a,b){var c=this._idleFrameWorkers.some(function(b){return b.client===a});f(!c,"Can only register idle frame workers once per client/layer");f(!b.idleFrame||b.needsUpdate,"needsUpdate has to be specified if idleFrame is specified");this._idleFrameWorkers.push({client:a,callbacks:b});this._isIdle()&&this._idleUpdatesStartFired&&b.idleBegin&&b.idleBegin.call(a)},deregisterIdleFrameWorker:function(a){for(var b=
this._idleFrameWorkers,c=0;c<b.length;c++){var f=b[c];if(f.client===a){this._idleUpdatesStartFired&&f.callbacks.idleEnd&&f.callbacks.idleEnd.call(a);b[c]=b[b.length-1];b.pop();break}}},registerFrameWorker:function(a){f(!this._frameWorker,"Only one (non-idle) per-frame worker supported at the moment");this._frameWorker=a},deregisterFrameWorker:function(){this._frameWorker=null},_cameraChangedHandler:function(){this._lastTargetChangeTime=this._budget.now();this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=
!1,this._callWorkersNoScheduling("idleEnd"))},_frameUpdate:function(a){var b=this._isIdle()?this.idleFrameWorkerBudget:this.animatingFrameTimeBudget;this._budget.reset(b-a.spendInFrame);this._view.stateManager&&this._view.stateManager.step(a.deltaTime/1E3);this._view.inputManager&&this._view.inputManager._pinchNavigation&&this._view.inputManager._pinchNavigation.momentum.doFrameUpdate(a.deltaTime);this._frameWorker&&(this._frameWorker(this._budget),this.stats.frameUpdateTime.addSample(this._budget.elapsed()));
this._isIdle()&&(this._idleUpdatesStartFired||(this._callWorkersNoScheduling("idleBegin"),this._idleUpdatesStartFired=!0),this._budget.reset(this.idleFrameTimeBudget-this._budget.elapsed()),3<this._budget.remaining()&&(this._callWorkersStrictScheduling("idleFrame",this._budget),this.stats.idleUpdateTime.addSample(this._budget.elapsed())))},_isIdle:function(){return this._budget.now()-this._lastTargetChangeTime>this.navigationTimeout},_callWorkersNoScheduling:function(a){for(var b=this._idleFrameWorkers,
c=0;c<b.length;c++){var f=b[c];f.callbacks[a]&&f.callbacks[a].call(f.client)}},_callWorkersStrictScheduling:function(a,b){var c=this._idleFrameWorkers,f=c.length,n,k,p;l.clear();k=0;for(p=this._idleFrameWorkerRobin;k<f;k++)n=c[p++%f],n.callbacks.needsUpdate&&n.callbacks.needsUpdate.call(n.client)&&(0===l.length&&(this._idleFrameWorkerRobin=p),l.push(n));n=b.now();for(c=n+b.remaining();0<l.length&&n<c;)b.reset((c-n)/l.length),n=l.pop(),n.callbacks[a].call(n.client,b),n=b.now()}});x.ClientType=q;var y=
function(){this.addSample=function(a){this.min=Math.min(this.min,a);this.max=Math.max(this.max,a);this.total+=a;this.numSamples++};this.getAverage=function(){return this.total/this.numSamples};this.reset=function(){this.numSamples=this.total=0;this.min=Number.MAX_VALUE;this.max=-Number.MAX_VALUE};this.reset()};return x})},"esri/views/3d/support/StreamDataSupplier":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c){this._clientType=a;this._loader=b;this._activeRequests=
null;c&&c.trackRequests&&(this._activeRequests=new Map)}k.prototype.request=function(a,b,c){var k=this;b=this._loader.request(a,b,this._clientType,c);this._activeRequests&&(this._activeRequests.set(a,b),c=function(){k._activeRequests.delete(a)},b.then(c,c));return b};k.prototype.isRequested=function(a){return this._loader.isRequested(a)};k.prototype.cancelRequest=function(a){this._loader.cancel(a)};k.prototype.cancelAll=function(){var a=this;this._activeRequests&&(this._activeRequests.forEach(function(b){a._loader.cancel(b)}),
this._activeRequests.clear())};k.prototype.hasPendingDownloads=function(){return this._loader.hasPendingDownloads()};return k}()})},"esri/views/3d/support/StreamDataLoader":function(){define("../../../core/declare ../../../request ../../../core/urlUtils ./PromiseLightweight ./AsyncQuotaRoundRobinQueue ../webgl-engine/lib/Util".split(" "),function(x,r,k,a,b,c){var t=c.assert,n={QUEUED:1,DOWNLOADING:2,CANCELLED:4};x=x(null,{constructor:function(a){this.alreadyLoading={};this.loadQueue=new b(q,this._doneLoadingCallback,
this,a);this._urlInfo={hasSameOrigin:{},canUseXhr:{}}},destroy:function(){for(var a in this.alreadyLoading){for(var b=this.alreadyLoading[a],c=0;c<b.clientPromises.length;c++){var f=b.clientPromises[c];f.isRejected()||f.reject(b.url,null,b.docType,b.clientMetadata[c])}this._cancelTask(b)}this.loadQueue.clear();this.alreadyLoading=this.loadQueue=null},request:function(b,c,f,k){k=k||{};var l=new a.Promise(function(){this.cancel(l)}.bind(this));l.requestURL=b;var q=this.alreadyLoading[b];q?(q.clientPromises.push(l),
q.clientMetadata.push(k.metadata)):(q={url:b,docType:c,clientType:f,status:n.QUEUED,clientMetadata:[k.metadata],clientPromises:[l],downloadObj:null,_cancelledInQueue:!1},this.alreadyLoading[b]=q,this.loadQueue.push(q));return l},isRequested:function(a){return void 0!==this.alreadyLoading[a]},cancel:function(a){var b=this.alreadyLoading[a.requestURL];b&&this._removeRequestPromiseFromTask(b,a)},hasPendingDownloads:function(){return!c.objectEmpty(this.alreadyLoading)},_removeRequestPromiseFromTask:function(a,
b){var c=a.clientPromises.length;1<c?(b=a.clientPromises.indexOf(b),t(-1<b,"request to be cancelled is already cancelled or invalid"),a.clientPromises[b]=a.clientPromises[c-1],a.clientPromises.pop(),a.clientMetadata[b]=a.clientMetadata[c-1],a.clientMetadata.pop()):(t(a.clientPromises[0]===b,"request to be cancelled is already cancelled or invalid"),this._cancelTask(a))},_cancelTask:function(a){if(a.status===n.DOWNLOADING){this.loadQueue.workerCancelled(a);if("image"===a.docType&&k.isDataProtocol(a.url)){var b=
a.downloadObj;b.removeAttribute("onload");b.removeAttribute("onerror");b.removeAttribute("src")}else a.status=n.CANCELLED,a.downloadObj.cancel();a.downloadObj=null}a.status=n.CANCELLED;a.clientPromises=void 0;a.clientMetadata=void 0;delete this.alreadyLoading[a.url]},_doneLoadingCallback:function(a,b){var c;t(a.status===n.DOWNLOADING);delete this.alreadyLoading[a.url];if(b)for(c=0;c<a.clientPromises.length;c++)a.clientPromises[c].isRejected()||a.clientPromises[c].reject(a.url,b,a.docType,a.clientMetadata[c]);
else for(c=0;c<a.clientPromises.length;c++)a.clientPromises[c].done(a.url,a.result,a.docType,a.clientMetadata[c])}});var f=function(a,b,c){a.onload=function(){b.status!==n.CANCELLED&&(b.result=a,a.removeAttribute("onload"),a.removeAttribute("onerror"),c(b))};a.onerror=function(){b.status!==n.CANCELLED&&(a.removeAttribute("onload"),a.removeAttribute("onerror"),c(b,{status:404}))}},q=function(a,b){if(a.status===n.CANCELLED)return!1;a.status=n.DOWNLOADING;if("image"===a.docType&&k.isDataProtocol(a.url)){var l=
new Image;f(l,a,b);l.src=a.url;a.downloadObj=l;return!0}var q;switch(a.docType){case "binary":q="array-buffer";l=0;break;case "image":q="image";break;default:q="json"}a.downloadObj=r(a.url,{responseType:q,timeout:l,allowImageDataAccess:"image"===a.docType});a.downloadObj.then(function(f){a.duration=c.performance.now()-a.startTime;a.size=0;a.result=f.data;b(a)},function(c){a.downloadObj.isCanceled()||b(a,c)});return!0};x.TaskStatus=n;return x})},"esri/views/3d/support/PromiseLightweight":function(){(function(x){function r(a){this._callbacks=
[];this._errbacks=[];this._cancelCallback=a;this._iserr=this._isdone=this._iscancelled=!1}function k(a,c){var b=new r;0===a.length?b.done.apply(b,c):a[0].apply(null,c).then(function(){a.splice(0,1);k(a,arguments).then(function(){b.done.apply(b,arguments)})});return b}r.prototype.cancel=function(a){this._callbacks=[];this._errbacks=[];this._iscancelled=!0;this._cancelCallback&&this._cancelCallback(a)};r.prototype.then=function(a,c,k){var b;if(!this._iscancelled)return this._isdone?b=a.apply(k,this.result):
this._iserr&&c?b=c.apply(k,this.result):(this._callbacks.push(function(){return a.apply(k,arguments)}),c&&this._errbacks.push(function(){return c.apply(k,arguments)})),b};r.prototype.done=function(){this.result=arguments;this._isdone=!0;for(var a=0;a<this._callbacks.length;a++)this._callbacks[a].apply(null,arguments);this._callbacks=[];this._errbacks=[]};r.prototype.resolve=r.prototype.done;r.prototype.reject=function(){if(!this._iscancelled){this.result=arguments;this._iserr=!0;for(var a=0;a<this._errbacks.length;a++)this._errbacks[a].apply(null,
arguments);this._callbacks=[];this._errbacks=[]}};r.prototype.isRejected=function(){return this._iserr};r.prototype.isFulfilled=function(){return this._isdone||this._iserr};r.prototype.isResolved=function(){return this._isdone};r.prototype.isCancelled=function(){return this._iscancelled};var a={Promise:r,join:function(a){function b(a,b){return function(){b&&(l=!0);f+=1;q[a]=Array.prototype.slice.call(arguments);f===n&&(l?k.reject():k.done(q))}}for(var k=new r,n=a.length,f=0,q=[],l=!1,y=0;y<n;y++)a[y].then(b(y,
!1),b(y,!0));0===a.length&&k.done();return k},chain:k};"function"===typeof define&&define.amd?define(function(){return a}):x.promise=a})(this)},"esri/views/3d/support/AsyncQuotaRoundRobinQueue":function(){define(["../../../core/arrayUtils","../webgl-engine/lib/Util"],function(x,r){return function(k,a,b,c,t){function n(){return"workers: "+y+", queues: "+l.map(function(a){return a.length})}var f=0,q={},l=[],y=[],B=[],v=[],w=0,D=0,F;for(F in c)l[f]=[],y[f]=0,v[f]={requests:0,size:0,duration:0,speed:0},
B[f]=c[F],q[F]=f++,D+=c[F];var G=l.length,f=0;this.setWorkerQuota=function(a){r.assert(x.equals(Object.keys(this.typeWorkerAllication),Object.keys(a)));this.typeWorkerAllication=a;D=0;for(var b in a)B[q[b]]=a[b],D+=a[b]};this.setWorkerFunc=function(a){k=a};this.push=function(a){var b=q[a.clientType];w<D?(y[b]++,w++,t&&console.log("queue start type "+b+", "+n()),k(a,A)):(l[b].push(a),t&&console.log("queue push type "+b+", "+n()))};this._getStatsForType=function(a){a=q[a];return{quota:B[a],workers:y[a],
queueSize:l[a].length,requestStats:v[a]}};this.removeTasks=function(a,b){for(var c=[],f=l[q[b]],p=0;p<f.length;p++){var n=f[p];-1<a.indexOf(n)||c.push(n)}l[q[b]]=c};this.workerCancelled=function(a){p(a);a._cancelledInQueue=!0};this.clear=function(){for(var a=0;a<l.length;a++)l[a]=[]};var p=function(a){var b=q[a.clientType];y[b]--;w--;v[b].requests++;v[b].size+=a.size||0;v[b].duration+=a.duration||0;v[b].speed=0<v[b].duration?v[b].size/v[b].duration:0;r.assert(0<=y[b]);a=f;b=!1;do y[a]<B[a]&&z(a)&&
(b=!0),a=(a+1)%G;while(!b&&a!=f);if(!b){do z(a)&&(b=!0),a=(a+1)%G;while(!b&&a!=f)}!b&&t&&console.log("queue sink, "+n());f=a},z=function(a){for(;0<l[a].length;){if(k(l[a].shift(),A))return t&&console.log("queue startqueued clientType "+a+", "+n()),y[a]++,w++,!0;t&&console.log("queue task cancelled, "+n())}return!1},A=function(c){c._cancelledInQueue||(a.apply(b,arguments),p(c))}}})},"esri/views/3d/support/PreallocArray":function(){define(["../../../core/declare","./HeapSort"],function(x,r){return x([],
{constructor:function(k,a){this.data=Array(k);this.length=0;if(a){for(var b=0;b<k;b++)this.data[b]=a(b);this._allocator=a;this._hasAllocator=!0}else this._allocator=this._nullAllocator,this._hasAllocator=!1},_nullAllocator:function(){return null},grow:function(k){for(;this.data.length<k;)this.data.push(this._allocator(this.data.length))},next:function(){if(!this._hasAllocator)return null;this.data.length===this.length&&this.grow(2*this.length);return this.data[this.length++]},swap:function(k,a){var b=
this.data[k];this.data[k]=this.data[a];this.data[a]=b},push:function(k){this.data.length===this.length&&this.grow(2*this.length);this.data[this.length++]=k},pushArray:function(k){var a=this.length+k.length;a>=this.data.length&&this.grow(Math.max(2*this.length,a));for(a=0;a<k.length;a++)this.data[this.length++]=k[a]},pushEither:function(k){Array.isArray(k)?this.pushArray(k):this.push(k)},pop:function(){if(0===this.length)return null;var k=this.data[--this.length];this._hasAllocator||(this.data[this.length]=
null);return k},slice:function(k,a){void 0===a&&(a=this.length);return this.data.slice(k,a)},clear:function(){if(!this._hasAllocator)for(var k=0;k<this.length;k++)this.data[k]=null;this.length=0},peek:function(){return 0===this.length?null:this.data[this.length-1]},sort:function(k){r.sort(this.data,0,this.length,k);return this}})})},"esri/views/3d/support/HeapSort":function(){define([],function(){function x(k,a,b,c){for(var t=a,n=b>>>1,f=k[t-1];a<=n;){a=t<<1;a<b&&0>c(k[a-1],k[a])&&++a;var q=k[a-1];
if(0>=c(q,f))break;k[t-1]=q;t=a}k[t-1]=f}function r(k,a){return k<a?-1:k>a?1:0}return{sort:function(k,a,b,c){void 0===a&&(a=0);void 0===b&&(b=k.length);void 0===c&&(c=r);for(var t=b>>>1;t>a;t--)x(k,t,b,c);for(var n=a+1,t=b-1;t>a;t--)b=k[a],k[a]=k[t],k[t]=b,x(k,n,t,c);return k}}})},"esri/views/3d/support/DisplayQualityProfile":function(){define(["require","exports","../../../core/sniff"],function(x,r,k){var a={low:{sceneService:{"3dObject":{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},
pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5},antialiasingEnabled:!1,gpuMemoryLimit:200},high:{sceneService:{"3dObject":{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1},antialiasingEnabled:!0,gpuMemoryLimit:500}};return function(){function b(){}b.isValidProfile=function(b){return b in a};b.getDefaultProfile=
function(){return k("trident")||k("safari")||k("esri-mobile")?"low":"high"};b.apply=function(b,k){b=a[b];k.qualitySettings.sceneService["3dObject"].lodFactor=b.sceneService["3dObject"].lodFactor;k.qualitySettings.sceneService.point.lodFactor=b.sceneService.point.lodFactor;k.qualitySettings.sceneService.integratedMesh.lodFactor=b.sceneService.integratedMesh.lodFactor;k.qualitySettings.sceneService.pointCloud.lodFactor=b.sceneService.pointCloud.lodFactor;k.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled=
b.sceneService.uncompressedTextureDownsamplingEnabled;k.qualitySettings.tiledSurface.lodBias=b.tiledSurface.lodBias;k.qualitySettings.tiledSurface.angledSplitBias=b.tiledSurface.angledSplitBias;k.qualitySettings.antialiasingEnabled=b.antialiasingEnabled;k.qualitySettings.gpuMemoryLimit=b.gpuMemoryLimit};return b}()})},"esri/views/3d/support/QualitySettings":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/typescript ../../../core/Accessor".split(" "),
function(x,r,k,a,b,c){var t=function(c){function f(){return null!==c&&c.apply(this,arguments)||this}k(f,c);a([b.property({value:1})],f.prototype,"lodFactor",void 0);return f=a([b.subclass()],f)}(c),n=function(c){function f(){return null!==c&&c.apply(this,arguments)||this}k(f,c);f.prototype.getDefaults=function(){return{"3dObject":new t,point:new t,integratedMesh:new t,pointCloud:new t,uncompressedTextureDownsamplingEnabled:!1}};a([b.property()],f.prototype,"3dObject",void 0);a([b.property()],f.prototype,
"point",void 0);a([b.property()],f.prototype,"integratedMesh",void 0);a([b.property()],f.prototype,"pointCloud",void 0);a([b.property()],f.prototype,"uncompressedTextureDownsamplingEnabled",void 0);return f=a([b.subclass()],f)}(c),f=function(c){function f(){return null!==c&&c.apply(this,arguments)||this}k(f,c);a([b.property({value:0})],f.prototype,"lodBias",void 0);a([b.property({value:1})],f.prototype,"angledSplitBias",void 0);return f=a([b.subclass()],f)}(c);return function(c){function l(){return null!==
c&&c.apply(this,arguments)||this}k(l,c);l.prototype.getDefaults=function(){return{sceneService:new n,tiledSurface:new f,antialiasingEnabled:!0}};a([b.property()],l.prototype,"sceneService",void 0);a([b.property()],l.prototype,"tiledSurface",void 0);a([b.property()],l.prototype,"antialiasingEnabled",void 0);a([b.property()],l.prototype,"gpuMemoryLimit",void 0);return l=a([b.subclass()],l)}(c)})},"esri/core/accessorSupport/typescript":function(){define(["../declare","../typescript","../JSONSupport",
"dojo/_base/lang"],function(x,r,k,a){function b(a,k){if(!a)return k;if(!k)return a;for(var c in k){var f=a[c],q=k[c];Array.isArray(q)&&Array.isArray(f)?a[c]=f.concat(q):a[c]="object"===typeof q&&"object"===typeof f?b(f,q):q}return a}return{subclass:function(c,t){return function(n){n=r.declareDefinition(n,c);f&&(n.instanceMembers.properties=b(f,n.instanceMembers.properties));var f=n.instanceMembers.properties;if(f)for(var q in f){var l=f[q];l&&!l.reader&&l.type&&(l.type===Date?l.reader=function(a){return null!=
a?new Date(a):null}:-1!==l.type._meta.bases.indexOf(k)&&(l.reader=function(a){return function(b){return a.fromJSON(b)}}(l.type)))}return a.mixin(x(n.bases,n.instanceMembers),n.classMembers)}},shared:r.shared,property:function(a){return function(b,c){var f=Object.getPrototypeOf(b),f=f&&f.properties;b.properties&&b.properties!==f||(b.properties={});b.properties=b.properties||{};b.properties[c]=a||{}}}}})},"esri/core/typescript":function(){define(["./declare","dojo/_base/lang"],function(x,r){var k={declareDefinition:function(a,
b){var c=[],k=Object.getPrototypeOf(a.prototype),n;if(k!==Object.prototype){var f=k.constructor;n=f.prototype;c.push(f)}b&&(c=c.concat(b));b={};for(var f=Object.getOwnPropertyNames(a.prototype),q=0;q<f.length;q++){var l=f[q];if("constructor"!==l){var r=l;"dojoConstructor"===l&&(r="constructor");n&&a.prototype[l]===n[l]||(b[r]=a.prototype[l])}}f=Object.getOwnPropertyNames(a);k=Object.getOwnPropertyNames(k.constructor);n={};for(q=0;q<f.length;q++)l=f[q],-1===k.indexOf(l)&&(n[l]=a[l]);return{bases:c,
instanceMembers:b,classMembers:n}},subclass:function(a){return function(b){b=k.declareDefinition(b,a);return r.mixin(x(b.bases,b.instanceMembers),b.classMembers)}},shared:function(a){return function(b,c){b[c]=a}}};return k})},"esri/views/3d/support/SharedSymbolResources":function(){define("require exports ./TextureCollection ./ResourceController ../../../core/watchUtils ../../../core/HandleRegistry ../webgl-engine/lib/screenSizePerspectiveUtils".split(" "),function(x,r,k,a,b,c,t){Object.defineProperty(r,
"__esModule",{value:!0});x=function(){function f(b){this.streamDataSupplier=this.textures=null;this.graphicsOwners=[];this.screenSizePerspectiveHandles=null;var c=a.ClientType.SYMBOLOGY;this.viewState=b.viewState;this.stage=b.stage;this.pointsOfInterest=b.pointsOfInterest;this.resourceController=b.resourceController;this.streamDataSupplier=this.resourceController.registerClient(this,c);this.textures=new k(this.streamDataSupplier,b.stage,{preMultiplyAlpha:!0,wrapClamp:!0});this.screenSizePerspectiveSettings=
t.getSettings(b.viewingMode);this.screenSizePerspectiveSettingsLabels=t.getLabelSettings(b.viewingMode)}f.prototype.destroy=function(){this.resourceController.deregisterClient(this);this.streamDataSupplier=this.textures=null};f.prototype.addGraphicsOwner=function(a){var c=this;this.graphicsOwners.push(a);var f=null;a.layerView&&(f=b.init(a.layerView,"layer.screenSizePerspectiveEnabled",function(){return c.updateScreenSizePerspectiveEnabled()}));return{remove:function(){f&&(f.remove(),f=null,c.updateScreenSizePerspectiveEnabled())}}};
f.prototype.updateScreenSizePerspectiveEnabled=function(){var a=this,b=this.graphicsOwners.some(function(a){return a.layerView&&!0===a.layerView.get("layer.screenSizePerspectiveEnabled")});b&&!this.screenSizePerspectiveHandles?(this.screenSizePerspectiveHandles=new c,b=function(){return a.updateScreenSizePerspectiveSettings()},this.screenSizePerspectiveHandles.add([this.pointsOfInterest.centerOnSurfaceInfrequent.watch("distance",b,!0),this.pointsOfInterest.events.on("camera-parameters-changed",b)]),
this.updateScreenSizePerspectiveSettings()):!b&&this.screenSizePerspectiveHandles&&(this.screenSizePerspectiveHandles.destroy(),this.screenSizePerspectiveHandles=null)};f.prototype.updateScreenSizePerspectiveSettings=function(){n.distance=this.pointsOfInterest.centerOnSurfaceInfrequent.distance;n.fovY=this.viewState.camera.fovY;this.screenSizePerspectiveSettings.update(n);this.screenSizePerspectiveSettingsLabels.update(n);this.stage.setNeedsRender()};return f}();r.SharedSymbolResources=x;var n={distance:0,
fovY:0};r.default=x})},"esri/views/3d/support/TextureCollection":function(){define("../../../core/declare ../../../core/urlUtils dojo/Deferred dojo/_base/lang ../webgl-engine/Stage ../webgl-engine/lib/Texture ../webgl-engine/lib/Util".split(" "),function(x,r,k,a,b,c,t){var n=t.assert;return x(null,{constructor:function(a,b,c){this._streamDataSupplier=a;this._stage=b;this._textureRecords={};this._loadedHandler=this._loadedHandler.bind(this);this._errorHandler=this._errorHandler.bind(this);this._textureOptions=
c||{}},acquire:function(a,c,l){var f;if(f=this._textureRecords[a])return f.referenceCount++,f.texture||f.clientDfd;if(c)return l=c(a),this._stage.add(b.ModelContentType.TEXTURE,l),f={texture:l,referenceCount:1},this._textureRecords[a]=f,l;f=new k;c=this._streamDataSupplier.request(a,"image");this._textureRecords[a]={clientDfd:f,loaderDfd:c,texture:null,size:Math.ceil(l||0),referenceCount:1};c.then(this._loadedHandler,this._errorHandler);return f.promise},release:function(a){var c=this._textureRecords[a];
c?(1>c.referenceCount&&console.warn("TextureCollection: reference count is \x3c 1 for "+a),c.referenceCount--,1>c.referenceCount&&(c.texture?(this._stage.remove(b.ModelContentType.TEXTURE,c.texture.getId()),c.texture=null):this._streamDataSupplier.cancelRequest(c.loaderDfd),delete this._textureRecords[a])):console.warn("TextureCollection: texture doesn't exist: "+a)},isInUse:function(a){a=this._textureRecords[a];n(!a||0<a.referenceCount,"texture record with zero reference count");return!!a},_loadedHandler:function(f,
k,l){l=this._textureRecords[f];n(l&&!l.texture);if(r.isSVG(f)&&(l.size||0===k.width&&0===k.height)){f=k.width?k.height/k.width:1;var q=l.size||64;1<f?(k.width=Math.round(q/f),k.height=q):(k.width=q,k.height=Math.round(q*f))}f=a.mixin({width:k.width,height:k.height},this._textureOptions);k=new c(k,"symbol",f);this._stage.add(b.ModelContentType.TEXTURE,k);l.texture=k;l.clientDfd.resolve(k)},_errorHandler:function(a){a=this._textureRecords[a];n(a&&!a.texture);a.clientDfd.reject()}})})},"esri/views/3d/support/pointsOfInterest/PointsOfInterest":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/accessorSupport/decorators ../../../../core/HandleRegistry ../../../../core/Accessor ../../../../geometry/Point ../../lib/glMatrix ../Evented ../PropertiesPool ./CenterOnSurface ./ContentGeometryUpdates ./disposeMembers ./SurfaceGeometryUpdates ./StableSurfaceCenter ../../webgl-engine/lib/Camera ../../webgl-engine/lib/Selector".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G){Object.defineProperty(r,"__esModule",{value:!0});x=function(t){function r(a){a=t.call(this,a)||this;a.handles=new c;a.lastSeenCameraParameters=new F;a.surfaceAltitudeAtCenter=0;a.surfaceAltitudeAtCenterDirty=!0;a.surfaceAltitudeAtCenterWithContent=0;a.surfaceAltitudeAtCenterWithContentDirty=!0;a.propertiesPool=new l.default({pointOfView:n,renderPointOfView:Array},a);a.updateSurfaceAltitudeFrequentInterval=A;a.updateSurfaceAltitudeInfrequentInterval=J;
a.events=new q.Evented;a.renderPointOfView=[0,0,0];return a}k(r,t);r.prototype.initialize=function(){var a=this,b=this.view.state,c=this.view.basemapTerrain,f=this.view.renderCoordsHelper;this.surfaceSelector=new G(b.mode);this.surfaceSelector.enableBackfacesTerrain=b.isGlobal?!1:!0;this.surfaceSelector.enableInvisibleTerrain=!1;this.contentSelector=new G(b.mode);this.contentSelector.enableTerrain=!1;var l=this.estimateSurfaceAltitudeAtCenter.bind(this);this._set("centerOnSurfaceInfrequent",new y.default({state:b,
surface:c,renderCoordsHelper:f,estimateSurfaceAltitudeAtCenter:l,altitudeEstimationInterval:this.updateSurfaceAltitudeInfrequentInterval}));this._set("centerOnSurfaceFrequent",new y.default({state:b,surface:c,renderCoordsHelper:f,estimateSurfaceAltitudeAtCenter:l,altitudeEstimationInterval:this.updateSurfaceAltitudeFrequentInterval}));this._set("centerOnContent",new y.default({state:b,surface:c,renderCoordsHelper:f,estimateSurfaceAltitudeAtCenter:this.estimateSurfaceAltitudeAtCenterWithContent.bind(this),
altitudeEstimationInterval:this.updateSurfaceAltitudeFrequentInterval}));this._set("surfaceGeometryUpdates",new w.default({state:b,surface:c,renderCoordsHelper:f,centerOnSurfaceInstances:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]}));this._set("contentGeometryUpdates",new B.default({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:f}));this._set("surfaceOrigin",new D.default({view:this.view}));this.handles.add(b.watch("camera",function(b){return a.cameraChanged(b)},
!0));this.handles.add(this.surfaceGeometryUpdates.events.on("request-update",function(){return a.updateCenterPointsOfInterest()}));this.handles.add(c.watch("extent",function(){return a.updateCenterPointsOfInterest()}));this.handles.add(this.contentGeometryUpdates.events.on("request-update",function(){return a.updateCenterOnContent()}));this.cameraChanged(this.view.state.camera);this.forceUpdate()};r.prototype.destroy=function(){v.default(this,"handles","centerOnSurfaceInfrequent","centerOnSurfaceFrequent",
"centerOnContent","surfaceOrigin","propertiesPool")};Object.defineProperty(r.prototype,"pointOfView",{get:function(){var a=this.propertiesPool.get("pointOfView");this.view.renderCoordsHelper.fromRenderCoords(this.renderPointOfView,a,this.view.state.spatialReference);return a},enumerable:!0,configurable:!0});r.prototype.forceUpdate=function(){this.surfaceGeometryUpdates.forceUpdate();this.centerOnSurfaceInfrequent.forceUpdate();this.centerOnSurfaceFrequent.forceUpdate();this.centerOnContent.forceUpdate()};
r.prototype.hasPendingUpdates=function(){return this.surfaceGeometryUpdates.hasPendingUpdates()||this.centerOnContent.hasPendingUpdates()||this.centerOnSurfaceInfrequent.hasPendingUpdates()||this.centerOnSurfaceFrequent.hasPendingUpdates()};r.prototype.estimateSurfaceAltitudeAtCenterWithContent=function(){if(!this.surfaceAltitudeAtCenterWithContentDirty)return this.surfaceAltitudeAtCenterWithContent;this.surfaceAltitudeAtCenterWithContentDirty=!1;var a=this.view.state.camera;this.view._stage.pickRay(a.eye,
a.center,null,null,null,!1,this.contentSelector);this.contentSelector.minResult.getIntersectionPoint(z)?this.surfaceAltitudeAtCenterWithContent=this.view.renderCoordsHelper.getAltitude(z):this.surfaceAltitudeAtCenterWithContent=this.estimateSurfaceAltitudeAtCenter();return this.surfaceAltitudeAtCenterWithContent};r.prototype.estimateSurfaceAltitudeAtCenter=function(){if(!this.view.basemapTerrain)return 0;if(!this.surfaceAltitudeAtCenterDirty)return this.surfaceAltitudeAtCenter;this.surfaceAltitudeAtCenterDirty=
!1;var a=this.view.state.camera;this.surfaceSelector.init(null,a.eye,a.center,null,a,null,!1);this.view.basemapTerrain.intersect(this.surfaceSelector,a.eye,a.center);this.surfaceSelector.minResult.getIntersectionPoint(z)&&(this.surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(z));return this.surfaceAltitudeAtCenter};r.prototype.cameraChanged=function(a){this.updateCenterPointsOfInterest(a);this.cameraParametersChanged(this.lastSeenCameraParameters,a)&&(this.lastSeenCameraParameters.copyFrom(a),
p.camera=a,this.events.emit("camera-parameters-changed",p));a=a.eye;this.renderPointOfView[0]===a[0]&&this.renderPointOfView[1]===a[1]&&this.renderPointOfView[2]===a[2]||this._set("renderPointOfView",f.vec3d.set(a,this.propertiesPool.get("renderPointOfView")))};r.prototype.updateCenterPointsOfInterest=function(a){void 0===a&&(a=this.view.state.camera);this.surfaceAltitudeAtCenterWithContentDirty=this.surfaceAltitudeAtCenterDirty=!0;this.centerOnSurfaceFrequent.update(a);this.centerOnSurfaceInfrequent.update(a);
this.centerOnContent.update(a)};r.prototype.updateCenterOnContent=function(){this.surfaceAltitudeAtCenterWithContentDirty=!0;this.centerOnContent.update(this.view.state.camera)};r.prototype.cameraParametersChanged=function(a,b){return a.fov!==b.fov||a.fullViewport[0]!==b.fullViewport[0]||a.fullViewport[1]!==b.fullViewport[1]||a.fullViewport[2]!==b.fullViewport[2]||a.fullViewport[3]!==b.fullViewport[3]||a.padding[0]!==b.padding[0]||a.padding[1]!==b.padding[1]||a.padding[2]!==b.padding[2]||a.padding[3]!==
b.padding[3]?!0:!1};a([b.property({constructOnly:!0})],r.prototype,"updateSurfaceAltitudeFrequentInterval",void 0);a([b.property({constructOnly:!0})],r.prototype,"updateSurfaceAltitudeInfrequentInterval",void 0);a([b.property({readOnly:!0})],r.prototype,"centerOnContent",void 0);a([b.property({readOnly:!0})],r.prototype,"centerOnSurfaceFrequent",void 0);a([b.property({readOnly:!0})],r.prototype,"centerOnSurfaceInfrequent",void 0);a([b.property({readOnly:!0})],r.prototype,"surfaceOrigin",void 0);a([b.property({readOnly:!0})],
r.prototype,"contentGeometryUpdates",void 0);a([b.property({readOnly:!0})],r.prototype,"events",void 0);a([b.property({readOnly:!0,dependsOn:["renderPointOfView"]})],r.prototype,"pointOfView",null);a([b.property({readOnly:!0})],r.prototype,"renderPointOfView",void 0);a([b.property({readOnly:!0})],r.prototype,"surfaceGeometryUpdates",void 0);a([b.property({constructOnly:!0})],r.prototype,"view",void 0);return r=a([b.subclass("esri.views.3d.support.PointsOfInterest")],r)}(b.declared(t));r.PointsOfInterest=
x;var p={camera:null},z=f.vec3d.create(),A=200,J=3E3;r.default=x})},"esri/views/3d/support/pointsOfInterest/CenterOnSurface":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/accessorSupport/decorators ../../../../core/throttle ../../../../geometry/Point ../../lib/glMatrix ../earthUtils ../PropertiesPool ../mathUtils ../debugFlags ./PointOfInterest".split(" "),function(x,r,k,a,b,c,t,n,f,q,l,y,B){Object.defineProperty(r,
"__esModule",{value:!0});x=function(r){function B(a){a=r.call(this,a)||this;a.propertiesPool=new q.default({location:t,renderLocation:Array},a);a.currentSurfaceAltitude=0;a.latestSurfaceAltitude=0;a.distance=0;a.renderLocation=[0,0,0];return a}k(B,r);D=B;B.prototype.initialize=function(){this.measureSurfaceAltitudeThrottle=c.throttle(this.measureSurfaceAltitude,this.altitudeEstimationInterval,this);this.handles.add(this.measureSurfaceAltitudeThrottle);this.measureSurfaceAltitude()};Object.defineProperty(B.prototype,
"location",{get:function(){var a=this.propertiesPool.get("location");this.renderCoordsHelper.fromRenderCoords(this.renderLocation,a,this.state.spatialReference);return a},enumerable:!0,configurable:!0});B.prototype.update=function(a){this.measureSurfaceAltitudeThrottle();this.updateCenterOnSurface()};B.prototype.forceUpdate=function(){this.measureSurfaceAltitudeThrottle.forceUpdate();this.updateCenterOnSurface()};B.prototype.hasPendingUpdates=function(){return this.measureSurfaceAltitudeThrottle.hasPendingUpdates()};
Object.defineProperty(B.prototype,"estimatedSurfaceAltitude",{get:function(){return this.latestSurfaceAltitude},enumerable:!0,configurable:!0});B.prototype.measureSurfaceAltitude=function(){this.latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter();this.updateCenterOnSurface()};B.prototype.updateCenterOnSurface=function(){var a=v,b=this.calculateSurfaceIntersection(this.currentSurfaceAltitude,a),c=this.currentSurfaceAltitude!==this.latestSurfaceAltitude;!b&&c&&(b=this.calculateSurfaceIntersection(this.latestSurfaceAltitude,
a))&&(this.currentSurfaceAltitude=this.latestSurfaceAltitude);c=w;b&&this.latestSurfaceAltitudeChangesDistanceSignificantly(a,c)&&(n.vec3d.set(c,a),this.currentSurfaceAltitude=this.latestSurfaceAltitude);b?(b=n.vec3d.dist(this.state.camera.eye,a),b!==this._get("distance")&&this._set("distance",b)):(b=this.state.camera,n.vec3d.add(n.vec3d.scale(b.viewForward,this._get("distance"),a),b.eye));b=this._get("renderLocation");b[0]===a[0]&&b[1]===a[1]&&b[2]===a[2]||this._set("renderLocation",n.vec3d.set(a,
this.propertiesPool.get("renderLocation")))};B.prototype.calculateSurfaceIntersection=function(a,b){var c=this.state.camera;if(!this.renderCoordsHelper.intersectManifold(c.eye,c.viewForward,a,b))return!1;if(this.state.isGlobal){a=f.earthRadius+a;var p=n.vec3d.length2(c.eye),k=p<a*a,q=n.vec3d.dist(c.eye,b);k&&q>f.earthRadius/4&&n.vec3d.add(n.vec3d.scale(c.viewForward,a-Math.sqrt(p),b),c.eye)}else if(c=this.surface.ready&&this.surface.extent)b[0]=l.clamp(b[0],c[0],c[2]),b[1]=l.clamp(b[1],c[1],c[3]);
return!0};B.prototype.latestSurfaceAltitudeChangesDistanceSignificantly=function(a,b){if(this.latestSurfaceAltitude===this.currentSurfaceAltitude||null==a)return!1;if(this.calculateSurfaceIntersection(this.latestSurfaceAltitude,b)){var c=this.state.camera.eye;a=n.vec3d.dist(c,a);b=n.vec3d.dist(c,b);if(y.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS||Math.abs(b-a)/a>D.RELATIVE_ALTITUDE_CHANGE_THRESHOLD)return!0}return!1};B.RELATIVE_ALTITUDE_CHANGE_THRESHOLD=.05;a([b.property({constructOnly:!0})],B.prototype,
"altitudeEstimationInterval",void 0);a([b.property({readOnly:!0})],B.prototype,"distance",void 0);a([b.property({constructOnly:!0})],B.prototype,"estimateSurfaceAltitudeAtCenter",void 0);a([b.property({readOnly:!0,dependsOn:["renderLocation"]})],B.prototype,"location",null);a([b.property({readOnly:!0})],B.prototype,"renderLocation",void 0);return B=D=a([b.subclass("esri.views.3d.support.CenterOnSurface")],B);var D}(b.declared(B.PointOfInterest));r.CenterOnSurface=x;var v=n.vec3d.create(),w=n.vec3d.create();
r.default=x})},"esri/core/throttle":function(){define(["require","exports"],function(x,r){function k(a,b,c,k){var n=null,f=1E3;"number"===typeof b?(f=b,k=c):(n=b,f=c);var q=0,l,t=function(){q=0;a.apply(k,l)};b=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];n&&n.apply(k,a);l=a;f?q||(q=setTimeout(t,f)):t()};b.remove=function(){q&&(clearTimeout(q),q=0)};b.forceUpdate=function(){q&&(clearTimeout(q),t())};b.hasPendingUpdates=function(){return!!q};return b}Object.defineProperty(r,
"__esModule",{value:!0});r.throttle=k;r.default=k})},"esri/views/3d/support/pointsOfInterest/PointOfInterest":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/accessorSupport/decorators ../../../../core/HandleRegistry ../../../../core/Accessor ./disposeMembers".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(f){function q(a){a=f.call(this)||this;a.handles=new c;
return a}k(q,f);q.prototype.destroy=function(){n.default(this,"handles")};a([b.property({constructOnly:!0})],q.prototype,"renderCoordsHelper",void 0);a([b.property({constructOnly:!0})],q.prototype,"surface",void 0);a([b.property({constructOnly:!0})],q.prototype,"state",void 0);return q=a([b.subclass("esri.views.3d.support.PointOfInterest")],q)}(b.declared(t));r.PointOfInterest=x;r.default=x})},"esri/views/3d/support/pointsOfInterest/disposeMembers":function(){define(["require","exports","../../../../core/Accessor"],
function(x,r,k){function a(a){for(var b=[],t=1;t<arguments.length;t++)b[t-1]=arguments[t];if(a instanceof k&&a.destroyed)try{throw Error("instance is already destroyed");}catch(q){console.warn(q.stack)}else for(t=0;t<b.length;t++){var n=b[t];if(!(n in a))throw Error("Property '"+n+"' does not exist and cannot be disposed");var f=a[n];f&&("function"===typeof f.destroy?f.destroy():"function"===typeof f.dispose?f.dispose():"function"===typeof f.remove&&f.remove());a instanceof k&&n in a.__accessor__.metadatas?
a._set(n,null):a[n]=null}}Object.defineProperty(r,"__esModule",{value:!0});r.disposeMembers=a;r.default=a})},"esri/views/3d/support/pointsOfInterest/ContentGeometryUpdates":function(){define(["require","exports","../../../../core/HandleRegistry","../Evented"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function c(b){this.handles=new k;this.events=new a.Evented;this.contentLayerViews=b.contentLayerViews;this.handles.add(this.contentLayerViews.on("change",this.layerViewsChanged.bind(this)));
this.layerViewsChanged({added:this.contentLayerViews.toArray(),removed:[],moved:[],target:this.contentLayerViews})}c.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};c.prototype.layerViewsChanged=function(a){var b=this;a.added.forEach(function(a){"esri.views.3d.layers.SceneLayerView3D"===a.declaredClass&&b.handles.add(a.on("visible-geometry-changed",b.contentChanged.bind(b)),a.uid)});a.removed.forEach(function(a){return b.handles.remove(a.uid)})};c.prototype.contentChanged=
function(){this.events.emit("request-update",b)};return c}();r.ContentGeometryUpdates=x;var b={};r.default=x})},"esri/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates":function(){define("require exports ../../../../core/HandleRegistry ../../../../core/Scheduler ../../lib/glMatrix ../Evented ../aaBoundingRect ../debugFlags".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function b(a){var b=this;this.handles=new k;this.tileGeometryUpdateExtent=
t.create(t.NEGATIVE_INFINITY);this.tileGeometryUpdateSpatialReference=null;this.hasPendingTileGeometryChanges=!0;this.events=new c.Evented;this.centerOnSurfaceInstances=a.centerOnSurfaceInstances;this.renderCoordsHelper=a.renderCoordsHelper;this.state=a.state;this.handles.add(a.surface.on("elevation-change",function(a){return b.tileGeometryChangeHandler(a)}))}b.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};b.prototype.forceUpdate=function(){this.handles.has("tile-geometry-update")&&
this.updateCenterOnGeometryUpdate();this.hasPendingTileGeometryChanges&&(this.events.emit("request-update",f),this.hasPendingTileGeometryChanges=!1)};b.prototype.hasPendingUpdates=function(){return this.handles.has("tile-geometry-update")};b.prototype.tileGeometryChangeHandler=function(b){var c=this;this.tileGeometryUpdateSpatialReference=b.spatialReference;t.expand(this.tileGeometryUpdateExtent,b.tile.extent);this.handles.has("tile-geometry-update")||this.handles.add(a.schedule(function(){return c.updateCenterOnGeometryUpdate()}),
"tile-geometry-update")};b.prototype.updateCenterOnGeometryUpdate=function(){this.handles.remove("tile-geometry-update");this.centerIntersectsExtent(this.tileGeometryUpdateExtent,this.tileGeometryUpdateSpatialReference)&&(n.DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES?this.hasPendingTileGeometryChanges=!0:this.events.emit("request-update",f));t.set(this.tileGeometryUpdateExtent,t.NEGATIVE_INFINITY)};b.prototype.furthestCenterOnSurface=function(){for(var a=this.centerOnSurfaceInstances[0],b=1;b<
this.centerOnSurfaceInstances.length;b++){var c=this.centerOnSurfaceInstances[b];c.distance>a.distance&&(a=c)}return a};b.prototype.centerIntersectsExtent=function(a,b){var c=this.state.camera.eye,f=y,n=this.furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(c,q,b);this.renderCoordsHelper.fromRenderCoords(n.renderLocation,l,b);q[0]<l[0]?(f[0]=q[0],f[2]=l[0]):(f[0]=l[0],f[2]=q[0]);q[1]<l[1]?(f[1]=q[1],f[3]=l[1]):(f[1]=l[1],f[3]=q[1]);return t.intersects(f,a)};return b}();r.SurfaceGeometryUpdates=
x;var f={},q=b.vec3d.create(),l=b.vec3d.create(),y=t.create(t.NEGATIVE_INFINITY);r.default=x})},"esri/views/3d/support/pointsOfInterest/StableSurfaceCenter":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/HandleRegistry ../../../../core/watchUtils ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../aaBoundingRect".split(" "),function(x,r,k,a,b,c,t,n,f,q){Object.defineProperty(r,
"__esModule",{value:!0});x=function(b){function l(a){a=b.call(this,a)||this;a.location=null;a._updatePromise=null;a._handles=new c;return a}k(l,b);Object.defineProperty(l.prototype,"renderLocation",{get:function(){if(!this.location)return null;var a=[0,0,0];this.view.renderCoordsHelper.toRenderCoords(this.location,a);return a},enumerable:!0,configurable:!0});l.prototype.initialize=function(){var a=this;this.view.state.isLocal&&(this._handles.add([this.watch("surfaceView.extent",function(){return a._update()}),
t.on(this,"surface.layers","change",function(){return a._update()})]),this._update())};l.prototype.destroy=function(){this._handles.destroy()};l.prototype._update=function(){var a=this;this._updatePromise&&(this._updatePromise.cancel("cancel"),this._updatePromise=null);if(this.surfaceView&&this.surfaceView.extent){var b=q.center(this.surfaceView.extent),b=new f({x:b[0],y:b[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&0<this.surface.layers.length?(this._set("location",
null),this._updatePromise=this.surface.queryElevation(b,{noDataValue:0}).then(function(b){a._updatePromise=null;a._set("location",b.geometry)}).otherwise(function(a){"cancel"!==a&&console.error("StableSurfaceCenter failed to update: ",a)})):this._set("location",b)}else this._set("location",null)};a([n.property({constructOnly:!0})],l.prototype,"view",void 0);a([n.property({readOnly:!0,aliasOf:"view.map.ground"})],l.prototype,"surface",void 0);a([n.property({readOnly:!0,aliasOf:"view.basemapTerrain"})],
l.prototype,"surfaceView",void 0);a([n.property({readOnly:!0})],l.prototype,"location",void 0);a([n.property({readOnly:!0,dependsOn:["location"]})],l.prototype,"renderLocation",null);return l=a([n.subclass("esri.views.3d.terrain.StableSurfaceCenter")],l)}(n.declared(b));r.StableSurfaceCenter=x;r.default=x})},"esri/views/3d/terrain/TerrainSurface":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/arrayUtils ../../../core/CollectionFlattener ../../../core/ObjectPool ../../../core/Logger ../../../core/watchUtils ../../../core/HandleRegistry ../../../geometry/Point ../lib/glMatrix ../support/aaBoundingRect ../support/Evented ../support/mathUtils ../support/PreallocArray ../support/projectionUtils ../support/PromiseLightweight ../support/ResourceController ./OverlayManager ./PlanarTile ./SphericalTile ./SurfaceExtentHelper ./SurfaceTilingSchemeLogic ./TerrainConst ./TerrainRenderer ./terrainUtils ./TileGeometryFactory ./TilemapOnlyTile ./tileUtils ./tileUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S,T,V){function h(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]}function ca(a){return a&&("cancel"===a||"cancel"===a.dojoType)}function Q(a,b){var d=!1;b=b||a;var e=0;for(a=a.children;e<a.length;e++){var c=a[e];if(c){for(var g in c.layerInfo)for(var f in c.layerInfo[g]){var h=c.layerInfo[g][f].upsampleFromTile;if(h&&h.tile===b)return!0}d=d||Q(c,b)}}return d}var e=v.vec3d,d=v.vec4d,g=v.mat4d,m=N.weakAssert,u=q.getLogger("esri.views.3d.terrain.TerrainSurface");
x=function(c){function q(){var a=c.call(this)||this;a.defaultTileBackground=P.DEFAULT_TILE_BACKGROUND;a.hideSkirtsDistanceFromExtentMargin=C;a.hideSkirtsMinimumCameraTilt=M;a._clippingExtent=null;a._dataExtent=null;a._elevationBounds=[0,0];a._rootExtent=[0,0,0,0];a._iteratorPool=new f(V.IteratorPreorder);a._postorderIterator=new V.IteratorPostorder;a.visible=!1;a.suspended=!1;a._pendingUpdates=!1;a._lvPendingUpdates=!1;a._updateNextFrame=0;a._vectorTileLayerRequests=0;a._curOverlayOpacity=1;a._curEyePos=
e.create();a._curSplitLimits=[0,0,0,0,0,0];a._curFrustumPlanes=Array(6);a._viewProjectionMatrix=g.identity();a.tilemapStats={tilemapRequestsSent:0,tilemapRequestsPending:0,tilemapRequestErrors:0,fullTilemaps:0,emptyTilemaps:0,tilesRequested:0,tileRequestsSent:0,tileRequestErrors:0,tilesNotPresent:0};a._layerViews=[[],[]];a._layerIndexByLayerViewId=[{},{}];a._basemapLayerViewHandles={};a._handles=new y;a._frameUpdateLowerPrio=new G(500);a._topLevelTilemapOnlyTiles=Array(P.TILEMAP_SIZE_EXP+1);a.loaded=
!1;a.maxTextureScale=1.2;a.rootTiles=null;for(var b=0;b<a._topLevelTilemapOnlyTiles.length;b++)a._topLevelTilemapOnlyTiles[b]=new S([b-P.TILEMAP_SIZE_EXP,0,0]);for(b=0;6>b;b++)a._curFrustumPlanes[b]=d.create();return a}k(q,c);q.prototype.normalizeCtorArgs=function(a,b){this._view=a;this._stage=a._stage;this._set("manifold",b);return{}};q.prototype.initialize=function(){var a=this;this.tilePool="planar"===this.manifold?I.Pool:K.Pool;this._renderer=new U(this.manifold,null,this._view.pointsOfInterest);
this._renderer.loaded=this._setLoaded.bind(this);this._renderer.updateTileBackground(this.tileBackground);this._renderer.install(this._view._stage);this._set("overlayManager",new J({terrainSurface:this,view:this._view}));this._handles.add(this.watch("overlayManager.hasHighlights",this._handleHasHighlights.bind(this)),"overlayManager");var b={layers:this._view.map.allLayers,layerViews:this._view.allLayerViews,spatialReference:this._view.spatialReference};this.extentHelper="spherical"===this.manifold?
new L.SurfaceExtentHelperGlobal(b):new L.SurfaceExtentHelperLocal(b);this._handles.add(l.init(this.extentHelper,"stencilEnabledExtents",function(b){a._renderer.setStencilEnabledLayerExtents(b)}),"extentHelper");b=this._view.defaultsFromMap?new n({root:this._view.map,rootCollectionNames:this._view.defaultsFromMap.mapCollectionPaths,getChildrenFunction:function(a){return a.layers}}):this._view.map.allLayers;b=new O({layers:b,extentHelper:this.extentHelper,manifold:this.manifold,viewSpatialReference:this._view.spatialReference});
this._set("tilingSchemeLogic",b);this._handles.add([this.tilingSchemeLogic.watch("tilingScheme",this._updateTilingSchemeAndExtent.bind(this),!0),this.tilingSchemeLogic.watch("extent",this._updateTilingSchemeAndExtent.bind(this),!0)],"tilingSchemeLogic");this._updateTilingSchemeAndExtent();this._streamDataSupplier=this._view.resourceController.registerClient(this,A.ClientType.TERRAIN);b={needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate};this._view.resourceController.registerFrameWorker(this._frameUpdate.bind(this));
this._view.resourceController.registerIdleFrameWorker(this,b);this._viewChangeUpdate=this._viewChangeUpdate.bind(this);this._handles.add([this._view.on("resize",this._viewChangeUpdate),this._view.watch("state.camera",this._viewChangeUpdate,!0),this._view.watch("qualitySettings.tiledSurface.lodBias",this._viewChangeUpdate),this._view.watch("clippingArea",this._clippingChanged.bind(this))],"view");this._handles.add(this._view.allLayerViews.on("change",this._handleLayerViewChanges.bind(this)),"allLayerViews");
this._handleLayerViewChanges({added:this._view.allLayerViews.toArray(),removed:[],moved:[],target:this._view.allLayerViews});this._updateClippingExtent();this.notifyChange("extent")};q.prototype.destroy=function(){this._handles.destroy();this._removeAllTiles();this.tilingSchemeLogic.destroy();this._set("tilingSchemeLogic",null);this.extentHelper.destroy();this.extentHelper=null;for(var a in this._basemapLayerViewHandles)this._unregisterTiledLayerView(a);this._view.resourceController.deregisterFrameWorker();
this._view.resourceController.deregisterIdleFrameWorker(this);this._view.resourceController.deregisterClient(this);this.overlayManager&&(this.overlayManager.destroy(),this._set("overlayManager",null));this._renderer.destroy(this._stage);this._streamDataSupplier=this._stage=this._view=this._renderer=null};Object.defineProperty(q.prototype,"cullBackFaces",{set:function(a){this._renderer.setCullBackFaces(a);this._set("cullBackFaces",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,
"extent",{get:function(){return this._clippingExtent||this._rootExtent},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"frontMostTransparent",{set:function(a){this._renderer.setFrontMostTransparent(a);this._set("frontMostTransparent",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"opacity",{set:function(a){this._renderer.setOpacity(a);this._set("opacity",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"ready",{get:function(){return!!this.rootTiles},
enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"renderOrder",{set:function(a){this._renderer.setRenderOrder(a);this._set("renderOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"skirts",{set:function(a){this._renderer.setDrawSkirts(a);this._set("skirts",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"tileBackground",{set:function(a){a!==this.tileBackground&&this._renderer.updateTileBackground(a);this._set("tileBackground",a)},enumerable:!0,
configurable:!0});Object.defineProperty(q.prototype,"velvetOverground",{set:function(a){a!==this.velvetOverground&&this._renderer.setVelvetOverground(a);this._set("velvetOverground",a)},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"wireframe",{set:function(a){this._renderer.setWireframe(a);this._set("wireframe",a);this._view._stage.setRenderParams({earlyOcclusionPixelDraw:a})},enumerable:!0,configurable:!0});q.prototype.setVisibility=function(a){a!==this.visible&&(this.visible=
a,this._renderer.setVisibility(a),this.setUpdatesDisabled(!a),a&&this._viewChangeUpdate())};q.prototype.isVisible=function(){return this.visible&&this.ready};q.prototype.isSeeThrough=function(){return this._renderer.isTransparent()};q.prototype.setUpdatesDisabled=function(a){(this.suspended=a)||this._viewChangeUpdate()};q.prototype.intersect=function(a,b,d){this._renderer.intersect(a,b,d)};q.prototype.getElevation=function(a){if(!this.ready)return null;var b=this.rootTiles;if(0===b[0].layerInfo[P.LayerClass.ELEVATION].length)return null;
if(a instanceof B){if(!p.pointToVector(a,fa,this.tilingScheme.spatialReference))return u.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;a=fa}for(var d,e=0;e<b.length;e++){var c=b[e];if(T.isPosWithinTile(c,a)){for(;c&&!c.renderData;)b=0,a[0]>.5*(c.extent[0]+c.extent[2])&&(b+=1),a[1]<.5*(c.extent[1]+c.extent[3])&&(b+=2),c=c.children[b];d=(b=c.renderData)&&b.geometryState?b.geometryState.samplerData:null;break}}return d?R.elevationSampler(a[0],
a[1],d):null};q.prototype.getElevationBounds=function(){return this._elevationBounds};q.prototype.getScale=function(a){if(this.tilingScheme){if(!p.pointToVector(a,fa,this.spatialReference))return u.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;if(this.rootTiles)for(var b=0;b<this.rootTiles.length;b++)if(a=this.rootTiles[b],T.isPosWithinTile(a,fa)){for(;a.children[0];)b=0,fa[0]>a.children[0].extent[2]&&(b+=1),fa[1]<a.children[0].extent[1]&&
(b+=2),a=a.children[b];return this._getLodBiasCorrectedScale(a.lij[0])}}return 1E100};q.prototype.queryVisibleScaleRange=function(a,b,d,e){b=b?this.tilingScheme.levelAtScale(b):0;d=d?this.tilingScheme.levelAtScale(d):Infinity;var c=this._getLodBias();this._renderer.queryVisibleLevelRange(a,b+c,d+c,e)};q.prototype._setLoaded=function(){this.loaded||this._set("loaded",!0)};q.prototype._updateTilingSchemeAndExtent=function(){var a=this.tilingSchemeLogic.extent,b=this.tilingSchemeLogic.tilingScheme,d=
!1;a&&!w.equals(a,this._dataExtent)&&(d=!0,this._dataExtent?w.set(this._dataExtent,a):this._dataExtent=w.create(a));b!==this.tilingScheme&&(m(!!b,"tiling scheme cannot be reset to undefined"),d=!0,this.tilingScheme&&this._removeAllTiles(),this._set("tilingScheme",b),this._updateClippingExtent(),b&&(this._updateTiledLayers(),this._renderer.setTileSize(b.pixelSize[0]),this.overlayManager.setSpatialReference(b.spatialReference,"spherical"===this.manifold)));d&&this._updateRootTiles()};q.prototype._acquireTile=
function(a,b,d,e){var c=this.tilePool.acquire();aa[0]=a;aa[1]=b;aa[2]=d;c.init(aa,e,this,this.tilingScheme);return c};q.prototype._releaseTile=function(a){a.dispose();a.parent=null;a.parentSurface=null;this.tilePool.release(a)};q.prototype._updateRootTiles=function(){var a=this,b=this._clippingExtent||this._dataExtent,e=this.tilingScheme;if(b&&e){var c=fa,g=e.rootTilesInExtent(b,c,Infinity);if(this.rootTiles){if(g.length>Y){u.warn(P.TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR);return}var b=this.rootTiles.map(function(a){return a.lij}),
f=t.difference(b,g,h);if(0<f.removed.length||0<f.added.length){var m=this.rootTiles.filter(function(b){return-1<t.findIndex(f.removed,h.bind(null,b.lij))?(a._purgeChildTiles(b),a._purgeTile(b),!1):!0});f.added.forEach(function(b){b=a._acquireTile(0,b[1],b[2],null);m.push(b);a._loadTile(b)});this._set("rootTiles",m);this._renderer.setRootTiles(this.rootTiles)}}else g.length>Y&&(u.warn(P.TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR),g=e.rootTilesInExtent(b,c,Y)),this._set("rootTiles",g.map(function(b){b=a._acquireTile(0,
b[1],b[2],null);a._loadTile(b);return b})),this._renderer.setRootTiles(this.rootTiles);t.equals(c,this._rootExtent)||(this._rootExtent=d.create(c),this._hasFixedExtent()||this.notifyChange("extent"));this.setVisibility(!0);this._viewChangeUpdate();this.overlayManager.setOverlayDirty();this.notifyChange("ready")}};q.prototype._viewChangeUpdate=function(){this._stage&&!this.suspended&&this.tilingScheme&&this.visible&&(this._updateViewDependentParameters(),this._updateOverlayOpacity(this._curEyePos),
this._updateTiles(this.rootTiles))};q.prototype._updateTiles=function(a){var b=this._iteratorPool.acquire();b.reset(a);var d=this._curSplitLimits,e=this._curFrustumPlanes,c=this._curEyePos,g;T.hasVisibleSiblings(a)?(a=this._elevationBounds[0],g=this._elevationBounds[1]):(a=Infinity,g=-Infinity);for(;!b.done;){var f=b.next();f.updateClippingStatus(this._clippingExtent);var h=!0;if(f.updateVisibility(e,c)){f.updateScreenDepth(this._viewProjectionMatrix);f.renderData&&(a=Math.min(f.elevationBounds[0],
a),g=Math.max(f.elevationBounds[1],g));var m=f.shouldSplit(d,c);m===da.SPLIT?(f.pendingUpdates&=~da.MERGE,f.renderData?(h=!1,f.pendingUpdates|=da.SPLIT,b.skip()):h=!1):(f.pendingUpdates&=~da.SPLIT,m===da.VSPLITMERGE&&f.updateAgents(P.LayerClass.ELEVATION),b.skip())}else b.skip();if(h&&!f.renderData){f.pendingUpdates|=da.MERGE;f.pendingUpdates&=~da.SPLIT;h=this._iteratorPool.acquire();for(h.reset(f);!h.done;)m=h.next(),m.updateVisibility(e,c),m.visible&&m.updateScreenDepth(this._viewProjectionMatrix);
this._iteratorPool.release(h)}0!==f.pendingUpdates&&(this._pendingUpdates=!0)}this._iteratorPool.release(b);isFinite(a)&&isFinite(g)&&(this._elevationBounds[0]!==a||this._elevationBounds[1]!==g)&&(this._elevationBounds[0]=a,this._elevationBounds[1]=g,this.emit("elevation-bounds-change",null))};q.prototype._updateViewDependentParameters=function(){var a=this._view.state.camera,b=Math.tan(.5*a.fovX),d=Math.tan(.5*a.fovY),c=this.tilingScheme.pixelSize,f=Math.pow(2,-this._getLodBias());this._curSplitLimits[0]=
b;this._curSplitLimits[1]=c[0]/a.width*this.maxTextureScale*f;this._curSplitLimits[2]=d;this._curSplitLimits[3]=c[1]/a.height*this.maxTextureScale*f;this._curSplitLimits[4]=this.tilingScheme.getMaxLod();this._curSplitLimits[5]=this._view.qualitySettings.tiledSurface.angledSplitBias;a.copyFrustumPlanes(this._curFrustumPlanes);g.multiply(a.projectionMatrix,a.viewMatrix,this._viewProjectionMatrix);e.set(a.eye,this._curEyePos);N.autoUpdateSkirtsVisibility(this,this._curEyePos)};q.prototype._setLayerViewsUpdating=
function(){for(var a=0;a<P.LayerClass.LAYER_CLASS_COUNT;a++)for(var b=this._layerViews[a],d=0;d<b.length;d++)b[d]._evaluateUpdatingState(this._pendingUpdates)};q.prototype._frameUpdateTraversal=function(a){if(!this.suspended){this._frameUpdateLowerPrio.clear();var b=this._renderer.resourceCounter.numTileTexturesComposited,d=this._iteratorPool.acquire();d.reset(this.rootTiles);for(var e=!1,c=!1;!d.done&&(1<a.remaining()||!e)&&this._renderer.resourceCounter.numTileTexturesComposited-b<W;){var g=d.next();
g.pendingUpdates&da.MERGE?(this._mergeTile(g),g.pendingUpdates&=~da.MERGE,e=!0,d.skip()):g.pendingUpdates&da.SPLIT?(this._splitTile(g),g.pendingUpdates&=~da.SPLIT,e=!0,d.skip()):0<g.pendingUpdates&&this._frameUpdateLowerPrio.push(g);0!==g.pendingUpdates&&(c=!0)}this._pendingUpdates=c||!d.done;this._iteratorPool.release(d);return e}};q.prototype._updateTileGeometry=function(a){this._renderer._updateTileGeometry(a);ea.spatialReference=this.spatialReference;ea.tile=a;ea.extent=a.extent;this.emit("elevation-change",
ea)};q.prototype._updateTileTexture=function(a){this._renderer.updateTileTexture(a)};q.prototype._frameUpdate=function(a){if(this.rootTiles){for(var b=this._frameUpdateTraversal(a);(1<a.remaining()||!b)&&0<this._frameUpdateLowerPrio.length;){var d=this._frameUpdateLowerPrio.pop();d.pendingUpdates&da.DECODE_ELEVATION?(this._decodeElevation(d),d.pendingUpdates&=~da.DECODE_ELEVATION,b=!0):d.pendingUpdates&da.UPDATE_GEOMETRY?(this._renderer.updateTileGeometryNeedsUpdate(d),this._updateTileGeometry(d),
b=!0,d.pendingUpdates&=~da.UPDATE_GEOMETRY):d.pendingUpdates&da.UPDATE_TEXTURE&&(this._updateTileTexture(d),d.pendingUpdates&=~da.UPDATE_TEXTURE,b=!0);0!==d.pendingUpdates&&(this._pendingUpdates=!0)}0<this._frameUpdateLowerPrio.length&&(this._pendingUpdates=!0);if(this._streamDataSupplier.hasPendingDownloads()||0!==this._vectorTileLayerRequests)this._pendingUpdates=!0;this._pendingUpdates===this._lvPendingUpdates||!this._pendingUpdates&&20!==++this._updateNextFrame||(this._setLayerViewsUpdating(),
this._lvPendingUpdates=this._pendingUpdates,this._updateNextFrame=0)}};q.prototype._needsIdleUpdate=function(){return this.isVisible()&&this.overlayManager&&this.overlayManager.overlaysNeedUpdate()};q.prototype._idleUpdate=function(){this.overlayManager.updateOverlay();this._updateOverlayOpacity(this._curEyePos)};q.prototype._updateClippingExtent=function(){if(!this.spatialReference)return!1;var a=[0,0,0,0],b=null;p.extentToBoundingRect(this._view.clippingArea,a,this.spatialReference)&&(b=a);if(t.equals(b,
this._clippingExtent))return!1;this._clippingExtent=b;this._renderer.clippingExtent=b;this.notifyChange("extent");this.overlayManager.setOverlayDirty();return!0};q.prototype._clippingChanged=function(){this._updateClippingExtent()&&this._updateRootTiles()};q.prototype._getLodBias=function(){return Math.round(this._view.qualitySettings.tiledSurface.lodBias)};q.prototype._getLodBiasCorrectedScale=function(a){var b=this.tilingScheme.levels;a=F.clamp(a-this._getLodBias(),0,b.length-1);return b[a].scale};
q.prototype._cancelTilemapRequests=function(a){for(var b=0;b<P.LayerClass.LAYER_CLASS_COUNT;b++){var d=a.layerInfo[b];if(d)for(var e=0;e<d.length;e++){var c=d[e];c.tilemapRequest&&(c.tilemapRequest.cancel(),c.tilemapRequest=null)}}};q.prototype._removeAllTiles=function(){var a=this;this.rootTiles&&(this.rootTiles.forEach(function(b){a._purgeChildTiles(b);a._purgeTile(b)}),this._set("rootTiles",null),this.notifyChange("ready"));for(var b=0;b<this._topLevelTilemapOnlyTiles.length;b++)this._cancelTilemapRequests(this._topLevelTilemapOnlyTiles[b]);
this.setVisibility(!1)};q.prototype._purgeChildTiles=function(a){var b=this._postorderIterator;for(b.reset(a);!b.done;){for(var d=b.next(),e=0;4>e;e++)d.children[e]=null;d!==a&&this._purgeTile(d)}};q.prototype._purgeTile=function(a){a.unload(this._renderer);this._cancelTilemapRequests(a);a.parent=null;this._releaseTile(a)};q.prototype._splitTile=function(a){var b=a.lij[0]+1,d=2*a.lij[1],e=2*a.lij[2];a.children[0]=this._createTile(b,d,e,a);a.children[1]=this._createTile(b,d,e+1,a);a.children[2]=this._createTile(b,
d+1,e,a);a.children[3]=this._createTile(b,d+1,e+1,a);a.unload(this._renderer);ja.spatialReference=this.spatialReference;ja.extent=a.extent;ja.scale=this._getLodBiasCorrectedScale(b);this.emit("scale-change",ja)};q.prototype._createTile=function(a,b,d,e){m(!!e,"_createTile sanity check");a=this._acquireTile(a,b,d,e);a.updateClippingStatus(this._clippingExtent);a.updateVisibility(this._curFrustumPlanes,this._curEyePos);a.visible&&(a.updateScreenDepth(this._viewProjectionMatrix),a.shouldSplit(this._curSplitLimits,
this._curEyePos)===da.SPLIT&&(a.pendingUpdates|=da.SPLIT,this._pendingUpdates=!0));this._loadTile(a);return a};q.prototype._mergeTile=function(a){m(!a.renderData,"_mergeTile sanity check");this._loadTile(a);this._purgeChildTiles(a);ja.spatialReference=this.spatialReference;ja.extent=a.extent;ja.scale=this._getLodBiasCorrectedScale(a.lij[0]);this.emit("scale-change",ja)};q.prototype._loadTile=function(a){a.load(this._renderer);this.overlayManager&&this.overlayManager.hasOverlays()&&this.overlayManager.setOverlayParamsOfTile(a,
a.renderData,this._curOverlayOpacity);ea.spatialReference=this.spatialReference;ea.tile=a;ea.extent=a.extent;this.emit("elevation-change",ea)};q.prototype._handleHasHighlights=function(a){this._renderer.setNeedsHighlight(a)};q.prototype._decodeElevation=function(a){var b=P.LayerClass.ELEVATION,d=a.layerInfo[b];if(d)for(var e=0;e<d.length;e++){var c=d[e];c.pendingUpdates&=~da.DECODE_ELEVATION;if(c.rawData){var g=a.decodeElevationData(c.rawData);c.rawData=null;if(g){c.data=g;var c=a.lij[0],f=this._iteratorPool.acquire();
for(f.reset(a);!f.done;){var h=f.next();h.findElevationBoundsForLayer(e,c);h.computeElevationBounds()}this._iteratorPool.release(f);a.dataArrived(e,b,g);this._updateTiles(a)}}}};q.prototype._handleLayerViewChanges=function(a){var b=this,d=!1;a.added.forEach(function(a){var e=a.layer;N.isTiledLayerView(a)?(b._registerTiledLayer(a),e.loaded&&(d=!0)):a.supportsDraping&&b.overlayManager&&b.overlayManager.registerLayerView(a)});a.removed.forEach(function(a){N.isTiledLayerView(a)?(d=!0,b._unregisterTiledLayerView(a.uid)):
a.supportsDraping&&b.overlayManager&&b.overlayManager.unregisterLayerView(a)});(d=d||0<a.moved.filter(N.isTiledLayerView).length)&&this._updateTiledLayers()};q.prototype._registerTiledLayer=function(a){var b=this,d=[];d.push(a.watch("suspended",function(){b._updateTiledLayers()}));d.push(a.watch("fullOpacity",function(){return b._updateTileTextures()}));a.on("data-changed",function(){var d=N.isElevationLayerView(a)?P.LayerClass.ELEVATION:P.LayerClass.MAP,e=b._layerIndexByLayerViewId[d][a.uid];null!=
e&&b._invalidateLayerData(e,d)});this._basemapLayerViewHandles[a.uid]=d};q.prototype._unregisterTiledLayerView=function(a){var b=this._basemapLayerViewHandles[a];if(b){for(var d=0;d<b.length;d++)b[d].remove();delete this._basemapLayerViewHandles[a]}};q.prototype._updateTiledLayers=function(){var a=this;if(this.tilingScheme){var b=this._view.allLayerViews,d=[[],[]],e=P.LayerClass,c=null,g=w.create(w.NEGATIVE_INFINITY);b.forEach(function(b){var f=b.layer;if(b.layer&&b&&!b.suspended&&N.isTiledLayerView(b)){var h=
b.fullExtent;h?a.tilingScheme.compatibleWith(b.tileInfo)?(w.expand(g,h),N.isElevationLayerView(b)?d[e.ELEVATION].push(b):(Infinity!==b.maxDataLevel&&(null===c||b.maxDataLevel>c)&&(c=b.maxDataLevel),d[e.MAP].push(b))):u.warn("Terrain: tiling scheme of layer "+f.id+" is incompatible with other tiled layers, will not be drawn"):u.warn("Terrain: Map or elevation layer does not have fullExtent: "+f.id)}},this);for(var b=function(a){var b=f._layerViews[a],c=d[a];c.reverse();var g=b.length!==c.length,h=
c.length,m=Array(h),l=Array(b.length);f._layerIndexByLayerViewId[a]={};for(var n=0;n<h;n++){f._layerIndexByLayerViewId[a][c[n].uid]=n;var p=b.indexOf(c[n]);m[n]=p;n!==p&&(g=!0);-1<p&&(l[p]=n)}if(g){f._topLevelTilemapOnlyTiles.forEach(function(b){return b.modifyLayers(l,m,a)});b=f._postorderIterator;if(f.rootTiles)for(b.reset(f.rootTiles);!b.done;)b.next().modifyLayers(l,m,a);f._layerViews[a]=c;if(f.rootTiles){for(b.reset(f.rootTiles);!b.done;)c=b.next(),c.restartAgents(a),a===e.ELEVATION&&c.computeElevationBounds();
f._updateTiles(f.rootTiles)}}},f=this,h=0;h<e.LAYER_CLASS_COUNT;h++)b(h);this.tilingScheme.levels.length-1<c&&(this.tilingScheme.ensureMaxLod(c),this._viewChangeUpdate())}};q.prototype._hasFixedExtent=function(){return!!this._clippingExtent};q.prototype.layerViewByIndex=function(a,b){return this._layerViews[b][a]};q.prototype.numLayers=function(a){return this._layerViews[a].length};q.prototype.numTotalLayers=function(){return this._layerViews.reduce(function(a,b){return b.length+a},0)};q.prototype._updateTileTextures=
function(){var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;)a.next().updateTexture();this._iteratorPool.release(a)};q.prototype._invalidateLayerData=function(a,b){var d=this._iteratorPool.acquire();for(d.reset(this.rootTiles);!d.done;)d.next().removeLayerAgent(a,b);for(d.reset(this.rootTiles);!d.done;)d.next().invalidateLayerData(a,b);this._iteratorPool.release(d)};q.prototype.requestTileData=function(a,b,d){var e=this;this.tilemapStats.tilesRequested++;var c=this.layerViewByIndex(b,
d),g=c.layer;if(g.tilemapCache){var f=this.getTilemapTile(a),h=f.layerInfo[d][b];if(h.tilemap){if(!f.tileDataAvailable(a,b,d))return this.tilemapStats.tilesNotPresent++,this._dispatchDataEvent(a,"dataMissing",d,c,{notInTilemap:!0}),b=new z.Promise,b.reject(),b}else{h.tilemapRequest||(h.tilemapRequest=this.requestTilemap(f,b,d,c,g));var m,l=new z.Promise(function(){m&&m.cancel()});h.tilemapRequest.always(function(){h.tilemapRequest=null;if(!l.isCancelled()){var b=e._layerIndexByLayerViewId[d][c.uid];
null!=b&&(f.tileDataAvailable(a,b,d)?(m=e._requestTileData(a,b,d,c),m.then(function(){return l.resolve()})):(e.tilemapStats.tilesNotPresent++,e._dispatchDataEvent(a,"dataMissing",d,c,{notInTilemap:!0}),l.reject()))}});return l}}return this._requestTileData(a,b,d,c)};q.prototype._requestTileData=function(a,b,d,e){this.tilemapStats.tileRequestsSent++;return d===P.LayerClass.ELEVATION?this._requestElevationTileData(a,b,d,e):this._requestMapTileData(a,b,d,e)};q.prototype._requestElevationTileData=function(a,
b,d,e){function c(b){var c=f._layerIndexByLayerViewId[d][e.uid];null!=c?(c=a.layerInfo[d][c],c.rawData=b,a.pendingUpdates|=da.DECODE_ELEVATION,c.pendingUpdates|=da.DECODE_ELEVATION,f._pendingUpdates=!0):u.warn("TerrainSurface: received data from unknown layer %d %s",d,a.lij.toString())}function g(b){ca(b)||(f.tilemapStats.tileRequestErrors++,f._dispatchDataEvent(a,"dataMissing",d,e,b))}var f=this,h;N.isElevationLayerView(e)?(b=e.layer,N.useFetchTileForLayer(b)?(h=b.fetchTile(a.lij[0],a.lij[1],a.lij[2],
P.ELEVATION_NODATA_VALUE),h.then(function(a){return c(a)},g)):(b=e.getTileUrl(a.lij[0],a.lij[1],a.lij[2]),h=this._streamDataSupplier.request(b,"binary"),h.then(function(a,b){b.url=a;c(b)},g))):m(!1,"_requestElevationTileData can only be called for elevation layer views");return h};q.prototype._requestMapTileData=function(a,b,d,e){function c(b){f._dispatchDataEvent(a,"dataArrived",d,e,b)}function g(b){ca(b)||(f._dispatchDataEvent(a,"dataMissing",d,e,b),f.tilemapStats.tileRequestErrors++)}var f=this;
if(N.isVectorTileLayerView(e)){var h=e.tileHandler;b=e.schemeHelper.getCompatibleLevelRowCol(a.lij);b=h.getVectorTileWithLRC(b[0],b[1],b[2],0);b.then(c).otherwise(g).always(function(){f._vectorTileLayerRequests=h.ongoingRequestCount});this._vectorTileLayerRequests=h.ongoingRequestCount}else N.useFetchTileForLayer(e.layer)&&N.isTileLayerView(e)?(b=e.layer.fetchTile(a.lij[0],a.lij[1],a.lij[2]),b.then(c).otherwise(g)):(b=e.getTileUrl(a.lij[0],a.lij[1],a.lij[2]),b=this._streamDataSupplier.request(b,"image"),
b.then(function(a,b){return c(b)},g));return b};q.prototype.requestTilemap=function(a,b,d,e,c){var g=this,f=a.lij[0]+P.TILEMAP_SIZE_EXP,h=a.lij[1]<<P.TILEMAP_SIZE_EXP,m=a.lij[2]<<P.TILEMAP_SIZE_EXP;this.tilemapStats.tilemapRequestsSent++;this.tilemapStats.tilemapRequestsPending++;return c.tilemapCache.fetchTilemap(f,h,m,{timeout:6E3}).then(function(c){g.tilemapStats.tilemapRequestsPending--;b=g._layerIndexByLayerViewId[d][e.uid];null!=b&&(a.layerInfo[d][b].tilemap=c)}).otherwise(function(a){g.tilemapStats.tilemapRequestsPending--;
g.tilemapStats.tilemapRequestErrors++})};q.prototype.getTilemapTile=function(a){var b=a.lij[0];return b>P.TILEMAP_SIZE_EXP?T.getTileNLevelsUp(a,P.TILEMAP_SIZE_EXP):this._topLevelTilemapOnlyTiles[b]};q.prototype._dispatchDataEvent=function(a,b,d,e,c){e=this._layerIndexByLayerViewId[d][e.uid];if(null!=e)a[b](e,d,c);else u.warn("TerrainSurface: received data from unknown layer")};q.prototype._updateTileOverlayParams=function(){if(this.rootTiles){var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;){var b=
a.next();b.renderData&&this.overlayManager&&this.overlayManager.setOverlayParamsOfTile(b,b.renderData,this._curOverlayOpacity)}this._iteratorPool.release(a);this._renderer.setNeedsRender()}};q.prototype._updateOverlayOpacity=function(a){if(this.overlayManager&&(a=this.overlayManager.updateOpacity(a),!isNaN(a))){if(a!==this._curOverlayOpacity&&this.rootTiles){var b=this._iteratorPool.acquire();for(b.reset(this.rootTiles);!b.done;){var d=b.next();d.renderData&&d.renderData.overlayTexId&&(d.renderData.overlayOpacity=
a)}this._iteratorPool.release(b)}this._curOverlayOpacity=a;this._renderer.setNeedsRender()}};q.prototype.getStats=function(){var a=0,b=0,d=0,e=[],c=this._iteratorPool.acquire();for(c.reset(this.rootTiles);!c.done;){var g=c.next();a++;g.renderData&&(b++,g.visible&&(d++,g=g.lij[0],e[g]=null!=e[g]?e[g]+1:1))}this._iteratorPool.release(c);return{numNodes:a,numLeaves:b,numVisible:d,numVisiblePerLevel:e}};q.prototype.getMemoryUsage=function(){var a=0,b=0,d=0,e=0,c=0,g=0,f=this._iteratorPool.acquire();f.reset(this.rootTiles);
for(var h=this.tilingScheme.pixelSize,h=h[0]*h[1]*4;!f.done;){var m=f.next(),l=Q(m),n;for(n in m.layerInfo[P.LayerClass.MAP]){var p=m.layerInfo[P.LayerClass.MAP][n].data,k=p&&p.descriptor?1.3*p.descriptor.width*p.descriptor.height*4:0,p=p&&!p.descriptor?h:0;m.renderData||l?(a+=p,e+=k):(b+=p,c+=k)}for(n in m.layerInfo[P.LayerClass.ELEVATION])p=m.layerInfo[P.LayerClass.ELEVATION][n].data,a+=p?h:0;m.renderData&&(l=m.renderData.texture,e+=l&&l.descriptor?1.3*l.descriptor.width*l.descriptor.height*4:0,
m=m.renderData.geometryInfo.geometry,g+=m.data.estimateGpuMemoryUsage(),d+=2*m.data.getIndices("terrain").length,d+=4*m.data.getAttribute("terrain").data.length)}this._iteratorPool.release(f);return{cpuVisibleImageData:a,cpuInvisibleImageData:b,cpuGeometryData:d,gpuVisibleImageData:e,gpuInvisibleImageData:c,gpuGeometryData:g}};q.prototype.getTile=function(a){var b=a.split("/").map(function(a){return+a});if(0===b[0])return this.rootTiles.forEach(function(a){if(a.lij[1]===b[1]&&a.lij[2]===b[2])return a}),
null;var d=Math.pow(2,b[0]),e=Math.floor(b[1]/d),c=Math.floor(b[2]/d),g;this.rootTiles.some(function(a){return a.lij[1]===e&&a.lij[2]===c?(g=a,!0):!1});if(g){for(d=1<<b[0]-1;g.lij[0]<b[0];){var f=b[1]&d?2:0;0<(b[2]&d)&&f++;if(!g.children[f])return console.log("Tile "+a+" doesn't exist, smallest ancestor is "+T.tile2str(g)),null;g=g.children[f];d>>=1}m(g.lij[0]===b[0]&&g.lij[1]===b[1]&&g.lij[2]===b[2],"not the right tile?");return g}return null};q.prototype.hasPendingUpdates=function(){if(this._streamDataSupplier.hasPendingDownloads()||
0!==this._vectorTileLayerRequests)return!0;var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;)if(0<a.next().pendingUpdates)return this._iteratorPool.release(a),!0;this._iteratorPool.release(a);return!1};q.prototype.setBorders=function(a){this._renderer.setBorders(a)};q.prototype.setDisableRendering=function(a){this._renderer.setDisableRendering(a)};a([b.property({value:!1})],q.prototype,"cullBackFaces",null);a([b.property({readOnly:!0})],q.prototype,"extent",null);a([b.property({value:!1})],
q.prototype,"frontMostTransparent",null);a([b.property({readOnly:!0})],q.prototype,"loaded",void 0);a([b.property({value:1})],q.prototype,"opacity",null);a([b.property({readOnly:!0})],q.prototype,"overlayManager",void 0);a([b.property({readOnly:!0})],q.prototype,"manifold",void 0);a([b.property()],q.prototype,"maxTextureScale",void 0);a([b.property({readOnly:!0})],q.prototype,"ready",null);a([b.property({value:1})],q.prototype,"renderOrder",null);a([b.property({readOnly:!0})],q.prototype,"rootTiles",
void 0);a([b.property({value:!0})],q.prototype,"skirts",null);a([b.property({readOnly:!0,aliasOf:"tilingScheme.spatialReference"})],q.prototype,"spatialReference",void 0);a([b.property({value:P.DEFAULT_TILE_BACKGROUND})],q.prototype,"tileBackground",null);a([b.property({readOnly:!0})],q.prototype,"tilingScheme",void 0);a([b.property({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeLocked"})],q.prototype,"tilingSchemeLocked",void 0);a([b.property({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeDone"})],
q.prototype,"tilingSchemeDone",void 0);a([b.property({readOnly:!0})],q.prototype,"tilingSchemeLogic",void 0);a([b.property({value:!0})],q.prototype,"velvetOverground",null);a([b.property({value:!1})],q.prototype,"wireframe",null);return q=a([b.subclass("esri.views.3d.terrain.TerrainSurface")],q)}(b.declared(c,D.Evented));var C=1.2,M=80/180*Math.PI,Y=P.MAX_ROOT_TILES,W=12,da=P.TileUpdateTypes,fa=d.create(),aa=[0,0,0],ea={spatialReference:null,tile:null,extent:null},ja={spatialReference:null,extent:null,
scale:0};return x})},"esri/views/3d/terrain/OverlayManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/on ../../../core/Logger ../../../core/Accessor ../../../core/HandleRegistry ../../../core/accessorSupport/decorators ../../../geometry/Point ../lib/glMatrix ../state/utils/viewUtils ../support/mathUtils ../support/earthUtils ../support/projectionUtils ../support/aaBoundingRect ../support/debugFlags ../webgl-engine/Stage ../webgl-engine/lib/Texture ../webgl-engine/lib/Selector ../support/debugFlags ../../../symbols/SimpleMarkerSymbol ../../../Graphic".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I){var K=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]],L=c.getLogger("esri.views.3d.OverlayManager"),O,P=function(c){function e(){var a=null!==c&&c.apply(this,arguments)||this;a._handles=new n;a._overlaySR=null;a._renderSR=null;a._overlaySREqualsRenderSR=!0;a._connectedLayers={};a._scale=0;a._dirty=!1;a._isSpherical=!1;a._latestOriginId=0;a.opacity=0;return a}
k(e,c);Object.defineProperty(e.prototype,"hasHighlights",{get:function(){return this._renderer.hasHighlights},enumerable:!0,configurable:!0});e.prototype.initialize=function(){var a=this;this._stage=this.view._stage;this._renderer=this._stage.getTextureGraphicsRenderer();this._renderer.onHasHighlightsChanged=function(){return a.onHasHighlightsChanged()};this._initialEmptyTexture=new p(new Uint8Array([0,0,0,0]),"overlayEmpty",{width:1,height:1,wrapClamp:!0});this.groundSelector=new z(this.view.viewingMode);
this.groundSelector.enableBackfacesTerrain=!0;this.groundSelector.enableInvisibleTerrain=!0;this.groundSelector.enableHUDSelection=!1;this._stage.add(G.ModelContentType.TEXTURE,this._initialEmptyTexture);this._handles.add(this.view.watch(["pointsOfInterest.renderPointOfView","pointsOfInterest.centerOnSurfaceFrequent.location"],function(){return a.setOverlayDirty()}))};e.prototype.destroy=function(){for(var a in this._connectedLayers)this.unregisterLayerView(this._connectedLayers[a].layerView);this._disposeOverlays();
this._stage.remove(G.ModelContentType.TEXTURE,this._initialEmptyTexture.getId());this._handles&&(this._handles.destroy(),this._handles=null)};e.prototype.onHasHighlightsChanged=function(){this.setOverlayDirty();this.notifyChange("hasHighlights")};e.prototype.hasOverlays=function(){return!!this._overlays};e.prototype.setSpatialReference=function(a,b){(this._overlaySR=a)?(this._renderSR=this.view.renderSpatialReference,this._overlaySREqualsRenderSR=this._overlaySR.equals(this._renderSR),this._longitudeCyclical=
(this._isSpherical=b)?a.isWebMercator?new B.Cyclical(-2.0037508342788905E7,2.0037508342788905E7):new B.Cyclical(-180,180):null):(this._disposeOverlays(),this._longitudeCyclical=null)};e.prototype.registerLayerView=function(a){var d=this,e=a.layer.uid;if(this._connectedLayers[e])L.warn("[OverlayManager#registerLayerView]: Layer "+e+" is already connected");else{var c=b(a,"draped-data-change",function(){return d.setOverlayDirty()});this._connectedLayers[e]={eventHandles:[c],layerView:a};if(a.setDrapingExtent&&
this._overlays)for(e=0;e<this._overlays.length;e++)c=this._overlays[e],a.setDrapingExtent(e,c.extent,this._overlaySR,2048,c.renderLocalOrigin);this.setOverlayDirty();this._setLayerViewOverlayUpdating(a,this._dirty)}};e.prototype.unregisterLayerView=function(a){for(var b in this._connectedLayers){var d=this._connectedLayers[b];if(d.layerView===a){if(d.eventHandles)for(var e=0;e<d.eventHandles.length;e++)d.eventHandles[e].remove();delete this._connectedLayers[b];this.setOverlayDirty();a.destroyed||
(a._overlayUpdating=!1,a._evaluateUpdatingState())}}};e.prototype.setOverlayDirty=function(){this._dirty||(this._setOverlayUpdating(!0),this._dirty=!0)};e.prototype._setLayerViewOverlayUpdating=function(a,b){if(!b||!a.suspended&&a.hasDraped)a._overlayUpdating=b,a._evaluateUpdatingState()};e.prototype._setOverlayUpdating=function(a){for(var b in this._connectedLayers)this._setLayerViewOverlayUpdating(this._connectedLayers[b].layerView,a);if(b=this.view._graphicsView)b._overlayUpdating=a,b._evaluateUpdatingState()};
e.prototype.updateOverlay=function(){if(this._overlaySR){var a=this._computeOverlayExtents();if(a){this._overlays||this._initOverlays();for(var b=0;b<this._overlays.length;b++){var e=this._overlays[b],c;a:{c=a[b];for(var f=e.extent,h=F.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS?0:P.EXTENTS_DIFFER_THRESHOLD*Math.max(c[2]-c[0],c[3]-c[1],f[2]-f[0],f[3]-f[1]),n=0;4>n;n++)if(Math.abs(f[n]-c[n])>h){c=!0;break a}c=!1}if(c){l.vec4d.set(a[b],e.extent);e.renderLocalOrigin={id:"OV_"+this._latestOriginId++,vec3:D.center(e.extent,
l.vec3d.create())};for(var p in this._connectedLayers)c=this._connectedLayers[p].layerView,c.setDrapingExtent&&c.setDrapingExtent(b,a[b],this._overlaySR,2048,e.renderLocalOrigin)}}this._setOverlayUpdating(!1);this._drawOverlays();this.terrainSurface._updateTileOverlayParams();this._dirty=!1}}};e.prototype.overlaysNeedUpdate=function(){return this._dirty&&!!this._overlaySR};e.prototype.updateOpacity=function(a){var b=1;if(this._overlays){var d=this._scale;a=this.view.renderCoordsHelper.getAltitude(a);
3.5*a<d&&(b=Math.sqrt(B.clamp((a-d/10)/(d/3.5-d/10),0,1)))}return b};e.prototype.setOverlayParamsOfTile=function(a,b,e){var d=a.extent;if(a=this._overlayForTile(a)){var c=a.extent;b.overlayTexScale[0]=(d[2]-d[0])/(c[2]-c[0]);b.overlayTexScale[1]=(d[3]-d[1])/(c[3]-c[1]);var g=d[0];if(this._longitudeCyclical){var g=this._longitudeCyclical.minimalMonotonic(c[0],g),f=this._longitudeCyclical.minimalMonotonic(c[0],d[2]);g>f&&(g=f-(d[2]-d[0]))}l.vec2d.set2((g-c[0])/(c[2]-c[0]),(d[1]-c[1])/(c[3]-c[1]),b.overlayTexOffset);
b.overlayTexId=a.valid?a.texture.getId():this._initialEmptyTexture.getId();b.highlightOverlayTexId=a.highlightValid?a.highlightTexture.getId():this._initialEmptyTexture.getId();b.overlayOpacity=void 0!==e?e:1}else b.overlayTexId=null,b.highlightOverlayTexId=null};e.prototype.overlayPixelSizeInMapUnits=function(a){var b;this._overlays&&(this._overlays[0]&&this._pointIsInExtent(a,this._overlays[0].extent)?b=this._overlays[0].extent:this._overlays[1]&&(b=this._overlays[1].extent));return b?(b[2]-b[0])/
2048:0};e.prototype._overlayForTile=function(a){var b=a.extent;a=a.clippingArea?D.intersection(b,a.clippingArea,S):b;return this._rectInsideRect(a,this._overlays[0].extent)?this._overlays[0]:this._rectanglesOverlap(a,this._overlays[1].extent)?this._overlays[1]:null};e.prototype._createEmptyOverlay=function(){var a=new p(null,"overlay",{wrapClamp:!0,mipmap:!0});this._stage.add(G.ModelContentType.TEXTURE,a);var b=new p(null,"highlightOverlay",{wrapClamp:!0,mipmap:!0});this._stage.add(G.ModelContentType.TEXTURE,
b);return{extent:l.vec4d.create(),texture:a,valid:!1,highlightTexture:b,highlightValid:!1,renderLocalOrigin:{id:"O",vec3:[0,0,0]}}};e.prototype._initOverlays=function(){this._overlays=[this._createEmptyOverlay(),this._createEmptyOverlay()]};e.prototype._disposeOverlays=function(){if(this._overlays){var a=this._stage;this._overlays.forEach(function(b){a.remove(G.ModelContentType.TEXTURE,b.texture.getId());a.remove(G.ModelContentType.TEXTURE,b.highlightTexture.getId())});this._overlays=null}};e.prototype._intersectGroundFromView=
function(a,b,e,c){var d=l.vec3d.createFrom(b*this.view.width,e*this.view.height,1);l.vec3d.unproject(d,a.viewMatrix,a.projectionMatrix,a.fullViewport,d);b=l.vec3d.createFrom(b*this.view.width,e*this.view.height,0);l.vec3d.unproject(b,a.viewMatrix,a.projectionMatrix,a.fullViewport,b);this.groundSelector.init([],b,d,null,a,null,!1);this.view.basemapTerrain.intersect(this.groundSelector,b,d);return this.groundSelector.minResult.getIntersectionPoint(c)};e.prototype._findHorizonBasedPointOfInterest=function(a,
b,e){var d=.5;if("global"===this.view.viewingMode){d=l.vec3d.create(a.eye);l.vec3d.normalize(d);l.vec3d.negate(d);b=l.vec3d.length(b);b=Math.asin(b/l.vec3d.length(a.eye));var c=Math.acos(l.vec3d.dot(a.viewForward,d)),d=B.clamp((b-(c-.5*a.fovY))/a.fovY,0,1);b=B.clamp((-b-(c-.5*a.fovY))/a.fovY,0,1);d=1===d&&0===b?.5:b+.55*(d-b)}else d=l.mat4d.multiplyVec4(a.projectionMatrix,l.vec4d.createFrom(0,Math.tan(.5*Math.PI-Math.acos(-a.viewForward[2])),1,0))[1],d=B.clamp(.5+.5*d,0,1),d=1===d||0===d?.5:0<a.eye[2]?
.55*d:1-.55*(1-d);return this._intersectGroundFromView(a,.5,d,e)?!0:!1};e.prototype._computeOverlayExtents=function(){var a=this.view.state.camera,b=this.terrainSurface.extent,e=l.vec3d.create(),c=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;this._findHorizonBasedPointOfInterest(a,this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,e)||l.vec3d.set(c,e);this._scale=this.view.renderCoordsHelper.getAltitude(a.eye);var f=l.vec3d.dist(a.eye,e),c=y.viewAngle(this.view.renderCoordsHelper,
c,a.eye),c=Math.PI/2-Math.abs(c-Math.PI/2);if(A.OVERLAY_SHOW_CENTER){var n=new J({color:[255,0,0],outline:{color:[255,255,255],width:2}}),p=new q;w.vectorToPoint(e,this._renderSR,p,this._overlaySR);n=new I({geometry:p,symbol:n});void 0!==O&&this.view.graphics.remove(O);this.view.graphics.add(n);O=n}this._overlaySREqualsRenderSR||w.vectorToVector(e,this._renderSR,e,this._overlaySR);n=1024*a.perPixelRatio*f*2;f=!1;p=Infinity;this._isSpherical&&(this._overlaySR.isWebMercator?(n/=Math.cos(w.webMercator.y2lat(e[1])),
p=this.terrainSurface.extent[3],p*=.999):(f=!0,n/=v.metersPerDegree,p=90),n>=p&&(n=p,e[1]=0,this._overlaySR.isWebMercator&&(e[0]=0)));var k=1;f&&(k=1/Math.max(.2,Math.cos(Math.abs(B.deg2rad(e[1])))),180<n*k&&(k=180/n));var t=n*k,r=V[0];r[0]=e[0]-t;r[1]=e[1]-n;r[2]=e[0]+t;r[3]=e[1]+n;this._isSpherical&&this._shiftExtentToFitBounds(r,Infinity,p);f=V[1];l.vec4d.set(r,f);6*t>b[2]-b[0]?l.vec4d.set(b,f):c<=.25*Math.PI?(f[0]-=t,f[1]-=n,f[2]+=t,f[3]+=n):(w.vectorToVector(a.eye,this._renderSR,T,this._overlaySR),
l.vec2d.subtract(e,T,S),a=-Math.atan2(S[1],S[0])+.125*Math.PI,0>a&&(a+=2*Math.PI),l.vec4d.scale(K[Math.floor(a/(.25*Math.PI))],2*n,S),S[0]*=k,S[2]*=k,l.vec4d.add(f,S,f));this._isSpherical&&(f[0]=this._longitudeCyclical.clamp(f[0]),f[2]=this._longitudeCyclical.clamp(f[2]),f[1]=Math.max(f[1],-p),f[3]=Math.min(f[3],p));!this._isSpherical&&b&&(a=D.intersection(r,b,h),b=D.intersection(f,b,ca),D.contains(a,b)&&(f[2]=f[0],f[3]=f[1]));this.opacity=1;return V};e.prototype._drawOverlays=function(){for(var a=
this._overlays[0].extent[2]-this._overlays[0].extent[0],b=this._renderer,e=0;e<this._overlays.length;e++){var c=this._overlays[e].extent,f=this._longitudeCyclical?c[2]>this._longitudeCyclical.max:!1,h=this._longitudeCyclical?c[0]<this._longitudeCyclical.min:!1;if(f||h){U.views=R;var h=void 0,h=f?this._longitudeCyclical.max-c[0]:this._longitudeCyclical.min-c[0],h=Math.round(h/(c[2]-c[0])*2048),n=U.views[0];l.vec4d.set4(0,0,h,2048,n.viewport);l.vec4d.set4(c[0],c[1],this._longitudeCyclical.max,c[3],
n.extent);f||(n.extent[0]+=this._longitudeCyclical.range);n=U.views[1];l.vec4d.set4(h,0,2048-h,2048,n.viewport);l.vec4d.set4(this._longitudeCyclical.min,c[1],c[2],c[3],n.extent);f&&(n.extent[2]-=this._longitudeCyclical.range)}else U.views=N,l.vec4d.set(c,U.views[0].extent),l.vec4d.set4(0,0,2048,2048,U.views[0].viewport);U.width=2048;U.height=2048;U.pixelRatio=a/(c[2]-c[0]);this._overlays[e].valid=b.draw(this._overlays[e].texture,U);this._overlays[e].highlightValid=b.drawHighlights(this._overlays[e].highlightTexture,
U)}};e.prototype._rectanglesOverlap=function(a,b){return this._longitudeCyclical?(this._longitudeCyclical.contains(b[0],b[2],a[0])||this._longitudeCyclical.contains(b[0],b[2],a[2])||this._longitudeCyclical.contains(a[0],a[2],b[0]))&&!(a[1]>b[3]||a[3]<b[1]):D.intersects(a,b)};e.prototype._rectInsideRect=function(a,b){return this._longitudeCyclical?this._longitudeCyclical.contains(b[0],b[2],a[0])&&this._longitudeCyclical.contains(b[0],b[2],a[2])&&a[1]>b[1]&&a[3]<b[3]:D.contains(b,a)};e.prototype._pointIsInExtent=
function(a,b){if(this._longitudeCyclical)return this._longitudeCyclical.contains(b[0],b[2],a.x)&&a.y>=b[1]&&a.y<=b[3];var d=a.x;a=a.y;return d>b[0]&&d<b[2]&&a>b[1]&&a<b[3]};e.prototype._shiftExtentToFitBounds=function(a,b,e){var d=0,c=0;a[0]<-b?d=a[0]+b:a[2]>b&&(d=b-a[2]);a[1]<-e?c=a[1]+e:a[3]>e&&(c=e-a[3]);D.offset(a,d,c)};e.EXTENTS_DIFFER_THRESHOLD=1E-5;a([f.property()],e.prototype,"view",void 0);a([f.property()],e.prototype,"terrainSurface",void 0);a([f.property({type:Boolean})],e.prototype,"hasHighlights",
null);return e=a([f.subclass("esri.views.3d.terrain.OverlayManager")],e)}(f.declared(t)),U={width:0,height:0,pixelRatio:0,views:null},N=[{viewport:l.vec4d.create(),extent:l.vec4d.create()}],R=[N[0],{viewport:l.vec4d.create(),extent:l.vec4d.create()}],S=l.vec4d.create(),T=l.vec3d.create(),V=[l.vec4d.create(),l.vec4d.create()],h=D.create(),ca=D.create();return P})},"esri/views/3d/terrain/PlanarTile":function(){define(["./TileBase","./TileGeometryFactory","../../../core/ObjectPool","../support/mathUtils",
"../lib/glMatrix"],function(x,r,k,a,b){var c=b.vec3d.createFrom(0,0,1);b=function(a,b,f,k){x.call(this);this.tileUp=c;void 0!==a&&this.init(a,b,f,k)};b.prototype=new x;b.prototype.constructor=b;b.prototype.init=function(b,c,f,k){x.prototype.init.call(this,b,c,f,k);this.edgeLen=this.extent[2]-this.extent[0];this.curvatureHeight=0;this.centerAtSeaLevel[0]=a.lerp(this.extent[0],this.extent[2],.5);this.centerAtSeaLevel[1]=a.lerp(this.extent[1],this.extent[3],.5);this.centerAtSeaLevel[2]=0;this.updateRadiusAndCenter()};
b.prototype.updateRadiusAndCenter=function(){x.prototype.updateRadiusAndCenter.call(this);var a=(this.extent[2]-this.extent[0])*Math.SQRT1_2,b=.5*(this.elevationBounds[0]-this.elevationBounds[1]);this.radius=Math.sqrt(a*a+b*b)};b.prototype.isVisible=function(a){if(!this.intersectsClippingArea)return!1;var b=this.extent[0],c=this.extent[1],k=this.elevationBounds[0],l=this.extent[2],t=this.extent[3],r=this.elevationBounds[1];return 0<a[0][0]*(0<a[0][0]?b:l)+a[0][1]*(0<a[0][1]?c:t)+a[0][2]*(0<a[0][2]?
k:r)+a[0][3]||0<a[1][0]*(0<a[1][0]?b:l)+a[1][1]*(0<a[1][1]?c:t)+a[1][2]*(0<a[1][2]?k:r)+a[1][3]||0<a[2][0]*(0<a[2][0]?b:l)+a[2][1]*(0<a[2][1]?c:t)+a[2][2]*(0<a[2][2]?k:r)+a[2][3]||0<a[3][0]*(0<a[3][0]?b:l)+a[3][1]*(0<a[3][1]?c:t)+a[3][2]*(0<a[3][2]?k:r)+a[3][3]||0<a[4][0]*(0<a[4][0]?b:l)+a[4][1]*(0<a[4][1]?c:t)+a[4][2]*(0<a[4][2]?k:r)+a[4][3]||0<a[5][0]*(0<a[5][0]?b:l)+a[5][1]*(0<a[5][1]?c:t)+a[5][2]*(0<a[5][2]?k:r)+a[5][3]?!1:!0};b.prototype._numSubdivisionsAtLevel=[2,2,2,2,2,2,2,2];b.prototype.createGeometry=
function(a,b,c){a.needsUpdate=!1;return r.createPlanarGlobeTile(a.numVertsPerRow,this.extent,a.samplerData,b,c,a.clippingArea)};b.Pool=new k(b);return b})},"esri/views/3d/terrain/TileBase":function(){define("./terrainUtils ./tileUtils ./TerrainConst ./ElevationData ./TilePerLayerInfo ./ElevationTileAgent ./MapTileAgent ../support/mathUtils ../lib/glMatrix ../../../core/arrayUtils".split(" "),function(x,r,k,a,b,c,t,n,f,q){var l=f.vec3d,y=f.vec2d,B=f.vec4d,v=f.mat4d,w=x.weakAssert,D=l.create(),F=B.create(),
G=B.create(),p=l.create(),z=t.AGENT_DONE,A=k.LayerClass.LAYER_CLASS_COUNT,J=k.LayerClass.MAP,I=k.LayerClass.ELEVATION,K=k.TileUpdateTypes;f=function(a,b,c){this.lij=[0,0,0];this.extent=B.create();this.extentWGS84Rad=B.create();this.centerAtSeaLevel=l.create();this.center=l.create();this.tileUp=p;this.elevationBounds=y.create();this.children=[null,null,null,null];this.layerInfo=Array(A);this.intersectsClippingArea=this.isWithinClippingArea=!0;this.clippingArea=null;this._maxTesselation=0};f.prototype.init=
function(a,c,f,l){this.lij[0]=a[0];this.lij[1]=a[1];this.lij[2]=a[2];l.getExtent(a[0],a[1],a[2],this.extent,this.extentWGS84Rad);this.intersectsClippingArea=this.isWithinClippingArea=!0;this.clippingArea=null;this.radius=this.edgeLen=0;this.vlevel=a?a[0]:0;c&&c.elevationBounds?y.set(c.elevationBounds,this.elevationBounds):y.set2(0,0,this.elevationBounds);this.parent=c;for(a=0;4>a;a++)this.children[a]=null;this.pendingUpdates=0;this.renderData=null;this.renderOrder=this.screenDepth=0;this.visible=
!1;this.parentSurface=f;for(a=0;a<A;a++)if(f){c=f.numLayers(a);var n;this.layerInfo[a]?(n=this.layerInfo[a],n.length=c):(n=Array(c),this.layerInfo[a]=n);for(var p=0;p<c;p++)n[p]=b.makeEmptyLayerInfo(a,n[p]),a==I&&this.findElevationBoundsForLayer(p,-1)}else this.layerInfo[a]=null;this.computeElevationBounds();this._maxTesselation=Math.min(l.pixelSize[0],k.MAX_TILE_TESSELATION)};f.prototype.dispose=function(){for(var a=0;a<A;a++)for(var b=this.layerInfo[a],c=0;c<b.length;c++)b[c].dispose()};f.prototype.updateScreenDepth=
function(a){l.set(this.center,G);G[3]=1;v.multiplyVec4(a,G,G);this.screenDepth=G[2]/G[3]};f.prototype.shouldSplit=function(a,b){var c=this.lij[0];if(1>c)return K.SPLIT;l.subtract(this.center,b,D);var f=l.length(D),p=this.edgeLen/(a[0]*f*2),f=this.edgeLen/(a[2]*f*2),k=a[1],q=a[3],t=a[4];a=a[5];return p<k?this.vlevel!==this.lij[0]?(this.vlevel=this.lij[0],K.VSPLITMERGE):K.NONE:c>=t?(b=c+Math.ceil(-n.log2(k/p)),b!==this.vlevel?(this.vlevel=b,K.VSPLITMERGE):K.NONE):6<c&&(l.scale(this.tileUp,l.dot(this.tileUp,
D),F),l.subtract(F,D),l.length2(F)>this.radius*this.radius&&(l.scale(F,this.radius/l.length(F)),l.add(F,this.center),l.subtract(b,F,F),b=this.elevationBounds[1]-this.elevationBounds[0],Math.min(1,(Math.abs(l.dot(F,this.tileUp))+.5*b+this.curvatureHeight)/l.length(F))*f<.1/a*q))?K.NONE:K.SPLIT};f.prototype.decodeElevationData=function(b){var c;if(b instanceof ArrayBuffer)try{c=a.createFromLERC(this.lij,this.extent,b,k.noDataValueOpt)}catch(P){console.warn("Error decoding %s: %s",b.url,P.message)}else c=
a.createFromFetchTileResult(this.lij,this.extent,b);return c};f.prototype.getWGS84Extent=function(){return this.extentWGS84Rad.map(n.rad2deg)};f.prototype.load=function(a){for(var b=0;b<A;b++)this.layerInfo[b]&&this._createOrUpdateAgents(0,b);a.loadTile(this)};f.prototype.unload=function(a){this.renderData&&a.unloadTile(this);for(a=0;a<A;a++)for(var b=this.layerInfo[a],f=0;f<b.length;f++){var l=b[f];l.loadingAgent&&l.loadingAgent!==z&&(l.loadingAgent.dispose(),(a===k.LayerClass.ELEVATION?c:t).Pool.release(l.loadingAgent),
l.loadingAgent=null);l.pendingUpdates=0}this.pendingUpdates&=~k.TileUpdateTypes.UPDATE_GEOMETRY;this.pendingUpdates&=~k.TileUpdateTypes.UPDATE_TEXTURE};f.prototype.updateClippingStatus=function(a){q.equals(a,this.clippingArea)||(a?(this.intersectsClippingArea=this.intersectsExtent(a),this.isWithinClippingArea=this.isWithinExtent(a)):this.isWithinClippingArea=this.intersectsClippingArea=!0,this.clippingArea=a,this.renderData&&this.updateGeometry())};f.prototype.updateVisibility=function(a,b,c){a=c||
this.isVisible(a,b)&&this.intersectsClippingArea;if(a!==this.visible)for(this.visible=a,b=this.layerInfo[0],c=0;c<b.length;c++){var f=b[c];f.loadingAgent&&f.loadingAgent!==z&&f.loadingAgent.setSuspension(!a)}return a};f.prototype.getLayerInfo=function(a,b){return this.layerInfo[b][a]};f.prototype.hasLayerData=function(a,b){return(a=this.layerInfo[b][a])&&a.data&&!a.dataInvalidated};f.prototype.tileDataAvailable=function(a,b,c){return(b=this.layerInfo[c][b].tilemap)?"unavailable"!==b.getAvailability(a.lij[1],
a.lij[2]):!0};f.prototype.requestLayerData=function(a,b,c){k.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d requested by tile %s",this.lij.toString(),b,a,c.tile.lij.toString());var f=this.layerInfo[b][a];if(-1<f.waitingAgents.indexOf(c))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),c.tile.lij.toString(),b,a),!0;if(f.data&&!f.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",
this.lij.toString(),c.tile.lij.toString(),b,a),f.waitingAgents.push(c),setTimeout(c.dataArrived.bind(c,this),0),!0;if(f.pendingUpdates&K.DECODE_ELEVATION)return f.waitingAgents.push(c),!0;f.waitingAgents.push(c);if(!f.requestPromise){var l=this.parentSurface.requestTileData(this,a,b);if(l.isFulfilled())return!1;a=function(){f.requestPromise===l&&(f.requestPromise=null)};f.requestPromise=l;l.then(a,a);return!!l}return!0};f.prototype.descendants=function(a){a||(a=[]);for(var b=0;4>b;b++){var c=this.children[b];
c&&(c.descendants(a),a.unshift(this.children[b]))}return a};f.prototype.isLij=function(a){return this.lij[0]===a[0]&&this.lij[1]===a[1]&&this.lij[2]==a[2]};f.prototype.findByLij=function(a){if(this.isLij(a))return this;for(var b=0;4>b;b++){var c=this.children[b];if(c&&(c=c.findByLij(a)))return c}return null};f.prototype.unrequestLayerData=function(a,b,c){k.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d canceled by tile %s",this.lij.toString(),b,a,c.tile.lij.toString());var f=this.layerInfo[b][a],
l=f.waitingAgents;c=l.indexOf(c);w(-1<c,"agent has not requested this piece of map data");l[c]=l[l.length-1];l.length--;1>l.length&&(l=f.requestPromise,c=!1,b===J&&(c=this.parentSurface.layerViewByIndex(a,J),c=x.isVectorTileLayerView(c)),c||w(l||f.rawData,"no pending operations on layerInfo that agents were waiting for"),l&&!l.isFulfilled()&&(l.cancel(),f.requestPromise=null),k.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d request/loading canceled",this.lij.toString(),b,a))};f.prototype.dataArrived=
function(a,b,c){a=this.layerInfo[b][a];a.data=c;a.dataInvalidated=!1;for(c=0;c<a.waitingAgents.length;c++)a.waitingAgents[c].dataArrived(this);a.waitingAgents.length=0};f.prototype.dataMissing=function(a,b,c){c.notInTilemap||console.error("Tile %s layer %d/%d error",this.lij.toString(),b,a);a=this.layerInfo[b][a];a.dataMissing=!0;for(b=0;b<a.waitingAgents.length;b++)a.waitingAgents[b].dataMissing(this);a.waitingAgents.length=0};f.prototype.updateTexture=function(a){this.renderData&&(a?this.parentSurface._renderer.updateTileTexture(this):
(this.pendingUpdates|=k.TileUpdateTypes.UPDATE_TEXTURE,this.parentSurface._pendingUpdates=!0))};f.prototype.invalidateLayerData=function(a,b){this.layerInfo[b][a].invalidateSourceData();this.restartAgents(b)};f.prototype.computeElevationBounds=function(){y.set2(Number.MAX_VALUE,-Number.MAX_VALUE,this.elevationBounds);for(var a=this.layerInfo[I],b=!1,c=0;c<a.length;c++){var f=a[c];f.elevationBounds&&(this.elevationBounds[0]=Math.min(this.elevationBounds[0],f.elevationBounds[0]),this.elevationBounds[1]=
Math.max(this.elevationBounds[1],f.elevationBounds[1]),b=!0)}b||y.set2(0,0,this.elevationBounds);this.updateRadiusAndCenter()};f.prototype.updateRadiusAndCenter=function(){l.scale(this.tileUp,.5*(this.elevationBounds[0]+this.elevationBounds[1]),F);l.add(this.centerAtSeaLevel,F,this.center)};f.prototype.findElevationBoundsForLayer=function(a,b){var c=this.layerInfo[I][a];if(!c.elevationBounds||c.elevationBounds[2]<b)if(b=this.parentSurface.layerViewByIndex(a,I),r.fallsWithinLayer(this,b.layer,!1)){b=
!1;if(c.data)y.set(c.data.bounds,F),F[2]=this.lij[0],b=!0;else{for(var f=this.parent,n=0,p=null,q=c.data;f&&(!q||n<k.ELEVATION_DESIRED_RESOLUTION_LEVEL);){n=this.vlevel-f.lij[0];p=q||p;q=f.layerInfo[I][a].data;if(!q&&p&&n>=k.ELEVATION_DESIRED_RESOLUTION_LEVEL)break;f=f.parent}if(q=q||p)q.computeMinMaxValue(this.lij[0],this.lij[1],this.lij[2],F),Infinity!==F[0]&&(F[2]=q.level,b=!0)}b&&(c.elevationBounds?l.set(F,c.elevationBounds):c.elevationBounds=[F[0],F[1],F[2]])}};f.prototype.updateGeometry=function(){this.pendingUpdates|=
k.TileUpdateTypes.UPDATE_GEOMETRY;this.parentSurface._pendingUpdates=!0};f.prototype.modifyLayers=function(a,f,l){for(var n=f.length,p=this.layerInfo[l],q=Array(n),v=0;v<p.length;v++){var r=p[v];r.loadingAgent&&r.loadingAgent!==z&&(r.loadingAgent.dispose(),(l===k.LayerClass.ELEVATION?c:t).Pool.release(r.loadingAgent),r.loadingAgent=null);r.waitingAgents.length=0}if(l===J)for(v=0;v<p.length;v++)void 0===a[v]&&p[v].dispose();for(v=0;v<n;v++)a=f[v],q[v]=-1<a?p[a]:b.makeEmptyLayerInfo(l);this.layerInfo[l]=
q};f.prototype.restartAgents=function(a){if(this.renderData)if(this._createOrUpdateAgents(0,a),a===I){this.updateGeometry();a=this.layerInfo[a];for(var b=0;b<a.length;b++)a[b].pendingUpdates|=k.TileUpdateTypes.UPDATE_GEOMETRY;this.parentSurface._pendingUpdates=!0}else this.updateTexture(!0)};f.prototype.updateAgents=function(a){if(this.renderData){for(var b=this.layerInfo[a],c=0;c<b.length;c++){var f=b[c];f.loadingAgent===z&&(f.loadingAgent=null)}this._createOrUpdateAgents(0,a)}};f.prototype.removeLayerAgent=
function(a,b){a=this.layerInfo[b][a];a.loadingAgent&&a.loadingAgent!==z&&a.loadingAgent.dispose();a.loadingAgent=null};f.prototype.agentDone=function(a,b){var c=this.layerInfo[b],f=c[a];f.loadingAgent=z;f.data||f.upsampleFromTile||a<c.length-1&&this._createOrUpdateAgents(a+1,b)};f.prototype._createOrUpdateAgents=function(a,b){var f;f=b===I?!1:!this.visible;for(var l=this.layerInfo[b];a<l.length;){var n=l[a],p=!1,q=this.parentSurface.layerViewByIndex(a,b);if(null!==n.loadingAgent&&n.loadingAgent!==
z)p=n.loadingAgent.update();else if(n.loadingAgent!==z&&r.fallsWithinLayer(this,q.layer,!1)){var v=b===k.LayerClass.ELEVATION?c:t,y=v.Pool.acquire();(p=y.init(this,a,b,f))?n.loadingAgent=y:(y.dispose(),v.Pool.release(y),n.loadingAgent=z)}if(p&&!q.isTransparent)break;a++}};f.prototype.geometryState=function(a){var b,c=this._getElevationInfo(a?a.samplerData:null),f=this.lij[0],l=!1;c.samplerData?(b=this.vlevel-f,b=Math.max(f-c.maxTileLevel,k.ELEVATION_DESIRED_RESOLUTION_LEVEL-b),f=this._maxTesselation,
b=n.clamp((f>>b)+1,2,f+1)):b=8>f?this._numSubdivisionsAtLevel[f]+1:2;f=this.clippingArea;if(!this.intersectsClippingArea||this.isWithinClippingArea)f=null;a?(a.numVertsPerRow!==b&&(a.numVertsPerRow=b,l=!0),c.changed&&(a.samplerData=c.samplerData,l=!0),q.equals(a.clippingArea,f)||(a.clippingArea=f,l=!0),a.needsUpdate=l):a={numVertsPerRow:b,samplerData:c.samplerData,needsUpdate:!0,clippingArea:f};return a};f.prototype._getElevationInfo=function(a){for(var b=this.layerInfo[I],c=b.length,f=Array(c),l=
0,n=0,p=!1,k=0;k<c;k++){var q=b[k];if(q.upsampleFromTile){var q=q.upsampleFromTile.tile,h=q.layerInfo[I][k].data;a&&a[l]===h.samplerData||(p=!0);f[l++]=h.samplerData;n=Math.max(n,q.lij[0])}else q.data&&(h=this.parentSurface.layerViewByIndex(k,I),r.fallsWithinLayer(this,h.layer,!1)&&(a&&a[l]===q.data.samplerData||(p=!0),f[l++]=q.data.samplerData,n=this.lij[0]))}a&&a.length!==l&&(p=!0);0<l?f.length=l:f=null;return{changed:p,samplerData:f,maxTileLevel:n}};f.prototype.isWithinExtent=function(a){var b=
this.extent;return b[0]>=a[0]&&a[2]>=b[2]&&b[1]>=a[1]&&a[3]>=b[3]};f.prototype.intersectsExtent=function(a){var b=this.extent;return b[2]>=a[0]&&a[2]>=b[0]&&b[3]>=a[1]&&a[3]>=b[1]};return f})},"esri/views/3d/terrain/terrainUtils":function(){define("require exports ./terrainUtilsPlanar ./terrainUtilsSpherical ../../../layers/TiledLayer ../../../layers/TileLayer ../../../layers/BaseTileLayer ../../../layers/BaseElevationLayer ../../../layers/ElevationLayer ../../../layers/VectorTileLayer ../../../layers/WMTSLayer ../../../support/basemapDefinitions".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){function B(a){return a&&"esri.views.3d.layers.TileLayerView3D"===a.declaredClass}function v(a){return a&&"esri.views.3d.layers.VectorTileLayerView3D"===a.declaredClass}function w(a){return a&&"esri.views.3d.layers.WMTSLayerView3D"===a.declaredClass}function D(a){return a&&"esri.views.3d.layers.ElevationLayerView3D"===a.declaredClass}function F(){z={};for(var a in y)y[a].baseMapLayers.forEach(function(a){z[a.url]=19});z["//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"]=
20}function G(a,b,c,f){return p["local"===f||"planar"===f?"planar":"spherical"].checkIfTileInfoSupportedForViewSR(a,b,c)}Object.defineProperty(r,"__esModule",{value:!0});var p={planar:k,spherical:a};r.weakAssert=function(a,b){a||console.warn("Terrain: "+b)};r.autoUpdateSkirtsVisibility=function(a,b){p[a.manifold].autoUpdateSkirtsVisibility(a,b)};r.isTiledLayer=function(a){return a&&(a.isInstanceOf(b)||a.isInstanceOf(t)||a.isInstanceOf(n)||a.isInstanceOf(l))};r.isVectorTileLayer=function(a){return a&&
a.isInstanceOf(q)};r.isTileLayerView=B;r.isVectorTileLayerView=v;r.isWMTSLayerView=w;r.isElevationLayerView=D;r.isTiledLayerView=function(a){return a&&(B(a)||D(a)||v(a)||w(a))};r.useFetchTileForLayer=function(a){return a.fetchTile&&!(a.fetchTile===c.prototype.fetchTile||a.fetchTile===f.prototype.fetchTile)};var z=null;r.getKnownTiledServiceLevelCap=function(a){z||F();a=a&&a.replace(/https?:/,"");return a in z?z[a]:Infinity};r.prepareKnownTiledServiceLevelCaps=F;r.checkIfTileInfoSupportedForView=G;
r.getTiledLayerInfo=function(a,b,c){var f,n;if(a.isInstanceOf(l)){if(a=a.activeLayer){var p=a.tileMatrixSet;if(p)f=p.tileInfo,n=p.fullExtent;else if(a=a.tileMatrixSets)if(a=a.find(function(a){return null==G(a.tileInfo,a.fullExtent,b,c)}))return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}}else f=a.isInstanceOf(q)?a.compatibleTileInfo256:a.tileInfo,n=a.fullExtent;return f&&n&&null==G(f,n,b,c)?{tileInfo:f,fullExtent:n}:{tileInfo:null,fullExtent:null}}})},"esri/views/3d/terrain/terrainUtilsPlanar":function(){define("require exports ./TilingScheme ./TerrainConst ../../../core/Error ../support/aaBoundingRect ../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t){function n(a,b,c,f){q.set(c,l);l[f]=b[f];f=q.subtract(l,b);var n=q.subtract(a,b,y),n=q.dot(n,f),k=q.dot(f,f);b=0>=n?b:k<=n?c:q.add(b,q.scale(f,n/k),l);a=q.subtract(a,b,l);return Math.PI/2-Math.atan(a[2]/Math.sqrt(a[0]*a[0]+a[1]*a[1]))}function f(a,b){var c=a.getElevationBounds();a=a.extent;c=.5*(c[0]+c[1]);B[0]=a[0];B[1]=a[1];B[2]=c;v[0]=a[2];v[1]=a[3];v[2]=c;a=c=Infinity;b[0]<B[0]?c=n(b,B,v,0):b[0]>v[0]&&(c=n(b,v,B,0));b[1]<B[1]?a=n(b,B,v,1):b[1]>v[1]&&(a=n(b,v,B,1));return Math.min(c,
a)}Object.defineProperty(r,"__esModule",{value:!0});var q=t.vec3d,l=q.create(),y=q.create(),B=q.create(),v=q.create();r.autoUpdateSkirtsVisibility=function(a,b){var l,n=!0,p=a.extent,k=c.containsPoint(p,b);k?l=a.getElevation(b):(l=a.getElevationBounds(),l=.5*(l[0]+l[1]));l>b[2]?n=!1:k||(c.containsPointWithMargin(p,b,a.hideSkirtsDistanceFromExtentMargin*Math.min(p[2]-p[0],p[3]-p[1]))?f(a,b)>a.hideSkirtsMinimumCameraTilt&&(n=!1):n=!1);n!==a.skirts&&(a.skirts=n)};r.tiltOnEdge=n;r.tiltToExtentEdge=f;
r.checkIfTileInfoSupportedForViewSR=function(f,l,n){if(f.spatialReference.isGeographic)return new b("tilingscheme:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes");var q=k.checkUnsupported(f);if(q)return q;var p=f.lods,q=p[0].resolution*Math.pow(2,p[0].level),t=[q*f.size[0],q*f.size[1]],v=[f.origin.x,f.origin.y];l=c.fromExtent(l);var r=c.create();k.computeRowColExtent(l,t,v,r);t=(r[2]-r[0])*(r[3]-r[1]);t>a.MAX_ROOT_TILES?(p=p[0].scale*Math.pow(2,p[0].level),
q=Math.max((l[3]-l[1])/f.size[1],(l[2]-l[0])/f.size[0])*p/q,l=Math.floor(Math.log(q)/Math.log(10)),q=Math.ceil(q/Math.pow(10,l))*Math.pow(10,l),q=new b("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(p).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+q.toLocaleString()+".",{level0Scale:p,suggestedLevel0Scale:q,requiredNumRootTiles:t,allowedNumRootTiles:a.MAX_ROOT_TILES})):q=null;return q?q:n&&!f.spatialReference.equals(n)?new b("tilingscheme:spatial-reference-mismatch",
"The tiling scheme does not match the spatial reference of the local scene"):null}})},"esri/views/3d/terrain/TilingScheme":function(){define(["../../../core/Error","../../../geometry/SpatialReference","../../../geometry/support/scaleUtils","../support/projectionUtils","../support/mathUtils"],function(x,r,k,a,b){var c=a.webMercator.x2lon,t=a.webMercator.y2lat,n=[0,0,0,0],f=function(a){var b=f._checkUnsupported(a);if(b)throw b;this.spatialReference=a.spatialReference;this._isWebMercator=this.spatialReference.isWebMercator;
this._isWGS84=this.spatialReference.isWGS84;this.origin=[a.origin.x,a.origin.y];this.pixelSize=[a.size[0],a.size[1]];var c=a.lods.reduce(function(a,b,c){b.level<a.min&&(a.min=b.level,a.minIndex=c);a.max=Math.max(a.max,b.level);return a},{min:Infinity,minIndex:0,max:-Infinity}),n=a.lods[c.minIndex],k=Math.pow(2,n.level),b=n.resolution*k,n=n.scale*k;this.levels=Array(c.max+1);for(c=0;c<this.levels.length;c++)this.levels[c]={resolution:b,scale:n,tileSize:[b*a.size[0],b*a.size[1]]},b/=2,n/=2};f.prototype=
{getExtent:function(a,f,n,k,v){k=k||Array(4);var l=this.levels[a];a=l.tileSize[0];l=l.tileSize[1];k[0]=this.origin[0]+n*a;k[2]=k[0]+a;k[3]=this.origin[1]-f*l;k[1]=k[3]-l;v&&(this._isWebMercator?(v[0]=c(k[0]),v[1]=t(k[1]),v[2]=c(k[2]),v[3]=t(k[3])):this._isWGS84&&(v[0]=b.deg2rad(k[0]),v[1]=b.deg2rad(k[1]),v[2]=b.deg2rad(k[2]),v[3]=b.deg2rad(k[3])))},ensureMaxLod:function(a){for(;this.levels.length<=a;){var b=this.levels[this.levels.length-1],c=b.resolution/2;this.levels.push({resolution:c,scale:b.scale/
2,tileSize:[c*this.pixelSize[0],c*this.pixelSize[1]]})}},capMaxLod:function(a){this.levels.length>a+1&&(this.levels.length=a+1)},getMaxLod:function(){return this.levels.length-1},scaleAtLevel:function(a){return this.levels[0].scale/Math.pow(2,a)},levelAtScale:function(a){var b=this.levels[0].scale;return a>=b?0:Math.log(b/a)*Math.LOG2E},compatibleWith:function(a){if(!(a instanceof f)){if(f._checkUnsupported(a))return!1;a=new f(a)}if(!a.spatialReference.equals(this.spatialReference)||a.pixelSize[0]!==
this.pixelSize[0]||a.pixelSize[1]!==this.pixelSize[1])return!1;var c=Math.min(this.levels.length,a.levels.length)-1,n=this.levels[c].resolution,k=b.floatEqualAbsolute,q=.5*n;if(!k(a.origin[0],this.origin[0],q)||!k(a.origin[1],this.origin[1],q))return!1;q=.5*n/Math.pow(2,c)/Math.max(this.pixelSize[0],this.pixelSize[1])*12;return k(n,a.levels[c].resolution,q)},rootTilesInExtent:function(a,b,c){var l=this.levels[0].tileSize;f.computeRowColExtent(a,l,this.origin,n);a=n[1];var k=n[3],q=n[0],t=n[2],r=t-
q,y=k-a;r*y>c&&(c=Math.floor(Math.sqrt(c)),y>c&&(a=a+Math.floor(.5*y)-Math.floor(.5*c),k=a+c),r>c&&(q=q+Math.floor(.5*r)-Math.floor(.5*c),t=q+c));c=Array((t-q)*(k-a));r=0;for(y=a;y<k;y++)for(var p=q;p<t;p++)c[r++]=[0,y,p];b&&(b[0]=this.origin[0]+q*l[0],b[1]=this.origin[1]-k*l[1],b[2]=this.origin[0]+t*l[0],b[3]=this.origin[1]-a*l[1]);return c}};f.computeRowColExtent=function(a,b,c,f){var l=.001*(a[2]-a[0]+(a[3]-a[1]));f[0]=Math.floor((a[0]+l-c[0])/b[0]);f[2]=Math.ceil((a[2]-l-c[0])/b[0]);f[1]=Math.floor((c[1]-
a[3]+l)/b[1]);f[3]=Math.ceil((c[1]-a[1]-l)/b[1])};f.isPowerOfTwo=function(a){a=a.lods;var c=a[0].resolution*Math.pow(2,a[0].level);return!a.some(function(a){return!b.floatEqualRelative(a.resolution,c/Math.pow(2,a.level))})};f.hasGapInLevels=function(a){a=a.lods.map(function(a){return a.level});a.sort(function(a,b){return a-b});for(var b=1;b<a.length;b++)if(a[b]!==a[0]+b)return!0;return!1};f.tileSizeSupported=function(a){var b=a.size[1];return b===a.size[0]&&0===(b&b-1)&&128<=b&&512>=b};f._checkUnsupported=
function(a){return a?1>a.lods.length?new x("tilingscheme:generic","Tiling scheme must have at least one level"):f.isPowerOfTwo(a)?null:new x("tilingscheme:power-of-two","Tiling scheme must be power of two"):new x("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")};f.checkUnsupported=function(a){var b=f._checkUnsupported(a);return b?b:f.hasGapInLevels(a)?new x("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):f.tileSizeSupported(a)?
null:new x("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]")};f.fromExtent=function(a,b){var c=a[2]-a[0],l=a[3]-a[1],n=k.getMetersPerUnitForSR(b),q=1.2*Math.max(c,l);a=new f({size:[256,256],origin:{x:a[0]-.5*(q-c),y:a[3]+.5*(q-l)},lods:[{level:0,resolution:q/256,scale:1/(256/96*.0254/(q*n))}],spatialReference:b});a.ensureMaxLod(20);return a};f.WebMercatorAuxiliarySphereTileInfo={size:[256,256],origin:{x:-2.0037508342787E7,y:2.0037508342787E7},spatialReference:r.WebMercator,
lods:[{level:0,resolution:156543.03392800014,scale:5.91657527591555E8}]};f.makeWebMercatorAuxiliarySphere=function(a){a=a||19;var b=new f(f.WebMercatorAuxiliarySphereTileInfo);b.ensureMaxLod(a);return b};f.WebMercatorAuxiliarySphere=f.makeWebMercatorAuxiliarySphere(19);f.makeWGS84WithTileSize=function(a,b){b=b||16;var c=256/a;a=new f({size:[a,a],origin:{x:-180,y:90},spatialReference:r.WGS84,lods:[{level:0,resolution:.703125*c,scale:2.95497598570834E8*c}]});a.ensureMaxLod(b);return a};return f})},
"esri/views/3d/terrain/TerrainConst":function(){define(["require","exports","./TilingScheme","../support/aaBoundingRect"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});(function(a){a[a.MAP=0]="MAP";a[a.ELEVATION=1]="ELEVATION";a[a.LAYER_CLASS_COUNT=2]="LAYER_CLASS_COUNT"})(r.LayerClass||(r.LayerClass={}));(function(a){a[a.NONE=0]="NONE";a[a.SPLIT=1]="SPLIT";a[a.VSPLITMERGE=2]="VSPLITMERGE";a[a.MERGE=4]="MERGE";a[a.DECODE_ELEVATION=8]="DECODE_ELEVATION";a[a.UPDATE_GEOMETRY=16]=
"UPDATE_GEOMETRY";a[a.UPDATE_TEXTURE=32]="UPDATE_TEXTURE"})(r.TileUpdateTypes||(r.TileUpdateTypes={}));r.TILE_LOADING_DEBUGLOG=!1;r.MAX_ROOT_TILES=64;r.MAX_TILE_TESSELATION=512;r.ELEVATION_NODATA_VALUE=3.40282347E38/10;r.noDataValueOpt={noDataValue:r.ELEVATION_NODATA_VALUE};r.ELEVATION_DESIRED_RESOLUTION_LEVEL=4;r.TILEMAP_SIZE_EXP=5;r.TILEMAP_SIZE=1<<r.TILEMAP_SIZE_EXP;r.WEBMERCATOR_WORLD_EXTENT=a.create([0,0,0,0]);k.WebMercatorAuxiliarySphere.getExtent(0,0,0,r.WEBMERCATOR_WORLD_EXTENT);r.GEOGRAPHIC_WORLD_EXTENT=
a.create([-180,-90,180,90]);r.TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR="Cannot extend surface to encompass all layers because it would result in too many root tiles.";r.TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR="Surface extent is too large for tile resolution at level 0.";r.DEFAULT_TILE_BACKGROUND="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA2JJREFUeNrs3d1O20AQgFFvRJInQLQBhHj/h0JVW34El1yQ2F73DVq3jTys55zrqUBbPrErZUSZ+vcOsto4AjK76Lqu1vr8+G3mPzjc3D/+eJj/Bcz/cd75R80fbu79BsAVCAQAAgABgABAACAAEAAIAAQAAgABQPOKfQAy83Ho+HnnHzXv49B4A4AAQAAgABAACAAEAAIAAYAAQAAgABAANM4+AKnZB4ifd/5R8/YB8AYAAYAAQAAgABAACAAEAAIAAYAAQAAgAGicfQBSsw8QP+/8o+btA+ANAAIAAYAAQAAgABAACAAEAAIAAYAAQADQOPsApGYfIH7e+UfN2wfAGwAEAAIAAYAAQAAgABAACAAEAAIAAXA201QdggAggH0AUrMPED8/jsPL03fns/y8fQC8AUAAIAAQAAgABAACAAGAAEAAIAAQAAgAGmcfgNTsA8TP2weImrcPgDcACAAEAAIAAYAAQAAgABAACAAEAAIAAUDj7AOQmn2A+Hn7AFHz9gHwBgABgABAACAAEAAIAAQAAgABgABgNS4cAf9pu9u3O1+m/n2aplKK/0j+TX86/tVP5+eZ3+729gFIfwWyDxA7bx8gat4+ANkJAAGAAEAAIAAQAAgABAACAAGAAEAAIABonn0AUrMPED9vHyBq3j4A3gAgABAACAAEAAIAAYAAQAAgABAA51VrdQgCAAHAsuwDkJp9gPj5vj+9vvx0PsvP2wfAGwAEAAIAAYAAQAAgABAACAAEAAIAAYAAoHH2AUjNPkD8vH2AqHn7AHgDgABAACAAEAAIAAQAAgABgABAACAAEAA0zj4AqdkHiJ+3DxA1bx8AbwAQACQ0DL0AyKuOowBwBYKUSikCIHUBAsAVCAQAAgABgABAALBy9gFIzT5A/Lx9gKj5y6trVyC8AUAAIAAQAAgAVq90Pg5N5gA2AsAVCAQAAgABgABAALB29gFIzT5A/Lx9gKj5q6+3rkB4A4AAQAAgABAACADWzB/IIHsCAsAVCARAlKlWhyAAEAAIABZjH4DU7APEz5+OH2+vT85n+fkvhztXILwBQAAgABAACAAEAGtWigBIHcBGALgCgQBAACAAyPMO9nHosxuHodZx5vB2t691HIdh/nx/Os7/Zsz/fvgXAAAA//8DAF1P1hM2ICMfAAAAAElFTkSuQmCC"})},
"esri/views/3d/terrain/terrainUtilsSpherical":function(){define(["require","exports","./TilingScheme","../../../core/Error"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.autoUpdateSkirtsVisibility=function(a,c){};r.checkIfTileInfoSupportedForViewSR=function(b,c,t){c=b.lods.length-1;if(b.spatialReference.isWebMercator){if(!k.makeWebMercatorAuxiliarySphere(c).compatibleWith(b))return new a("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else if(b.spatialReference.isWGS84){if(!k.makeWGS84WithTileSize(b.size[1],
c).compatibleWith(b))return new a("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme")}else return new a("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(t&&!b.spatialReference.equals(t))return new a("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}})},"esri/layers/BaseTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../request ../core/Error ../geometry/Extent ../geometry/SpatialReference ./Layer ./mixins/ScaleRangeLayer ./support/TileInfo ../core/accessorSupport/decorators ./mixins/RefreshableLayer dojo/_base/lang".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){var w={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(f){function q(){var a=null!==f&&f.apply(this,arguments)||this;a.tileInfo=l.create({spatialReference:n.WebMercator,size:256});a.type="base-tile";a.fullExtent=new t(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,n.WebMercator);a.spatialReference=n.WebMercator;return a}k(q,f);q.prototype.getTileBounds=function(a,b,c,f){f=f||[0,0,0,0];w.level=a;w.row=b;w.col=c;w.extent=f;this.tileInfo.updateTileInfo(w);
w.extent=null;return f};q.prototype.getTileUrl=function(a,b,f){throw new c("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented");};q.prototype.fetchTile=function(a,c,f,l){a=this.getTileUrl(a,c,f);var n={responseType:"image"};l&&l.timestamp&&(n.query={_ts:l.timestamp});return"string"===typeof a?b(a,v.mixin({allowImageDataAccess:l&&l.allowImageDataAccess||!1},n)).then(function(a){return a.data}):a.then(function(a){return b(a,n)}).then(function(a){return a.data})};a([y.shared({"2d":"../views/2d/layers/TiledLayerView2D",
"3d":"../views/3d/layers/TileLayerView3D"})],q.prototype,"viewModulePaths",void 0);a([y.property({type:l})],q.prototype,"tileInfo",void 0);a([y.property({readOnly:!0,value:"base-tile"})],q.prototype,"type",void 0);a([y.property()],q.prototype,"fullExtent",void 0);a([y.property()],q.prototype,"spatialReference",void 0);return q=a([y.subclass("esri.layers.BaseTileLayer")],q)}(y.declared(f,B,q))})},"esri/layers/BaseElevationLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/Error ../geometry/Extent ../geometry/SpatialReference ./Layer ./support/TileInfo ../core/accessorSupport/decorators".split(" "),
function(x,r,k,a,b,c,t,n,f,q){var l={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(n){function r(){var a=null!==n&&n.apply(this,arguments)||this;a.tileInfo=f.create({spatialReference:t.WebMercator,size:256});a.fullExtent=new c(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,t.WebMercator);a.spatialReference=t.WebMercator;a.type="base-elevation";return a}k(r,n);r.prototype.getTileBounds=function(a,b,c,f){f=f||[0,0,0,0];l.level=a;l.row=b;l.col=c;l.extent=f;this.tileInfo.updateTileInfo(l);
l.extent=null;return f};r.prototype.fetchTile=function(a,c,f,l){throw new b("BaseElevationLayer:fetchtile-not-implemented","fetchTile() is not implemented");};a([q.shared({"3d":"../views/3d/layers/ElevationLayerView3D"})],r.prototype,"viewModulePaths",void 0);a([q.property({type:f})],r.prototype,"tileInfo",void 0);a([q.property()],r.prototype,"fullExtent",void 0);a([q.property()],r.prototype,"spatialReference",void 0);a([q.property({readOnly:!0,value:"base-elevation"})],r.prototype,"type",void 0);
return r=a([q.subclass("esri.layers.BaseElevationLayer")],r)}(q.declared(n))})},"esri/layers/VectorTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../core/accessorSupport/decorators ../core/Error ../core/MultiOriginJSONSupport ../core/urlUtils ../core/promiseUtils ../core/lang ../request ../geometry/Extent ../geometry/SpatialReference ../portal/support/jsonContext ./TiledLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./mixins/ArcGISCachedService ./support/TileInfo ./support/vectorTileLayerLoader ../views/vectorTiles/style/StyleRepository ../views/vectorTiles/SchemaHelper".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K){return function(n){function p(a,b){a=n.call(this)||this;a.currentStyleInfo=null;a.fullExtent=null;a.style=null;a.operationalLayerType="VectorTileLayer";a.tileInfo=null;a.type="vector-tile";a.url=null;return a}k(p,n);p.prototype.normalizeCtorArgs=function(a,c){return"string"===typeof a?b.mixin({},{url:a},c):a};p.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1}).then(function(){if(a.portalItem&&
a.portalItem.id){var b=a.portalItem.itemUrl+"/resources/styles/root.json";return y(b,{query:{f:"json"}}).then(function(c){c.data&&a.read({url:b},w.createForItem(a.portalItem))})}}).always(function(){return a.loadStyle()});this.addResolvingPromise(b);return this.when()};Object.defineProperty(p.prototype,"attributionDataUrl",{get:function(){var a=this.currentStyleInfo;return(a=a&&a.serviceUrl&&f.urlToObject(a.serviceUrl))?this._getDefaultAttribution(a.path):null},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,
"serviceUrl",{get:function(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"spatialReference",{get:function(){return this.tileInfo&&this.tileInfo.spatialReference||null},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"styleUrl",{get:function(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null},enumerable:!0,configurable:!0});p.prototype.writeStyleUrl=function(a,b){a&&f.isProtocolRelative(a)&&
(a="https:"+a);a&&!l.endsWith(a,"root.json")&&(a=f.join(a,"root.json"));b.styleUrl=a};p.prototype.readTileIndexType=function(a,b){return b.type};p.prototype.readTileIndexUrl=function(a,b){return f.join(this.serviceUrl,b.tileMap)};p.prototype.readTileServers=function(a,b){var c=this;a=b.tiles;this.serviceUrl&&a.forEach(function(a,b,l){l[b]=f.join(c.serviceUrl,a)});return a};p.prototype.readVersion=function(a,b){return b.version?parseFloat(b.version):parseFloat(b.currentVersion)};p.prototype.readCompatibleTileInfo256=
function(a,b){return A.fromJSON(K.create256x256CompatibleTileInfo(b.tileInfo))};p.prototype.readCompatibleTileInfo512=function(a,b){return A.fromJSON(K.create512x512CompatibleTileInfo(b.tileInfo))};p.prototype.loadStyle=function(a){a=a||this.style||this.url;if(this._loadingPromise&&"string"===typeof a&&this.url===a)return this._loadingPromise;var b=this._loadingPromise;this._loadingPromise=this._getSourceAndStyle(a);b&&!b.isFulfilled()&&b.cancel();return this._loadingPromise};p.prototype.getTileUrl=
function(a,b,c){var f=this.tileServers[b%this.tileServers.length];return f=f.replace(/\{z\}/gi,a.toString()).replace(/\{y\}/gi,b.toString()).replace(/\{x\}/gi,c.toString())};p.prototype.write=function(a,b){return b&&b.origin&&!this.styleUrl?(b.messages&&b.messages.push(new t("vectortilelayer:unsupported","VectorTileLayer ("+this.title+", "+this.id+") with style defined by JSON only are not supported",{layer:this})),null):this.inherited(arguments,[a,b])};p.prototype._getSourceAndStyle=function(a){var b=
this;return a?J.loadMetadata(a).then(function(c){b._set("currentStyleInfo",{serviceUrl:c.serviceUrl,styleUrl:c.styleUrl,spriteUrl:c.spriteUrl,glyphsUrl:c.glyphsUrl,style:c.style,layerDefinition:c.layerDefinition});"string"===typeof a?(b.url=a,b.style=null):(b.url=null,b.style=a);b._set("styleRepository",new I(c.style,c));b.read(c.layerDefinition)}):q.reject(Error("invalid style!"))};p.prototype._getDefaultAttribution=function(a){var b=a.match(/^https?:\/\/(basemaps|basemapsbeta|basemapsdev)\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i);
if(b&&(a=b[3]&&b[3].toLowerCase()))for(var b=b[2]||"",c=0,l=["World_Basemap","World_Basemap_v2","World_Basemap_GCS_v2","World_Basemap_WGS84"];c<l.length;c++){var n=l[c];if(-1<n.toLowerCase().indexOf(a))return f.normalize("//static.arcgis.com/attribution/Vector"+b+"/"+n)}};a([c.shared({"2d":"../views/2d/layers/VectorTileLayerView2D","3d":"../views/3d/layers/VectorTileLayerView3D"})],p.prototype,"viewModulePaths",void 0);a([c.property({readOnly:!0,dependsOn:["currentStyleInfo"]})],p.prototype,"attributionDataUrl",
null);a([c.property({readOnly:!0})],p.prototype,"currentStyleInfo",void 0);a([c.property({type:B,readOnly:!0})],p.prototype,"fullExtent",void 0);a([c.property()],p.prototype,"style",void 0);a([c.property({readOnly:!0,dependsOn:["currentStyleInfo"]})],p.prototype,"serviceUrl",null);a([c.property({type:v,dependsOn:["tileInfo"],readOnly:!0})],p.prototype,"spatialReference",null);a([c.property({readOnly:!0})],p.prototype,"styleRepository",void 0);a([c.property({type:String,readOnly:!0,dependsOn:["currentStyleInfo"],
json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null);a([c.writer(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null);a([c.property({readOnly:!0})],p.prototype,"tileIndexType",void 0);a([c.reader("tileIndexType",["tileIndexType","type"])],p.prototype,"readTileIndexType",null);a([c.property({readOnly:!0})],p.prototype,"tileIndexUrl",void 0);a([c.reader("tileIndexUrl",["tileIndexUrl","tileMap"])],p.prototype,
"readTileIndexUrl",null);a([c.property({readOnly:!0,type:A})],p.prototype,"tileInfo",void 0);a([c.property({readOnly:!0})],p.prototype,"tileServers",void 0);a([c.reader("tileServers",["tiles"])],p.prototype,"readTileServers",null);a([c.property({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0);a([c.property({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0);a([c.property({readOnly:!0})],
p.prototype,"version",void 0);a([c.reader("version",["version","currentVersion"])],p.prototype,"readVersion",null);a([c.property({readOnly:!0})],p.prototype,"compatibleTileInfo256",void 0);a([c.reader("compatibleTileInfo256",["tileInfo"])],p.prototype,"readCompatibleTileInfo256",null);a([c.property({readOnly:!0})],p.prototype,"compatibleTileInfo512",void 0);a([c.reader("compatibleTileInfo512",["tileInfo"])],p.prototype,"readCompatibleTileInfo512",null);return p=a([c.subclass("esri.layers.VectorTileLayer")],
p)}(c.declared(D,F,G,p,n,z))})},"esri/portal/support/jsonContext":function(){define(["require","exports","../Portal","../../core/urlUtils"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.createForItem=function(b){return{origin:"portal-item",url:a.urlToObject(b.itemUrl),portal:b.portal||k.getDefault()}}})},"esri/layers/support/vectorTileLayerLoader":function(){define("require exports dojo/has dojo/_base/lang ../../core/promiseUtils ../../core/urlUtils ../../config ../../request".split(" "),
function(x,r,k,a,b,c,t,n){function f(a){if(a){var b=c.getOrigin(a);c.canUseXhr(b)||-1!==w.indexOf(b)||w.push(b);return a}}function q(a,b,f){if(null!=b.sources){f&&-1!==f.path.indexOf("root.json")&&(f.path=f.path.substr(0,f.path.indexOf("root.json")),a.styleUrl=f.path);var n=B(b,f),k=b.sprite||null,q=b.glyphs||null;if(n=f&&f.path||n&&n.url)b.sprite&&!c.isAbsolute(b.sprite)&&(k=c.normalize(c.join(n,b.sprite))),b.glyphs&&!c.isAbsolute(b.glyphs)&&(q=c.normalize(c.join(n,b.glyphs)));a.style=b;a.spriteUrl=
k;a.glyphsUrl=q;return y(a,b,f)}if(b.hasOwnProperty("tileInfo"))return a.layerDefinition=b,a.serviceUrl=f.path,l(a,b,f)}function l(a,b,l){b=b.defaultStyles;c.isAbsolute(b)?a.styleUrl=c.normalize(b):a.styleUrl=c.normalize(c.join(l.path,b));f(a.styleUrl);return n(c.join(a.styleUrl,"root.json"),{responseType:"json"}).then(function(b){var f=b.data.sprite||null,l=b.data.glyphs||null;f&&!c.isAbsolute(f)&&(f=c.normalize(c.join(a.styleUrl,f)));l&&!c.isAbsolute(l)&&(l=c.normalize(c.join(a.styleUrl,l)));a.spriteUrl=
f;a.glyphsUrl=l;return a.style=b.data})}function y(a,l,k){(l=B(l,k))||b.reject("Source isn't available in the syle object!");if(l.url)return a.serviceUrl=l.url,c.isAbsolute(a.serviceUrl)||(a.serviceUrl=c.join(k.path,a.serviceUrl)),f(a.serviceUrl),n(a.serviceUrl,{query:{f:"json"},responseType:"json"}).then(function(b){a.layerDefinition=v(b.data);return a});a.layerDefinition=v(l);return b.resolve(a)}function B(a,b){if(!a.sources)return null;var f=a.sources;a=null;if(f.esri)a=f.esri,b&&a.url&&!c.isAbsolute(a.url)&&
(f=b.path.substring(0,b.path.lastIndexOf("/")),a.url=c.join(f,a.url));else{for(var l=0,n=Object.keys(f);l<n.length;l++)if(b=n[l],-1!==b.toLocaleLowerCase().indexOf("street")&&"vector"===a.type){a=f[b];break}if(!a)for(l=0,n=Object.keys(f);l<n.length&&(b=n[l],a=f[b],"vector"!==a.type);l++);}return a}function v(a){if(a.hasOwnProperty("tileInfo"))return a;for(var b={xmin:-2.0037507067161843E7,ymin:-2.0037507067161843E7,xmax:2.0037507067161843E7,ymax:2.0037507067161843E7,spatialReference:{wkid:102100}},
c=(b.xmax-b.xmin)/512,l=[],n=a.hasOwnProperty("minzoom")?parseFloat(a.minzoom):0,k=a.hasOwnProperty("maxzoom")?parseFloat(a.maxzoom):16;n<k;n++){var q=c/Math.pow(2,n);l.push({level:n,scale:Math.floor(3779.527559055118*q),resolution:q})}a.tiles.forEach(f);return{capabilities:"TilesOnly",initialExtent:b,fullExtent:b,minScale:l[0].scale,maxScale:l[l.length-1].scale,tiles:a.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-2.0037508342787E7,y:2.0037508342787E7},lods:l,spatialReference:{wkid:102100}}}}
Object.defineProperty(r,"__esModule",{value:!0});var w=t.defaults&&t.defaults.io.corsEnabledServers||t.request.corsEnabledServers;r.loadMetadata=function(l){if(!l)return b.reject("invalid input URL!");var k={layerDefinition:null,parsedUrl:null,serviceUrl:null,style:null,styleUrl:null,url:null,spriteUrl:null,glyphsUrl:null};if("string"!==typeof l)return q(k,l,null).then(function(){return k});l=k.url=c.normalize(l);var t=k.parsedUrl=c.urlToObject(l);f(l);return n(t.path,{responseType:"json",query:a.mixin({f:"json"},
t.query)}).then(function(a){return q(k,a.data,t)}).then(function(){return k})}})},"esri/views/vectorTiles/style/StyleRepository":function(){define(["require","exports","./StyleLayer","dojo/has"],function(x,r,k,a){return function(){function b(c,k){this.styleJSON=c;this.version=parseFloat(c.version);this.sprite=k?k.spriteUrl:c.sprite;this.glyphs=k?k.glyphsUrl:c.glyphs;if(a("stable-symbol-rendering")){var n=(c.layers||[]).filter(function(a){return a.layout&&a.layout["text-font"]})[0];n&&(c.layers||[]).forEach(function(a){a.layout&&
a.layout["text-font"]&&(a.layout["text-font"]=n.layout["text-font"])})}this.layers=(c.layers||[]).map(b._create);this._identifyRefLayers()}b.prototype._identifyRefLayers=function(){for(var a=[],b=[],n=0,f=0,k=this.layers;f<k.length;f++){var l=k[f];if(1===l.type){var r=l,B=l.sourceLayer,B=B+("|"+JSON.stringify(l.minzoom)),B=B+("|"+JSON.stringify(l.maxzoom)),B=B+("|"+JSON.stringify(l.filter));if(r.hasDataDrivenFill||r.hasDataDrivenOutline)B+="|"+JSON.stringify(n);a.push({key:B,layer:l})}2===l.type&&
(r=l,B=l.sourceLayer,B+="|"+JSON.stringify(l.minzoom),B+="|"+JSON.stringify(l.maxzoom),B+="|"+JSON.stringify(l.filter),B+="|"+JSON.stringify(l.layout&&l.layout["line-cap"]),B+="|"+JSON.stringify(l.layout&&l.layout["line-join"]),r.hasDataDrivenLine&&(B+="|"+JSON.stringify(n)),b.push({key:B,layer:l}));++n}this._assignRefLayers(a);this._assignRefLayers(b)};b.prototype._assignRefLayers=function(a){a.sort(function(a,b){return a.key<b.key?-1:a.key>b.key?1:0});for(var b,c,f=a.length,k=0;k<f;k++){var l=a[k];
if(l.key===b)l.layer.refLayerId=c;else if(b=l.key,c=l.layer.id,1===l.layer.type&&!l.layer.getPaintProperty("fill-outline-color"))for(var r=k+1;r<f;r++){var B=a[r];if(B.key===b){if(B.layer.getPaintProperty("fill-outline-color")){a[k]=B;a[r]=l;c=B.layer.id;break}}else break}}};b._create=function(a,b,n){b=1-1/(n.length+1)*(1+b);switch(a.type){case "background":return new k.BackgroundStyleLayer(0,a,b);case "fill":return new k.FillStyleLayer(1,a,b);case "line":return new k.LineStyleLayer(2,a,b);case "symbol":return new k.SymbolStyleLayer(3,
a,b);case "raster":throw Error("Unsupported vector tile raster layer");case "circle":throw Error("Unsupported vector tile circle layer");}throw Error("Unknown vector tile layer");};return b}()})},"esri/views/vectorTiles/style/StyleLayer":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ./StyleDefinition ./StyleProperty ./Filter".split(" "),function(x,r,k,a,b,c,t){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function a(a,
c,l){this.type=a;this.id=c.id;this.source=c.source;this.sourceLayer=c["source-layer"];this.minzoom=c.minzoom;this.maxzoom=c.maxzoom;this.filter=c.filter;this.layout=c.layout;this.paint=c.paint;this.z=l;switch(a){case 0:this._layoutDefinition=b.StyleDefinition.backgroundLayoutDefinition;this._paintDefinition=b.StyleDefinition.backgroundPaintDefinition;break;case 1:this._layoutDefinition=b.StyleDefinition.fillLayoutDefinition;this._paintDefinition=b.StyleDefinition.fillPaintDefinition;break;case 2:this._layoutDefinition=
b.StyleDefinition.lineLayoutDefinition;this._paintDefinition=b.StyleDefinition.linePaintDefinition;break;case 3:this._layoutDefinition=b.StyleDefinition.symbolLayoutDefinition,this._paintDefinition=b.StyleDefinition.symbolPaintDefinition}this._layoutProperties=this._parseLayout(this.layout);this._paintProperties=this._parsePaint(this.paint)}a.prototype.getFeatureFilter=function(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=t.createFilter(this.filter)};a.prototype.getLayoutProperty=
function(a){var b=this._layoutProperties;if(b)return b[a]};a.prototype.getPaintProperty=function(a){var b=this._paintProperties;if(b)return b[a]};a.prototype.getLayoutValue=function(a,b,c){var f,l=this._layoutProperties;l&&(l=l[a])&&(f=l.getValue(b,c));a=this._layoutDefinition[a];void 0===f&&(f=a["default"]);"enum"===a.type&&(f=a.values.indexOf(f));return f};a.prototype.getPaintValue=function(a,b,c){var f,l=this._paintProperties;l&&(l=l[a])&&(f=l.getValue(b,c));a=this._paintDefinition[a];void 0===
f&&(f=a["default"]);"enum"===a.type&&(f=a.values.indexOf(f));return f};a.prototype._parseLayout=function(a){var b={},f;for(f in a){var n=this._layoutDefinition[f];n&&(b[f]=new c(f,n,a[f]))}return b};a.prototype._parsePaint=function(a){var b={},f;for(f in a){var n=this._paintDefinition[f];n&&(b[f]=new c(f,n,a[f]))}return b};return a}();r.StyleLayer=x;a=function(a){function b(b,c,f){return a.call(this,b,c,f)||this}k(b,a);return b}(x);r.BackgroundStyleLayer=a;a=function(a){function b(b,c,f){b=a.call(this,
b,c,f)||this;b.hasDataDrivenFill=!1;(c=b.getPaintProperty("fill-color"))&&c.isDataDriven&&(b.hasDataDrivenFill=!0);(f=b.getPaintProperty("fill-opacity"))&&f.isDataDriven&&(b.hasDataDrivenFill=!0);b.hasDataDrivenOutline=!1;(f=b.getPaintProperty("fill-outline-color"))&&f.isDataDriven&&(b.hasDataDrivenOutline=!0);!f&&c&&c.isDataDriven&&(b.hasDataDrivenOutline=!0);return b}k(b,a);return b}(x);r.FillStyleLayer=a;a=function(a){function b(b,c,f){b=a.call(this,b,c,f)||this;b.hasDataDrivenLine=!1;(c=b.getPaintProperty("line-color"))&&
c.isDataDriven&&(b.hasDataDrivenLine=!0);(c=b.getPaintProperty("line-opacity"))&&c.isDataDriven&&(b.hasDataDrivenLine=!0);(c=b.getPaintProperty("line-width"))&&c.isDataDriven&&(b.hasDataDrivenLine=!0);return b}k(b,a);return b}(x);r.LineStyleLayer=a;x=function(a){function b(b,c,f){b=a.call(this,b,c,f)||this;b.hasDataDrivenIcon=!1;(c=b.getPaintProperty("icon-color"))&&c.isDataDriven&&(b.hasDataDrivenIcon=!0);(c=b.getPaintProperty("icon-opacity"))&&c.isDataDriven&&(b.hasDataDrivenIcon=!0);(c=b.getLayoutProperty("icon-size"))&&
c.isDataDriven&&(b.hasDataDrivenIcon=!0);b.hasDataDrivenText=!1;(c=b.getPaintProperty("text-color"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);(c=b.getPaintProperty("text-opacity"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);(c=b.getLayoutProperty("text-size"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);return b}k(b,a);return b}(x);r.SymbolStyleLayer=x;x=function(){return function(a,b,c){this.cap=a.getLayoutValue("line-cap",b,c);this.join=a.getLayoutValue("line-join",b,c);this.miterLimit=a.getLayoutValue("line-miter-limit",
b,c);this.roundLimit=a.getLayoutValue("line-round-limit",b,c)}}();r.LineLayout=x;x=function(){return function(a,b,c,l){this.allowOverlap=a.getLayoutValue("icon-allow-overlap",b,l);this.ignorePlacement=a.getLayoutValue("icon-ignore-placement",b,l);this.optional=a.getLayoutValue("icon-optional",b,l);this.rotationAlignment=a.getLayoutValue("icon-rotation-alignment",b,l);this.size=a.getLayoutValue("icon-size",b,l);this.rotate=a.getLayoutValue("icon-rotate",b,l);this.padding=a.getLayoutValue("icon-padding",
b,l);this.keepUpright=a.getLayoutValue("icon-keep-upright",b,l);this.offset=a.getLayoutValue("icon-offset",b,l);2===this.rotationAlignment&&(this.rotationAlignment=c?0:1)}}();r.IconLayout=x;x=function(){return function(a,b,c,l){this.allowOverlap=a.getLayoutValue("text-allow-overlap",b,l);this.ignorePlacement=a.getLayoutValue("text-ignore-placement",b,l);this.optional=a.getLayoutValue("text-optional",b,l);this.rotationAlignment=a.getLayoutValue("text-rotation-alignment",b,l);this.fontArray=a.getLayoutValue("text-font",
b,l);this.maxWidth=a.getLayoutValue("text-max-width",b,l);this.lineHeight=a.getLayoutValue("text-line-height",b,l);this.letterSpacing=a.getLayoutValue("text-letter-spacing",b,l);this.justify=a.getLayoutValue("text-justify",b,l);this.anchor=a.getLayoutValue("text-anchor",b,l);this.maxAngle=a.getLayoutValue("text-max-angle",b,l);this.size=a.getLayoutValue("text-size",b,l);this.rotate=a.getLayoutValue("text-rotate",b,l);this.padding=a.getLayoutValue("text-padding",b,l);this.keepUpright=a.getLayoutValue("text-keep-upright",
b,l);this.transform=a.getLayoutValue("text-transform",b,l);this.offset=a.getLayoutValue("text-offset",b,l);2===this.rotationAlignment&&(this.rotationAlignment=c?0:1)}}();r.TextLayout=x})},"esri/views/vectorTiles/style/StyleDefinition":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function k(){}k.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};k.fillLayoutDefinition={visibility:{type:"enum",
values:["visible","none"],"default":"visible"}};k.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"line-cap":{type:"enum",values:["butt","round","square"],"default":"butt"},"line-join":{type:"enum",values:["bevel","round","miter"],"default":"miter"},"line-miter-limit":{type:"number","default":2},"line-round-limit":{type:"number","default":1.05}};k.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"symbol-placement":{type:"enum",
values:["point","line"],"default":"point"},"symbol-spacing":{type:"number",minimum:1,"default":250},"symbol-avoid-edges":{type:"boolean","default":!1},"icon-image":{type:"string"},"icon-allow-overlap":{type:"boolean","default":!1},"icon-ignore-placement":{type:"boolean","default":!1},"icon-optional":{type:"boolean","default":!1},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"icon-size":{type:"number",minimum:0,"default":1},"icon-rotate":{type:"number","default":0},
"icon-padding":{type:"number",minimum:0,"default":2},"icon-keep-upright":{type:"boolean","default":!1},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-field":{type:"string"},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"text-font":{type:"array",value:"string","default":["Open Sans Regular","Arial Unicode MS Regular"]},"text-size":{type:"number",minimum:0,"default":16},"text-max-width":{type:"number",minimum:0,"default":10},"text-line-height":{type:"number",
"default":1.2},"text-letter-spacing":{type:"number","default":0},"text-justify":{type:"enum",values:["left","center","right"],"default":"center"},"text-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),"default":"center"},"text-max-angle":{type:"number",minimum:0,"default":45},"text-rotate":{type:"number","default":0},"text-padding":{type:"number",minimum:0,"default":2},"text-keep-upright":{type:"boolean","default":!0},"text-transform":{type:"enum",
values:["none","uppercase","lowercase"],"default":"none"},"text-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-allow-overlap":{type:"boolean","default":!1},"text-ignore-placement":{type:"boolean","default":!1},"text-optional":{type:"boolean","default":!1}};k.backgroundPaintDefinition={"background-opacity":{type:"number",minimum:0,maximum:1,"default":1},"background-color":{type:"color","default":[0,0,0,1]},"background-pattern":{type:"string"}};k.fillPaintDefinition={"fill-opacity":{type:"number",
minimum:0,maximum:1,"default":1},"fill-antialias":{type:"boolean","default":!0},"fill-color":{type:"color","default":[0,0,0,1]},"fill-outline-color":{type:"color","default":[0,0,0,0]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"fill-pattern":{type:"string"}};k.linePaintDefinition={"line-opacity":{type:"number",minimum:0,maximum:1,"default":1},"line-color":{type:"color","default":[0,0,0,1]},
"line-translate":{type:"array",value:"number",length:2,"default":[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"line-width":{type:"number",minimum:0,"default":1},"line-gap-width":{type:"number",minimum:0,"default":0},"line-offset":{type:"number","default":0},"line-blur":{type:"number",minimum:0,"default":0},"line-dasharray":{type:"array",value:"number","default":[]},"line-pattern":{type:"string"}};k.symbolPaintDefinition={"icon-opacity":{type:"number",minimum:0,
maximum:1,"default":1},"icon-color":{type:"color","default":[0,0,0,1]},"icon-halo-color":{type:"color","default":[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,"default":0},"icon-halo-blur":{type:"number",minimum:0,"default":0},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"text-opacity":{type:"number",minimum:0,maximum:1,"default":1},"text-color":{type:"color","default":[0,0,0,1]},"text-halo-color":{type:"color",
"default":[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,"default":0},"text-halo-blur":{type:"number",minimum:0,"default":0},"text-translate":{type:"array",value:"number",length:2,"default":[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"}};k.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,"default":1},"raster-hue-rotate":{type:"number","default":0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,"default":0},"raster-brightness-max":{type:"number",
minimum:0,maximum:1,"default":1},"raster-saturation":{type:"number",minimum:-1,maximum:1,"default":0},"raster-contrast":{type:"number",minimum:-1,maximum:1,"default":0},"raster-fade-duration":{type:"number",minimum:0,"default":300}};k.circlePaintDefinition={"circle-opacity":{type:"number",minimum:0,maximum:1,"default":1},"circle-radius":{type:"number",minimum:0,"default":5},"circle-color":{type:"color","default":[0,0,0,1]},"circle-blur":{type:"number",minimum:0,"default":0},"circle-translate":{type:"array",
value:"number",length:2,"default":[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"}};return k}();r.StyleDefinition=x})},"esri/views/vectorTiles/style/StyleProperty":function(){define(["require","exports","../../../Color","../GeometryUtils"],function(x,r,k,a){return function(){function b(a,k,n){this.isDataDriven=!1;switch(k.type){case "number":a=!0;break;case "color":a=!0;n=b._parseColor(n);break;case "array":a="number"===k.value;break;default:a=!1}var c=n.stops&&
0<n.stops.length;if(this.isDataDriven=!!n.property)if(c)switch(n.type){case "identity":this.getValue=this._buildIdentity(n,k);break;case "categorical":this.getValue=this._buildCategorical(n,k);break;default:a&&"interval"===n.type&&(a=!1),this.getValue=a?this._buildInterpolate(n,k):this._buildInterval(n,k)}else this.getValue=this._buildIdentity(n,k);else this.getValue=c?a?this._buildZoomInterpolate(n):this._buildZoomInterval(n):this._buildSimple(n)}b.prototype._buildSimple=function(a){return function(){return a}};
b.prototype._buildIdentity=function(a,k){return function(c,f){var n;f&&(n=f.values[a.property],"color"===k.type&&(n=b._parseColor(n)));return void 0!==n?n:void 0!==a.default?a.default:k.default}};b.prototype._buildCategorical=function(a,b){var c=this;return function(f,n){var l;n&&(l=n.values[a.property]);l=c._categorical(l,a.stops);return void 0!==l?l:void 0!==a.default?a.default:b.default}};b.prototype._buildInterval=function(a,b){var c=this;return function(f,n){var l;n&&(l=n.values[a.property]);
return"number"===typeof l?c._interval(l,a.stops):void 0!==a.default?a.default:b.default}};b.prototype._buildInterpolate=function(a,b){var c=this;return function(f,n){var l;n&&(l=n.values[a.property]);return"number"===typeof l?c._interpolate(l,a.stops,a.base||1):void 0!==a.default?a.default:b.default}};b.prototype._buildZoomInterpolate=function(a){var b=this;return function(c){return b._interpolate(c,a.stops,a.base||1)}};b.prototype._buildZoomInterval=function(a){var b=this;return function(c){return b._interval(c,
a.stops)}};b.prototype._categorical=function(a,b){for(var c=b.length,f=0;f<c;f++)if(b[f][0]===a)return b[f][1]};b.prototype._interval=function(a,b){for(var c=b.length,f=0,k=0;k<c;k++)if(b[k][0]<=a)f=k;else break;return b[f][1]};b.prototype._interpolate=function(b,k,n){for(var c,q,l=k.length,t=0;t<l;t++){var r=k[t];if(r[0]<=b)c=r;else{q=r;break}}if(c&&q){t=q[0]-c[0];b-=c[0];n=1===n?b/t:(Math.pow(n,b)-1)/(Math.pow(n,t)-1);if(Array.isArray(c[1])){c=c[1];q=q[1];b=[];for(t=0;t<c.length;t++)b.push(a.interpolate(c[t],
q[t],n));return b}return a.interpolate(c[1],q[1],n)}if(c)return c[1];if(q)return q[1]};b._isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};b._parseColor=function(a){if(Array.isArray(a))return a;if("string"===typeof a){if(a=new k(a),!this._isEmpty(a))return k.toUnitRGBA(a)}else return a&&a.default&&(a.default=b._parseColor(a.default)),a&&a.stops&&(a.stops=a.stops.map(function(a){return[a[0],b._parseColor(a[1])]})),a};return b}()})},"esri/views/vectorTiles/GeometryUtils":function(){define(["require",
"exports"],function(x,r){function k(a,c){a%=c;return 0<=a?a:a+c}Object.defineProperty(r,"__esModule",{value:!0});r.C_INFINITY=Number.POSITIVE_INFINITY;r.C_PI=Math.PI;r.C_2PI=2*r.C_PI;r.C_PI_BY_2=r.C_PI/2;r.C_RAD_TO_256=128/r.C_PI;r.C_256_TO_RAD=r.C_PI/128;r.C_DEG_TO_256=256/360;r.C_DEG_TO_RAD=r.C_PI/180;r.C_SQRT2=1.414213562;r.C_SQRT2_INV=1/r.C_SQRT2;var a=1/Math.LN2;r.positiveMod=k;r.radToByte=function(a){return k(a*r.C_RAD_TO_256,256)};r.degToByte=function(a){return k(a*r.C_DEG_TO_256,256)};r.log2=
function(b){return Math.log(b)*a};r.sqr=function(a){return a*a};r.clamp=function(a,c,k){return Math.min(Math.max(a,c),k)};r.interpolate=function(a,c,k){return a*(1-k)+c*k};r.between=function(a,c,k){return a>=c&&a<=k||a>=k&&a<=c}})},"esri/views/vectorTiles/style/Filter":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c){this._op=a;"$type"===b?(this._val=c instanceof Array?c.map(function(a){return k._types.indexOf(a)}):k._types.indexOf(c),this._op+=11):(this._key=
b,this._val=c)}k.prototype.filter=function(a){switch(this._op){case 0:return this._val;case 1:return a.values[this._key]===this._val;case 2:return a.values[this._key]!==this._val;case 3:return a.values[this._key]<this._val;case 4:return a.values[this._key]>this._val;case 5:return a.values[this._key]<=this._val;case 6:return a.values[this._key]>=this._val;case 7:return-1!==this._val.indexOf(a.values[this._key]);case 8:return-1===this._val.indexOf(a.values[this._key]);case 9:for(var b=0,c=this._val;b<
c.length;b++){var k=c[b];if(k.filter(a))return!0}return!1;case 10:b=0;for(c=this._val;b<c.length;b++)if(k=c[b],!k.filter(a))return!1;return!0;case 11:b=0;for(c=this._val;b<c.length;b++)if(k=c[b],k.filter(a))return!1;return!0;case 12:return a.type===this._val;case 13:return a.type!==this._val;case 14:return a.type<this._val;case 15:return a.type>this._val;case 16:return a.type>=this._val;case 17:return a.type<=this._val;case 18:return-1!==this._val.indexOf(a.type);case 19:return-1===this._val.indexOf(a.type)}};
k.createFilter=function(a){if(!a)return new k(0,void 0,!0);var b=a[0];if(1>=a.length)return new k(0,void 0,"any"!==b);switch(b){case "\x3d\x3d":return new k(1,a[1],a[2]);case "!\x3d":return new k(2,a[1],a[2]);case "\x3e":return new k(4,a[1],a[2]);case "\x3c":return new k(3,a[1],a[2]);case "\x3e\x3d":return new k(6,a[1],a[2]);case "\x3c\x3d":return new k(5,a[1],a[2]);case "in":return new k(7,a[1],a.slice(2));case "!in":return new k(8,a[1],a.slice(2));case "any":return new k(9,void 0,a.slice(1).map(k.createFilter.bind(this)));
case "all":return new k(10,void 0,a.slice(1).map(k.createFilter.bind(this)));case "none":return new k(11,void 0,a.slice(1).map(k.createFilter.bind(this)));default:throw Error("invalid operator: "+b);}};k._types=["Unknown","Point","LineString","Polygon"];return k}()})},"esri/views/vectorTiles/SchemaHelper":function(){define(["require","exports"],function(x,r){return function(){function k(a,b){this.lockedSchemaPixelSize=a;this.isWGS84=b}k.prototype.getCompatibleLevelRowCol=function(a){var b=a[0],c=
a[1];a=a[2];this.isWGS84?(c>>=1,a>>=1):256===this.lockedSchemaPixelSize&&0<b&&(b--,c>>=1,a>>=1);return[b,c,a]};k.prototype.getSchemaShift=function(a,b){var c=0,k=0;if(256===this.lockedSchemaPixelSize||this.isWGS84)a[2]%2&&(c=2*b),a[1]%2&&(k=2*b);return[c,k]};k.prototype.adjustLevel=function(a){return this.isWGS84?a:256===this.lockedSchemaPixelSize?0<a?a-1:0:a};k.create256x256CompatibleTileInfo=function(a){if(!a)return null;if(256===a.rows&&256===a.cols)return a;for(var b=a.format,c=a.compressionQuality,
k=a.dpi,n=a.origin,f=a.spatialReference,q=4326===f.wkid,l=[],r,B,v=a.lods.length,w=0;w<v;w++){var D=a.lods[w];r=D.scale;B=q?D.resolution:2*D.resolution;l.push({level:D.level,scale:r,resolution:B})}return{rows:256,cols:256,dpi:k,format:b,compressionQuality:c,origin:n,spatialReference:f,lods:l}};k.create512x512CompatibleTileInfo=function(a){if(!a||256===a.rows||256===a.cols)return null;for(var b=a.format,c=a.compressionQuality,k=a.dpi,n=a.origin,f=a.spatialReference,q=[],l,r,B=a.lods.length,v=0;v<B;v++){var w=
a.lods[v];l=w.scale;r=.5*w.resolution;q.push({level:w.level,scale:l,resolution:r})}return{rows:512,cols:512,dpi:k,format:b,compressionQuality:c,origin:n,spatialReference:f,lods:q}};return k}()})},"esri/layers/WMTSLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators dojo/_base/lang ../request ../core/Error ../core/HandleRegistry ../core/Collection ../core/promiseUtils ../geometry/Extent ./Layer ./WebTileLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./support/WMTSSublayer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/wmtsUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z){function A(a,b){return a.map(function(a){var c=new F;c.read(a,b);return c})}var J={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""};return function(p){function r(a,b){var c=p.call(this)||this;c._sublayersHandles=new f;c.copyright=null;c.customParameters=null;c.customLayerParameters=
null;c.fullExtent=null;c.operationalLayerType="WebTiledLayer";c.resourceInfo=null;c.serviceMode="RESTful";c.sublayers=null;c.type="wmts";c.version="1.0.0";c.watch("activeLayer",function(a,b){b&&(b.layer=null);a&&(a.layer=c)},!0);c.watch("sublayers",function(a,b){b&&(b.forEach(function(a){a.layer=null}),c._sublayersHandles.removeAll(),c._sublayersHandles=null);a&&(a.forEach(function(a){a.layer=c}),c._sublayersHandles||(c._sublayersHandles=new f),c._sublayersHandles.add([a.on("after-add",function(a){a.item.layer=
c}),a.on("after-remove",function(a){a.item.layer=null})]))},!0);return c}k(r,p);r.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?c.mixin({},{url:a},b):a};r.prototype.load=function(){var a=this;if("KVP"!==this.serviceMode&&"RESTful"!==this.serviceMode)console.error("WMTS mode could only be 'KVP' or 'RESTful'");else return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]}).then(function(){return a._fetchService()}).otherwise(function(){return l.reject(new n("wmtslayer:unsupported-service-data",
"Invalid response from the WMTS service."))})),this.when()};Object.defineProperty(r.prototype,"activeLayer",{get:function(){return this._get("activeLayer")},set:function(a){this._set("activeLayer",a)},enumerable:!0,configurable:!0});r.prototype.readActiveLayerFromService=function(a,b,c){var f=this,l;this.activeLayer?b.layers.some(function(a){return a.id===f.activeLayer.id?(l=a,!0):!1}):(this.activeLayer=new F,l=b.layers[0]);this.activeLayer.read(l,c);return this.activeLayer};r.prototype.readActiveLayerFromItemOrWebDoc=
function(a,b,c){return new F({id:b.wmtsInfo.layerIdentifier,tileMatrixSetId:b.wmtsInfo.tileMatrixSet})};r.prototype.writeActiveLayer=function(a,b){a=this.activeLayer;b.templateUrl=this.getUrlTemplate(a.id,a.tileMatrixSetId,a.imageFormat,a.styleId);b.wmtsInfo=c.mixin(b.wmtsInfo||{},{layerIdentifier:a.id,tileMatrixSet:a.tileMatrixSetId})};Object.defineProperty(r.prototype,"fullExtents",{get:function(){var a=[];this.activeLayer.tileMatrixSets.forEach(function(b){b.fullExtent&&a.push(b.fullExtent)});
return a},enumerable:!0,configurable:!0});r.prototype.readServiceMode=function(a,b,c){return-1<b.templateUrl.indexOf("?")?"KVP":"RESTful"};r.prototype.readSublayersFromService=function(a,b,c){return A(b.layers,c)};Object.defineProperty(r.prototype,"supportedSpatialReferences",{get:function(){return this.activeLayer.tileMatrixSets.map(function(a){return a.tileInfo.spatialReference}).toArray()},enumerable:!0,configurable:!0});Object.defineProperty(r.prototype,"title",{get:function(){return"Layer"===
this._get("title")?this.activeLayer&&this.activeLayer.title:this._get("title")},set:function(a){this._set("title",a)},enumerable:!0,configurable:!0});Object.defineProperty(r.prototype,"url",{get:function(){return this._get("url")},set:function(a){a&&"/"===a.substr(-1)?this._set("url",a.slice(0,-1)):this._set("url",a)},enumerable:!0,configurable:!0});r.prototype.createWebTileLayer=function(a){var b=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,
this.activeLayer.styleId),c=this._getTileMatrixSetById(a.tileMatrixSetId).tileInfo,f=a.fullExtent;a={layerIdentifier:a.id,tileMatrixSet:a.tileMatrixSetId,url:this.url};this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters);this.customParameters&&(a.customParameters=this.customParameters);return new v({fullExtent:f,urlTemplate:b,tileInfo:c,wmtsInfo:a})};r.prototype.fetchTile=function(a,b,c){a=this.getTileUrl(a,b,c);return t(a,{responseType:"image"}).then(function(a){return a.data})};
r.prototype.findSublayerById=function(a){return this.sublayers.find(function(b){return b.id===a})};r.prototype.getTileUrl=function(a,b,c){var f=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[a],f=f.levelValue?f.levelValue:String(f.level);(a=this.resourceInfo?"":z.getTileUrlFromResourceUrls(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.styleId,a,b,c))||(a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,
this.activeLayer.styleId).replace(/\{level\}/gi,f).replace(/\{row\}/gi,b).replace(/\{col\}/gi,c));return a=this._appendCustomLayerParameters(a)};r.prototype.getUrlTemplate=function(a,b,c,f){var l="";if(!this.resourceInfo&&(l=z.getTileUrlTemplateFromResourceUrls(a,b,c,f)))return l;"KVP"===this.serviceMode?l=this.url+"?SERVICE\x3dWMTS\x26VERSION\x3d"+this.version+"\x26REQUEST\x3dGetTile\x26LAYER\x3d"+a+"\x26STYLE\x3d"+f+"\x26FORMAT\x3d"+c+"\x26TILEMATRIXSET\x3d"+b+"\x26TILEMATRIX\x3d{level}\x26TILEROW\x3d{row}\x26TILECOL\x3d{col}":
"RESTful"===this.serviceMode&&(l="",J[c.toLowerCase()]&&(l=J[c.toLowerCase()]),l=this.url+a+"/"+f+"/"+b+"/{level}/{row}/{col}"+l);return l};r.prototype._fetchService=function(){var a=this;return l.resolve().then(function(){if(a.resourceInfo)return"KVP"===a.resourceInfo.serviceMode&&(a.url+=-1<a.url.indexOf("?")?"":"?"),{ssl:!1,data:a.resourceInfo};var b=a._getCapabilitiesUrl(a.serviceMode);return t(b,{responseType:"text",callbackParamName:"callback"}).otherwise(function(c){b=a._getCapabilitiesUrl("KVP"===
a.serviceMode?"RESTful":"KVP");return t(b,{responseType:"text",callbackParamName:"callback"})})}).then(function(b){b.data=a.resourceInfo?z.parseResourceInfo(b.data):z.parseCapabilities(b.data,{serviceMode:a.serviceMode});b.data&&a.read(b.data,{origin:"service"})})};r.prototype._getTileMatrixSetById=function(a){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find(function(b){return b.id===a})};r.prototype._appendCustomParameters=function(a){if(this.customParameters)for(var b in this.customParameters)a+=
(-1===a.indexOf("?")?"?":"\x26")+b+"\x3d"+encodeURIComponent(this.customParameters[b]);return a};r.prototype._appendCustomLayerParameters=function(a){if(this.customLayerParameters||this.customParameters){var b=c.clone(this.customParameters||{});c.mixin(b,this.customLayerParameters||{});for(var f in b)a+=(-1===a.indexOf("?")?"?":"\x26")+f+"\x3d"+encodeURIComponent(b[f])}return a};r.prototype._getCapabilitiesUrl=function(a){var b;this.url=this.url.split("?")[0];"KVP"===a?b=this.url+"?request\x3dGetCapabilities\x26service\x3dWMTS\x26version\x3d"+
this.version:"RESTful"===a&&(b=this.url+"/"+this.version+"/WMTSCapabilities.xml");return b=this._appendCustomParameters(b)};a([b.shared({"2d":"../views/2d/layers/WMTSLayerView2D","3d":"../views/3d/layers/WMTSLayerView3D"})],r.prototype,"viewModulePaths",void 0);a([b.property({type:F,dependsOn:["sublayers"],json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],r.prototype,"activeLayer",null);a([b.reader("service","activeLayer",["layers"])],r.prototype,"readActiveLayerFromService",null);a([b.reader(["web-document",
"portal-item"],"activeLayer",["wmtsInfo"])],r.prototype,"readActiveLayerFromItemOrWebDoc",null);a([b.writer(["web-document","portal-item"],"activeLayer")],r.prototype,"writeActiveLayer",null);a([b.property()],r.prototype,"copyright",void 0);a([b.property({json:{origins:{"web-document":{read:{source:"wmtsInfo.customParameters"},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:"wmtsInfo.customParameters"},write:{target:"wmtsInfo.customParameters"}}}}})],r.prototype,"customParameters",
void 0);a([b.property({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],r.prototype,"customLayerParameters",void 0);a([b.property({type:y,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],r.prototype,"fullExtent",void 0);a([b.property({readOnly:!0,
dependsOn:["activeLayer"]})],r.prototype,"fullExtents",null);a([b.property()],r.prototype,"operationalLayerType",void 0);a([b.property()],r.prototype,"resourceInfo",void 0);a([b.property()],r.prototype,"serviceMode",void 0);a([b.reader(["portal-item","web-document"],"serviceMode",["templateUrl"])],r.prototype,"readServiceMode",null);a([b.property({type:q.ofType(F)})],r.prototype,"sublayers",void 0);a([b.reader("service","sublayers",["layers"])],r.prototype,"readSublayersFromService",null);a([b.property({readOnly:!0,
dependsOn:["activeLayer"]})],r.prototype,"supportedSpatialReferences",null);a([b.property({dependsOn:["activeLayer"],json:{read:{source:"title"}}})],r.prototype,"title",null);a([b.property({json:{read:!1},readOnly:!0,value:"wmts"})],r.prototype,"type",void 0);a([b.property({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],r.prototype,"url",null);
a([b.property()],r.prototype,"version",void 0);return r=a([b.subclass("esri.layers.WMTSLayer")],r)}(b.declared(B,w,D,G,p))})},"esri/layers/WebTileLayer":function(){define("dojo/_base/lang dojo/_base/url dojo/string ../core/Error ../core/MultiOriginJSONSupport ../core/urlUtils ../geometry/SpatialReference ../geometry/Extent ../geometry/Point ./TiledLayer ./mixins/OperationalLayer ./mixins/ScaleRangeLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./support/TileInfo ./support/LOD".split(" "),function(x,
r,k,a,b,c,t,n,f,q,l,y,B,v,w,D){return q.createSubclass([l,b,y,B,v],{declaredClass:"esri.layers.WebTileLayer",normalizeCtorArgs:function(a,b){return"string"===typeof a?x.mixin({urlTemplate:a},b||{}):a},getDefaults:function(a){var b=new n(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,t.WebMercator);return x.mixin(this.inherited(arguments),{fullExtent:b,tileInfo:new w({size:256,dpi:96,format:"PNG8",compressionQuality:0,origin:new f({x:-2.0037508342787E7,y:2.0037508342787E7,
spatialReference:t.WebMercator}),spatialReference:t.WebMercator,lods:[new D({level:0,scale:5.91657527591555E8,resolution:156543.033928}),new D({level:1,scale:2.95828763795777E8,resolution:78271.5169639999}),new D({level:2,scale:1.47914381897889E8,resolution:39135.7584820001}),new D({level:3,scale:7.3957190948944E7,resolution:19567.8792409999}),new D({level:4,scale:3.6978595474472E7,resolution:9783.93962049996}),new D({level:5,scale:1.8489297737236E7,resolution:4891.96981024998}),new D({level:6,scale:9244648.868618,
resolution:2445.98490512499}),new D({level:7,scale:4622324.434309,resolution:1222.99245256249}),new D({level:8,scale:2311162.217155,resolution:611.49622628138}),new D({level:9,scale:1155581.108577,resolution:305.748113140558}),new D({level:10,scale:577790.554289,resolution:152.874056570411}),new D({level:11,scale:288895.277144,resolution:76.4370282850732}),new D({level:12,scale:144447.638572,resolution:38.2185141425366}),new D({level:13,scale:72223.819286,resolution:19.1092570712683}),new D({level:14,
scale:36111.909643,resolution:9.55462853563415}),new D({level:15,scale:18055.954822,resolution:4.77731426794937}),new D({level:16,scale:9027.977411,resolution:2.38865713397468}),new D({level:17,scale:4513.988705,resolution:1.19432856685505}),new D({level:18,scale:2256.994353,resolution:.597164283559817}),new D({level:19,scale:1128.497176,resolution:.298582141647617})]})})},properties:{copyright:{type:String,value:"",json:{write:!0}},fullExtent:{json:{write:!0}},legendEnabled:{json:{read:{source:["showLegend"],
reader:function(a,b){return null!=b.showLegend?b.showLegend:!0}},write:{target:"showLegend"}}},levelValues:{dependsOn:["tileInfo"],get:function(){var a=[];if(!this.tileInfo)return null;this.tileInfo.lods.forEach(function(b){a[b.level]=b.levelValue||b.level},this);return a}},operationalLayerType:"WebTiledLayer",popupEnabled:{json:{read:{source:["disablePopup"],reader:function(a,b){return null!=b.disablePopup?!b.disablePopup:!0}}}},refreshInterval:{json:{write:!0}},spatialReference:{type:t,value:t.WebMercator,
json:{read:{source:["spatialReference","fullExtent.spatialReference"],reader:function(a,b){return a||b.fullExtent&&b.fullExtent.spatialReference&&t.fromJSON(b.fullExtent.spatialReference)}}}},subDomains:{type:[String],value:null,json:{write:!0}},tileInfo:{type:w,json:{write:!0}},tileServers:{value:null,dependsOn:["urlTemplate","subDomains"],get:function(){if(!this.urlTemplate)return null;var a=new r(this.urlTemplate),b=a.scheme?a.scheme+"://":"//",c=b+a.authority+"/",f=this.subDomains,l,n=[];-1===
a.authority.indexOf("{subDomain}")&&n.push(c);f&&0<f.length&&1<a.authority.split(".").length&&f.forEach(function(c){-1<a.authority.indexOf("{subDomain}")&&(l=b+a.authority.replace(/\{subDomain\}/gi,c)+"/");n.push(l)},this);return n=n.map(function(a){"/"!==a.charAt(a.length-1)&&(a+="/");return a})}},type:{value:"web-tile",json:{read:!1}},urlPath:{dependsOn:["urlTemplate"],get:function(){if(!this.urlTemplate)return null;var a=this.urlTemplate,b=new r(a);return a.substring(((b.scheme?b.scheme+"://":
"//")+b.authority+"/").length)}},urlTemplate:{type:String,json:{origins:{"portal-item":{read:{source:"url"}}},read:{source:["urlTemplate","templateUrl"],reader:function(a,b){return a||b.templateUrl}},write:{target:"templateUrl",writer:function(a,b,f){a&&c.isProtocolRelative(a)&&(a="https:"+a);b[f]=a?c.normalize(a):a}}}},url:{json:{write:!1}},wmtsInfo:{json:{write:!0}}},getTileUrl:function(a,b,c){a=this.levelValues[a];var f=this.tileServers[b%this.tileServers.length]+k.substitute(this.urlPath,{level:a,
col:c,row:b});return f=f.replace(/\{level\}/gi,a).replace(/\{row\}/gi,b).replace(/\{col\}/gi,c)},load:function(){var b=this.loadFromPortal({supportedTypes:["WMTS"]}).then(function(){if(!this.urlTemplate)throw new a("layer:load","WebTileLayer (title: '"+this.title+"', id: '"+this.id+"') is missing the required 'urlTemplate' property value");}.bind(this));this.addResolvingPromise(b);return this}})})},"esri/layers/support/WMTSSublayer":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/accessorSupport/decorators ../../core/Collection ../../core/JSONSupport ./TileMatrixSet ./WMTSStyle ../../geometry/Extent".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){return function(b){function n(a){a=b.call(this)||this;a.fullExtent=null;a.imageFormats=null;a.id=null;a.layer=null;a.styles=null;a.tileMatrixSetId=null;a.tileMatrixSets=null;return a}k(n,b);r=n;Object.defineProperty(n.prototype,"description",{get:function(){return this._get("description")},set:function(a){this._set("description",a)},enumerable:!0,configurable:!0});n.prototype.readFullExtent=function(a,b,c){return(a=b.fullExtent)?l.fromJSON(a):null};Object.defineProperty(n.prototype,
"imageFormat",{get:function(){var a=this._get("imageFormat");a||(a=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:"");return a},set:function(a){if(-1<a.indexOf("image/")||-1===this.imageFormats.indexOf(a))if(-1===a.indexOf("image/")&&(a="image/"+a),this.imageFormats&&-1===this.imageFormats.indexOf(a)){console.error("The layer doesn't support the format of "+a);return}this._set("imageFormat",a)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"styleId",{get:function(){var a=
this._get("styleId");a||(a=this.styles&&this.styles.length?this.styles.getItemAt(0).id:"");return a},set:function(a){this._set("styleId",a)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"title",{get:function(){return this._get("title")},set:function(a){this._set("title",a)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"tileMatrixSet",{get:function(){var a=this;return this.tileMatrixSets.find(function(b){return b.id===a.tileMatrixSetId})},enumerable:!0,configurable:!0});
n.prototype.clone=function(){var a=new r;this.hasOwnProperty("description")&&(a.description=this.description);this.hasOwnProperty("imageFormats")&&(a.imageFormats=this.imageFormats&&this.imageFormats.slice());this.hasOwnProperty("imageFormat")&&(a.imageFormat=this.imageFormat);this.hasOwnProperty("fullExtent")&&(a.fullExtent=this.fullExtent&&this.fullExtent.clone());this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("layer")&&(a.layer=this.layer);this.hasOwnProperty("styleId")&&(a.styleId=
this.styleId);this.hasOwnProperty("styles")&&(a.styles=this.styles&&this.styles.clone());this.hasOwnProperty("tileMatrixSetId")&&(a.tileMatrixSetId=this.tileMatrixSetId);this.hasOwnProperty("tileMatrixSets")&&(a.tileMatrixSets=this.tileMatrixSets.clone());this.hasOwnProperty("title")&&(a.title=this.title);return a};a([c.property()],n.prototype,"description",null);a([c.property()],n.prototype,"fullExtent",void 0);a([c.reader("fullExtent",["fullExtent"])],n.prototype,"readFullExtent",null);a([c.property({dependsOn:["imageFormats"]})],
n.prototype,"imageFormat",null);a([c.property({json:{read:{source:"formats"}}})],n.prototype,"imageFormats",void 0);a([c.property()],n.prototype,"id",void 0);a([c.property()],n.prototype,"layer",void 0);a([c.property()],n.prototype,"styleId",null);a([c.property({type:t.ofType(q),json:{read:{source:"styles"}}})],n.prototype,"styles",void 0);a([c.property({value:null,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",null);a([c.property()],n.prototype,"tileMatrixSetId",void 0);a([c.property({readOnly:!0,
dependsOn:["tileMatrixSetId"]})],n.prototype,"tileMatrixSet",null);a([c.property({type:t.ofType(f),json:{read:{source:"tileMatrixSets"}}})],n.prototype,"tileMatrixSets",void 0);return n=r=a([c.subclass("esri.layers.support.WMTSSublayer")],n);var r}(c.declared(n))})},"esri/layers/support/TileMatrixSet":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/accessorSupport/decorators ../../core/JSONSupport".split(" "),
function(x,r,k,a,b,c,t){return function(b){function f(a){a=b.call(this)||this;a.fullExtent=null;a.id=null;a.tileInfo=null;return a}k(f,b);n=f;f.prototype.clone=function(){var a=new n;this.hasOwnProperty("fullExtent")&&(a.fullExtent=this.fullExtent&&this.fullExtent.clone());this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("tileInfo")&&(a.tileInfo=this.tileInfo&&this.tileInfo.clone());return a};a([c.property({json:{read:{source:"fullExtent"}}})],f.prototype,"fullExtent",void 0);a([c.property({json:{read:{source:"id"}}})],
f.prototype,"id",void 0);a([c.property({json:{read:{source:"tileInfo"}}})],f.prototype,"tileInfo",void 0);return f=n=a([c.subclass("esri.layer.support.TileMatrixSet")],f);var n}(c.declared(t))})},"esri/layers/support/WMTSStyle":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/accessorSupport/decorators ../../core/JSONSupport".split(" "),function(x,r,k,a,b,c,t){return function(b){function f(a){a=
b.call(this)||this;a.id=null;a.title=null;a.description=null;a.legendUrl=null;return a}k(f,b);n=f;f.prototype.clone=function(){var a=new n;this.hasOwnProperty("description")&&(a.description=this.description);this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("isDefault")&&(a.isDefault=this.isDefault);this.hasOwnProperty("keywords")&&(a.keywords=this.keywords&&this.keywords.slice());this.hasOwnProperty("legendUrl")&&(a.legendUrl=this.legendUrl);this.hasOwnProperty("title")&&(a.title=this.title);
return a};a([c.property({json:{read:{source:"id"}}})],f.prototype,"id",void 0);a([c.property({json:{read:{source:"title"}}})],f.prototype,"title",void 0);a([c.property({json:{read:{source:"abstract"}}})],f.prototype,"description",void 0);a([c.property({json:{read:{source:"legendUrl"}}})],f.prototype,"legendUrl",void 0);a([c.property({json:{read:{source:"isDefault"}}})],f.prototype,"isDefault",void 0);a([c.property({json:{read:{source:"keywords"}}})],f.prototype,"keywords",void 0);return f=n=a([c.subclass("esri.layer.support.WMTSStyle")],
f);var n}(c.declared(t))})},"esri/layers/support/wmtsUtils":function(){define("require exports ../../geometry/Extent ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/WKIDUnitConversion ./TileInfo ../../core/Error".split(" "),function(x,r,k,a,b,c,t,n){function f(a,b){return(a=b.getElementsByTagName(a))&&0<a.length?a[0]:null}function q(a,b){return Array.prototype.slice.call(b.getElementsByTagName(a)).map(function(a){return a.textContent})}function l(a,b){a.split("\x3e").forEach(function(a){b=
f(a,b)});return b&&b.textContent}function y(a,b,c,l){var n;Array.prototype.slice.call(l.childNodes).some(function(l){if(-1<l.nodeName.indexOf(a)){var p=f(b,l),p=p&&p.textContent;return p===c||c.split(":")&&c.split(":")[1]===p?(n=l,!0):!1}});return n}function B(a){var b=[],c=I[a],f=Array.prototype.slice.call(c.getElementsByTagName("ResourceURL")),c=c.getElementsByTagName("Dimension"),n,p,k,t;c.length&&(n=l("Identifier",c[0]),p=q("Default",c[0])||q("Value",c[0]));1<c.length&&(k=l("Identifier",c[1]),
t=q("Default",c[1])||q("Value",c[1]));J[a]={dimensions:p,dimensions2:t};f.forEach(function(a){var c=a.getAttribute("template");if(n&&p.length)if(-1<c.indexOf("{"+n+"}"))c=c.replace("{"+n+"}","{dimensionValue}");else{var f=c.toLowerCase().indexOf("{"+n.toLowerCase()+"}");-1<f&&(c=c.substring(0,f)+"{dimensionValue}"+c.substring(f+n.length+2))}k&&t.length&&(-1<c.indexOf("{"+k+"}")?c=c.replace("{"+k+"}","{dimensionValue2}"):(f=c.toLowerCase().indexOf("{"+k.toLowerCase()+"}"),-1<f&&(c=c.substring(0,f)+
"{dimensionValue2}"+c.substring(f+k.length+2))));b.push({template:c,format:a.getAttribute("fomrat"),resourceType:a.getAttribute("resourceType")})});return b}function v(a){return Array.prototype.slice.call(a.getElementsByTagName("Style")).map(function(a){var b=f("LegendURL",a),c=f("Keywords",a),c=c&&q("Keyword",c);return{abstract:l("Abstract",a),id:l("Identifier",a),isDefault:"true"===a.getAttribute("isDefault"),keywords:c,legendUrl:b&&b.getAttribute("xlink:href"),title:l("Title",a)}})}function w(a,
b){return q("TileMatrixSet",a).map(function(c){return D(c,a,b)})}function D(a,b,c){b=y("TileMatrixSetLink","TileMatrixSet",a,b);b=q("TileMatrix",b);var n=y("TileMatrixSet","Identifier",a,c);c=F(n);var k=c.spatialReference,r=k.wkid,v=f("TileMatrix",n),v=[parseInt(l("TileWidth",v),10),parseInt(l("TileHeight",v),10)],w=[];b.length?b.forEach(function(b,c){b=y("TileMatrix","Identifier",b,n);w.push(p(b,r,c,a))}):Array.prototype.slice.call(n.getElementsByTagName("TileMatrix")).forEach(function(b,c){w.push(p(b,
r,c,a))});b=G(n,c,v,w[0]);return{id:a,fullExtent:b,tileInfo:new t({dpi:96,spatialReference:k,size:v,origin:c,lods:w})}}function F(c){var n=l("SupportedCRS",c);n&&(n=n.toLowerCase());var p=parseInt(n.split(":").pop(),10);if(900913===p||3857===p)p=102100;var k=!1;if(-1<n.indexOf("crs84")||-1<n.indexOf("crs:84"))p=4326,k=!0;else if(-1<n.indexOf("crs83")||-1<n.indexOf("crs:83"))p=4269,k=!0;else if(-1<n.indexOf("crs27")||-1<n.indexOf("crs:27"))p=4267,k=!0;var q=new b({wkid:p});c=f("TileMatrix",c);var t=
l("TopLeftCorner",c).split(" ");c=t[0].split("E").map(function(a){return Number(a)});var t=t[1].split("E").map(function(a){return Number(a)}),r=c[0],v=t[0],y;1<c.length&&(r=c[0]*Math.pow(10,c[1]));1<t.length&&(v=t[0]*Math.pow(10,t[1]));var w=k&&4326===p&&90===r&&-180===v;A.some(function(b,c){var f=Number(n.split(":").pop());if(f>=b[0]&&f<=b[1]||4326===p&&(!k||w))return y=new a(v,r,q),!0;c===A.length-1&&(y=new a(r,v,q));return!1});return y}function G(a,b,c,n){var p=f("BoundingBox",a),q,t;p&&(q=l("LowerCorner",
p).split(" "),t=l("UpperCorner",p).split(" "));q&&1<q.length&&t&&1<t.length?(a=parseFloat(q[0]),c=parseFloat(q[1]),q=parseFloat(t[0]),t=parseFloat(t[1])):(a=f("TileMatrix",a),q=parseFloat(l("MatrixWidth",a)),p=parseFloat(l("MatrixHeight",a)),a=b.x,t=b.y,q=a+q*c[0]*n.resolution,c=t-p*c[1]*n.resolution);return new k(a,c,q,t,b.spatialReference)}function p(a,b,c,f){var n=l("Identifier",a);a=l("ScaleDenominator",a).split("E").map(function(a){return Number(a)});a=1<a.length?a[0]*Math.pow(10,a[1]):a[0];
b=z(b,a,f);return{level:c,levelValue:n,scale:1.058267716535433*a,resolution:b}}function z(a,b,f){a=c.hasOwnProperty(String(a))?c.values[c[a]]:"default028mm"===f?6370997*Math.PI/180:6378137*Math.PI/180;return 7*b/25E3/a}Object.defineProperty(r,"__esModule",{value:!0});var A=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],
[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],
[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],
[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],J=new Map,I=new Map;r.parseCapabilities=function(a,b){a=a.replace(/ows:/gi,"");a=(new DOMParser).parseFromString(a,"text/xml").documentElement;var c=f("Contents",a);if(!c)throw new n("wmtslayer:wmts-capabilities-xml-is-not-valid");var p=
f("OperationsMetadata",a),p=(p=(p=p&&p.querySelector("[name\x3d'GetTile']"))&&p.getElementsByTagName("Get"))&&Array.prototype.slice.call(p),k=b.serviceMode,t,r,A;p&&p.length&&p.some(function(a){var b=f("Constraint",a);if(!b||y("AllowedValues","Value",k,b))return r=a.attributes[0].nodeValue,!0;if(!b||y("AllowedValues","Value","RESTful",b)||y("AllowedValues","Value","REST",b))A=a.attributes[0].nodeValue;else if(!b||y("AllowedValues","Value","KVP",b))t=a.attributes[0].nodeValue;return!1});r||(A?(r=A,
k="RESTful"):t?(r=t,k="KVP"):r=f("ServiceMetadataURL",a).getAttribute("xlink:href"));b=r.indexOf("1.0.0/");-1===b&&"RESTful"===k?r+="/":-1<b&&(r=r.substring(0,b));"KVP"===k&&(r+=-1<b?"":"?");b=l("ServiceIdentification\x3eAccessConstraints",a);a=Array.prototype.slice.call(c.getElementsByTagName("Layer")).map(function(a){var b=l("Identifier",a);I[b]=a;var h=l("Abstract",a),n=q("Format",a),p,e=f("WGS84BoundingBox",a);p=e?l("LowerCorner",e).split(" "):["-180","-90"];e=e?l("UpperCorner",e).split(" "):
["180","90"];p={xmin:parseFloat(p[0]),ymin:parseFloat(p[1]),xmax:parseFloat(e[0]),ymax:parseFloat(e[1]),spatialReference:{wkid:4326}};var e=v(a),d=l("Title",a);a=w(a,c);return{id:b,fullExtent:p,description:h,formats:n,styles:e,title:d,tileMatrixSets:a}});return{copyright:b,layers:a,tileUrl:r,serviceMode:k}};r.parseResourceInfo=function(a){a.layers.forEach(function(a){a.tileMatrixSets.forEach(function(a){var b=a.tileInfo;96!==b.dpi&&(b.lods.forEach(function(c){c.scale=96*c.scale/b.dpi;c.resolution=
z(b.spatialReference.wkid,90.71428571428571*c.scale/96,a.id)}),b.dpi=96)})});return a};r.getTileUrlFromResourceUrls=function(a,b,c,f,l,n){var p=B(a),k=J[a].dimensions&&J[a].dimensions[0];a=J[a].dimensions2&&J[a].dimensions2[0];var q="";p&&0<p.length&&(q=p[l%p.length].template.replace(/\{Style\}/gi,c).replace(/\{TileMatrixSet\}/gi,b).replace(/\{TileMatrix\}/gi,f).replace(/\{TileRow\}/gi,l).replace(/\{TileCol\}/gi,n).replace(/\{dimensionValue\}/gi,k).replace(/\{dimensionValue2\}/gi,a));return q};r.getTileUrlTemplateFromResourceUrls=
function(a,b,c,f){c=B(a);var l="";if(c&&0<c.length){var n=J[a].dimensions&&J[a].dimensions[0];a=J[a].dimensions2&&J[a].dimensions2[0];l=c[0].template;l.indexOf(".xxx")===l.length-4&&(l=l.slice(0,l.length-4));l=l.replace(/\{Style\}/gi,f);l=l.replace(/\{TileMatrixSet\}/gi,b);l=l.replace(/\{TileMatrix\}/gi,"{level}");l=l.replace(/\{TileRow\}/gi,"{row}");l=l.replace(/\{TileCol\}/gi,"{col}");l=l.replace(/\{dimensionValue\}/gi,n);l=l.replace(/\{dimensionValue2\}/gi,a)}return l}})},"esri/views/3d/terrain/tileUtils":function(){define(["require",
"exports","./UpsampleInfo","../support/PreallocArray"],function(x,r,k,a){function b(a,c,l,n){n=c.call(l,a,n);for(var f=0;4>f;f++){var k=a.children[f];k&&b(k,c,l,n)}}function c(a,b,c){if(Array.isArray(a))for(var f=0;f<a.length;f++)t(a[f],b,c);else t(a,b,c)}function t(a,b,l){for(var f=0;4>f;f++){var n=a.children[f];n&&c(n,b,l)}b.call(l,a)}Object.defineProperty(r,"__esModule",{value:!0});x=function(){function b(b){void 0===b&&(b=100);this.q=new a(b);this._last=null;this.done=!0}b.prototype.reset=function(a){this.q.clear();
a&&this.q.pushEither(a);this._last=null;this.done=0===this.q.length};b.prototype.skip=function(){this._last=null;0===this.q.length&&(this.done=!0)};b.prototype.next=function(){if(this.done)return null;if(null!==this._last){var a=this._last.children;if(a[0])for(var b=4;0<=b;b--){var c=a[b];c&&this.q.push(c)}this._last=null}this._last=this.q.pop();0!==this.q.length||this._last.children[0]||(this.done=!0);return this._last};return b}();r.IteratorPreorder=x;x=function(){function b(b){void 0===b&&(b=100);
this.q=new a(b);this.done=!0}b.prototype.reset=function(a){this.q.clear();this.q.pushEither(a);for(a=0;a<this.q.length;)for(var b=this.q.data[a++],c=0;4>c;c++){var f=b.children[c];f&&this.q.push(f)}this.done=0===this.q.length};b.prototype.next=function(){var a=this.q.pop();this.done=0===this.q.length;return a};return b}();r.IteratorPostorder=x;r.lij2str=function(a,b,c){return a+"/"+b+"/"+c};r.tile2str=function(a){return a.lij[0]+"/"+a.lij[1]+"/"+a.lij[2]};r.traverseTilesPreorder=function(a,c,l,n){if(Array.isArray(a))for(var f=
0;f<a.length;f++)b(a[f],c,l,n);else b(a,c,l,n)};r.traverseTilesPostorder=c;r.fallsWithinLayer=function(a,b,c){if(!b)return!1;var f=b.fullExtent,l=a.extent;if(c){if(l[0]<f.xmin||l[1]<f.ymin||l[2]>f.xmax||l[3]>f.ymax)return!1}else if(f.xmin>l[2]||f.ymin>l[3]||f.xmax<l[0]||f.ymax<l[1])return!1;a=a.parentSurface.tilingScheme.levels[a.lij[0]].scale;return 0<b.minScale&&a>1.00000001*b.minScale||0<b.maxScale&&a<.99999999*b.maxScale?!1:!0};r.isPosWithinTile=function(a,b){a=a.extent;return b[0]>=a[0]&&b[1]>=
a[1]&&b[0]<=a[2]&&b[1]<=a[3]};r.getTileNLevelsUp=function(a,b){for(;0<b;)a=a.parent,b--;return a};r.nextTileInAncestry=function(a,b){var c=a.lij[0]-b.lij[0]-1,f=a.lij[2]>>c,n=0;a.lij[1]>>c&1&&(n+=2);f&1&&(n+=1);return b.children[n]};r.computeUpsampleInfoForAncestor=function(a,b){for(var c=1,f=0,n=0;a!==b;)if(c*=.5,f*=.5,n*=.5,a.lij[2]&1&&(f+=.5),0===(a.lij[1]&1)&&(n+=.5),a=a.parent,null==a)throw Error("tile was not a descendant of ancestorTile");a=k.Pool.acquire();a.init(b,f,n,c);return a};var n=
[null];r.hasVisibleSiblings=function(a){Array.isArray(a)||(n[0]=a,a=n);for(var b=0;b<a.length;b++){var c=a[b],f=c.parent;if(f)for(var k=0;4>k;k++){var t=f.children[k];if(t&&t!==c&&t.visible)return!0}}return!1}})},"esri/views/3d/terrain/UpsampleInfo":function(){define(["require","exports","../lib/glMatrix","../../../core/ObjectPool"],function(x,r,k,a){var b=k.vec2d;return function(){function c(a,c,f,k){this.scale=0;this.tile=null;this.offset=b.create();void 0!==a&&this.init(a,c,f,k)}c.prototype.init=
function(a,b,c,k){this.tile=a;this.offset[0]=b;this.offset[1]=c;this.scale=k};c.prototype.dispose=function(){this.tile=null;this.offset[0]=0;this.scale=this.offset[1]=0};c.Pool=new a(c);return c}()})},"esri/views/3d/terrain/ElevationData":function(){define(["require","exports","../../../layers/support/rasterFormats/LercCodec","./TerrainConst","../support/mathUtils"],function(x,r,k,a,b){return function(){function c(a,b,c,k){this.samplerData=null;this.level=a;this.i=b;this.j=c;this.extent=k}c.prototype.computeMinMaxValue=
function(c,n,f,k){var l=Infinity,q=-Infinity;c-=this.level;var t=Math.pow(2,c);if(Math.floor(n/t)===this.i&&Math.floor(f/t)===this.j&&0<c){var r=this.samplerData.width,w=this.samplerData.pixelData,D=.5*a.ELEVATION_NODATA_VALUE;c=(r-1)/t;f=(f-this.j*t)*c;n=(n-this.i*t)*c;if(1>c){var t=Math.floor(f),F=Math.floor(n),x=t+F*r,p=w[x],z=w[x+1],A=w[x+r],x=w[x+r+1];if(p+z+A+x<D)return l=b.bilerp(p,z,A,x,f-t,n-F),q=b.bilerp(p,z,A,x,f-t+c,n-F),r=b.bilerp(p,z,A,x,f-t,n-F+c),c=b.bilerp(p,z,A,x,f-t+c,n-F+c),k[0]=
Math.min(l,q,r,c),k[1]=Math.max(l,q,r,c),k;f=t;n=F;c=1}else f=Math.floor(f),n=Math.floor(n),c=Math.ceil(c);for(t=f;t<=f+c;t++)for(F=n;F<=n+c;F++)x=t+F*r,p=w[x],p<D?(l=Math.min(l,p),q=Math.max(q,p)):(l=0<l?0:l,q=0>q?0:q)}k[0]=l;k[1]=q;return k};c.createFromLERC=function(a,b,f,q){f=k.decode(f,q);a=new c(a[0],a[1],a[2],b);a.samplerData={pixelData:f.pixelData,width:f.width,height:f.height,minValue:f.minValue,maxValue:f.maxValue,noDataValue:f.noDataValue,safeWidth:.99999999*(f.width-1),dx:(f.width-1)/
(a.extent[2]-a.extent[0]),dy:(f.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[a.samplerData.minValue,-3E38<a.samplerData.maxValue?a.samplerData.maxValue:0];return a};c.createFromFetchTileResult=function(a,b,f){a=new c(a[0],a[1],a[2],b);b=f.values;for(var n=f.noDataValue,l=Infinity,k=-Infinity,t=!0,r=0;r<b.length;r++){var w=b[r];w!==n&&(l=w<l?w:l,k=w>k?w:k,t=!1)}t&&(k=l=0);a.samplerData={pixelData:f.values,width:f.width,height:f.height,minValue:l,maxValue:k,noDataValue:n,
safeWidth:.99999999*(f.width-1),dx:(f.width-1)/(a.extent[2]-a.extent[0]),dy:(f.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[l,k];return a};return c}()})},"esri/views/3d/terrain/TilePerLayerInfo":function(){define("require exports ./TileAgentBase ./TerrainConst ./UpsampleInfo ../../webgl/Texture ../../vectorTiles/VectorTileDisplayObject".split(" "),function(x,r,k,a,b,c,t){return function(){function n(a){this.waitingAgents=[];this.rawData=this.requestPromise=this.loadingAgent=
this.upsampleFromTile=this.tilemapRequest=this.tilemap=this.data=null;this.pendingUpdates=0;this.elevationBounds=void 0;this.init(a)}n.prototype.init=function(b){this.waitingAgents.length=0;this.data=null;this.dataInvalidated=this.dataMissing=!1;this.rawData=this.requestPromise=this.loadingAgent=this.upsampleFromTile=this.tilemapRequest=this.tilemap=null;this.pendingUpdates=0;b===a.LayerClass.ELEVATION&&(this.elevationBounds=null)};n.prototype.invalidateSourceData=function(){this.tilemap=null;this.dataInvalidated=
!0;this.dataMissing=!1;this.upsampleFromTile&&(b.Pool.release(this.upsampleFromTile),this.upsampleFromTile=null)};n.prototype.dispose=function(){this.loadingAgent&&this.loadingAgent!==k.AGENT_DONE&&(this.loadingAgent.dispose(),this.loadingAgent=null);this.requestPromise&&(this.requestPromise.cancel(),this.requestPromise=null);this.tilemap=null;this.tilemapRequest&&(this.tilemapRequest.cancel(),this.tilemapRequest=null);this.upsampleFromTile&&(b.Pool.release(this.upsampleFromTile),this.upsampleFromTile=
null);this.rawData=null;this.pendingUpdates=0;this.disposeData()};n.prototype.disposeData=function(){var a=this.data;a&&(a instanceof c?a.dispose():a instanceof t&&a.dispose(),this.data=null)};n.makeEmptyLayerInfo=function(a,b){return b?(b.init(a),b):new n(a)};return n}()})},"esri/views/3d/terrain/TileAgentBase":function(){define(["require","exports","./UpsampleInfo","./tileUtils"],function(x,r,k,a){function b(a,c,f,q,l,r,B){if(!a.parent||6<B)return null;q*=.5;l*=.5;r*=.5;a.lij[2]&1&&(l+=.5);0===
(a.lij[1]&1)&&(r+=.5);return a.parent.hasLayerData(c,f)?(c=k.Pool.acquire(),c.init(a.parent,l,r,q),c):b(a.parent,c,f,q,l,r,B+1)}var c=Error("Abstract method called on TileAgentBase");return function(){function t(){}t.prototype.init=function(a,b,c,l){this.tile=a;this.layerIdx=b;this.layerClass=c;this.suspended=l;this._tileLayerInfo=a.getLayerInfo(b,c);this._dataRequested=null;(a=this._findAncestorWithData())?(this._setUpsamplingTile(a.tile),k.Pool.release(a)):(this._tileLayerInfo.upsampleFromTile&&
k.Pool.release(this._tileLayerInfo.upsampleFromTile),this._tileLayerInfo.upsampleFromTile=null);return this._requestNext(!0)};t.prototype.dispose=function(){this._dataRequested&&(this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this),this._dataRequested=null);this._tileLayerInfo=this.tile=null};t.prototype.setSuspension=function(a){a!==this.suspended&&((this.suspended=a)?this._dataRequested&&(this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this),this._dataRequested=
null):this._tileLayerInfo.data||this.update())};t.prototype.update=function(){var a=this._findAncestorWithData();a&&this._tileLayerInfo.upsampleFromTile&&a.tile!==this._tileLayerInfo.upsampleFromTile.tile?this._setUpsamplingTile(a.tile):a&&k.Pool.release(a);return this._requestNext()};t.prototype.dataArrived=function(a){throw c;};t.prototype.dataMissing=function(a){this._dataRequested=null;this._tileLayerInfo.disposeData();this._requestNext()};t.prototype._agentDone=function(){this.tile.agentDone(this.layerIdx,
this.layerClass);this.dispose()};t.prototype._requestNext=function(a){void 0===a&&(a=!1);if(this.suspended)return!0;var b=this._findNextDownload();if(this._dataRequested){if(b===this._dataRequested)return!0;this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this);this._dataRequested=null}b?b.requestLayerData(this.layerIdx,this.layerClass,this)&&(this._dataRequested=b):a||this._agentDone();return!!this._dataRequested};t.prototype._findNextDownload=function(){for(var b=this.layerIdx,
c=this.layerClass,k=this.tile.parentSurface.layerViewByIndex(b,c),l=k.minDataLevel,r=k.maxDataLevel,B=this._desiredMinLevelDelta(),v=t.START_LOADING_LEVEL_DELTA+B,w=this._scaleRangeEnabled,D,F=this.tile,x=0,p=F.lij[0],z=this._tileLayerInfo.upsampleFromTile?this._tileLayerInfo.upsampleFromTile.tile.lij[0]:-1,A=this.tile.parentSurface,J=A.tilemapStats,I=A.getTilemapTile(F),K=!1;F&&(!w||a.fallsWithinLayer(F,k.layer,!1))&&F.lij[0]>=l;){var L=F.layerInfo[c][b];if(L.data&&x>=B){F.lij[0]>z&&this._setUpsamplingTile(F);
L.dataInvalidated&&(D=F);break}if(I&&!I.tileDataAvailable(F,b,c))K=!0;else if(F.lij[0]<=r&&!L.data&&!L.dataMissing&&(D=F,x>=v))break;(F=F.parent)&&I&&(I=I.parent||A.getTilemapTile(F));x++}D&&p-D.lij[0]<B&&this._tileLayerInfo.upsampleFromTile&&(D=null);!D&&K&&J.tilesNotPresent++;return D};t.prototype._findAncestorWithData=function(){return b(this.tile,this.layerIdx,this.layerClass,1,0,0,0)};t.prototype._desiredMinLevelDelta=function(){throw c;};t.prototype._setUpsamplingTile=function(a){throw c;};
t.prototype._unsetUpsamplingTile=function(){this._tileLayerInfo.upsampleFromTile&&k.Pool.release(this._tileLayerInfo.upsampleFromTile);this._tileLayerInfo.upsampleFromTile=null};t.START_LOADING_LEVEL_DELTA=4;t.AGENT_DONE=new t;return t}()})},"esri/views/vectorTiles/VectorTileDisplayObject":function(){define("require exports ../../core/tsSupport/extendsHelper ../../core/libs/gl-matrix/vec2 ../../core/libs/gl-matrix/mat4 ../../core/ObjectPool ../../geometry/support/spatialReferenceUtils ../webgl/BufferObject ../2d/engine/DisplayObject ../2d/tiling/TileKey ./RenderBucket".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){return function(f){function r(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];l=f.call(this)||this;l._renderBuckets=[];l._vectorTileData=null;l._symbolUpdateData=null;l.status=5;l.coords=[0,0];l.bounds=[0,0,0,0];l.tileTransform={transform:Float32Array[16],displayCoord:Float32Array[2]};l.stencilData={mask:0,reference:0};l.status=0;l.tileTransform.transform=b.create();l.tileTransform.displayCoord=a.create();0<c.length&&(n=l.acquire).call.apply(n,[l].concat(c));
return l;var n}k(r,f);r.prototype.reset=function(){q.pool.release(this.key);this.refKey=this.key=null;this.coords[0]=0;this.coords[1]=0;this.bounds[0]=0;this.bounds[1]=0;this.bounds[2]=0;this.height=this.width=this.bounds[3]=0;this.resolution=null;this.rotation=0;this.id=this._connection=this.workerID=this.styleLayers=this._vectorTileData=null;this.tileTransform.transform.fill(0);this.tileTransform.displayCoord.fill(0);this.stencilData.mask=0;this.stencilData.reference=0;this._renderBuckets.length=
0;this._symbolUpdateData=null;this.status=0};r.prototype.acquire=function(a,b,c,f,l){this.key=a;this.refKey=b;b=c.lodAt(a.level).resolution;var n=c.size[0]*b,k=c.origin,q=a.col*n,r=a.row*n,v=c.spatialReference,y=0;v&&(v._isWrappable?v._isWrappable():v.isWrappable)&&(v=t.getInfo(v),y=v.valid[1]-v.valid[0]);q=k.x+q+a.world*y;k=k.y-r;this.coords[0]=q;this.coords[1]=k;this.bounds[0]=q;this.bounds[1]=k;this.bounds[2]=q+n;this.bounds[3]=k-n;this.widthInPixels=c.size[1];this.coordRange=4096;this.resolution=
b;this.rotation=l;this.styleLayers=f;this.id=a.id;this.status=1};r.prototype.setData=function(a,b,c){this._vectorTileData=a;this.workerID=b;this._connection=c;this.status=3};r.prototype.updateSymbolData=function(a){a&&(this._symbolUpdateData=a,this.requestRender())};r.prototype.dispose=function(){this.fillVertexArrayObject&&(this.fillVertexArrayObject.dispose(),this.fillVertexArrayObject=null);this.fillDDVertexArrayObject&&(this.fillDDVertexArrayObject.dispose(),this.fillDDVertexArrayObject=null);
this.outlineVertexArrayObject&&(this.outlineVertexArrayObject.dispose(),this.outlineVertexArrayObject=null);this.outlineDDVertexArrayObject&&(this.outlineDDVertexArrayObject.dispose(),this.outlineDDVertexArrayObject=null);this.lineVertexArrayObject&&(this.lineVertexArrayObject.dispose(),this.lineVertexArrayObject=null);this.lineDDVertexArrayObject&&(this.lineDDVertexArrayObject.dispose(),this.lineDDVertexArrayObject=null);this.iconVertexArrayObject&&(this.iconVertexArrayObject.dispose(),this.iconVertexArrayObject=
null);this.iconDDVertexArrayObject&&(this.iconDDVertexArrayObject.dispose(),this.iconDDVertexArrayObject=null);this.textVertexArrayObject&&(this.textVertexArrayObject.dispose(),this.textVertexArrayObject=null);this.textDDVertexArrayObject&&(this.textDDVertexArrayObject.dispose(),this.textDDVertexArrayObject=null);this.fillVertexBuffer&&(this.fillVertexBuffer.dispose(),this.fillVertexBuffer=null);this.fillDDVertexBuffer&&(this.fillDDVertexBuffer.dispose(),this.fillDDVertexBuffer=null);this.fillIndexBuffer&&
(this.fillIndexBuffer.dispose(),this.fillIndexBuffer=null);this.outlineVertexBuffer&&(this.outlineVertexBuffer.dispose(),this.outlineVertexBuffer=null);this.outlineDDVertexBuffer&&(this.outlineDDVertexBuffer.dispose(),this.outlineDDVertexBuffer=null);this.outlineIndexBuffer&&(this.outlineIndexBuffer.dispose(),this.outlineIndexBuffer=null);this.lineVertexBuffer&&(this.lineVertexBuffer.dispose(),this.lineVertexBuffer=null);this.lineDDVertexBuffer&&(this.lineDDVertexBuffer.dispose(),this.lineDDVertexBuffer=
null);this.lineIndexBuffer&&(this.lineIndexBuffer.dispose(),this.lineIndexBuffer=null);this.iconVertexBuffer&&(this.iconVertexBuffer.dispose(),this.iconVertexBuffer=null);this.iconDDVertexBuffer&&(this.iconDDVertexBuffer.dispose(),this.iconDDVertexBuffer=null);this.iconIndexBuffer&&(this.iconIndexBuffer.dispose(),this.iconIndexBuffer=null);this.textVertexBuffer&&(this.textVertexBuffer.dispose(),this.textVertexBuffer=null);this.textDDVertexBuffer&&(this.textDDVertexBuffer.dispose(),this.textDDVertexBuffer=
null);this.textIndexBuffer&&(this.textIndexBuffer.dispose(),this.textIndexBuffer=null);this.texture&&(this.texture.dispose(),this.texture=null);this._renderBuckets.length=0;this.status=7};r.prototype.attach=function(a){if(4===this.status)return!0;this.status=3;if(!this._vectorTileData)return!1;if(!this._vectorTileData.bufferDataInfo)return this.status=4,!0;if(0===this._renderBuckets.length)for(var b=new Uint32Array(this._vectorTileData.bucketDataInfo),c=b.length,f=0;f<c;){var k=b[f],p=b[f+1];if(0===
p)p=new l.BackgroundRenderBucket,p.layerID=k,this._renderBuckets.push(p),f+=2;else if(1===p)p=new l.FillRenderBucket,p.layerID=k,p.triangleElementStart=b[f+2],p.triangleElementCount=b[f+3],p.outlineElementStart=b[f+4],p.outlineElementCount=b[f+5],this._renderBuckets.push(p),f+=6;else if(2===p)p=new l.LineRenderBucket,p.layerID=k,p.triangleElementStart=b[f+2],p.triangleElementCount=b[f+3],this._renderBuckets.push(p),f+=6;else if(3===p){p=new l.SymbolRenderBucket;p.layerID=k;p.isSDF=0!==b[f+2];var q=
f+3,k=b[q];q++;if(0<k)for(var t=void 0,r=void 0,v=void 0,y=0;y<k;y++)t=b[q],r=b[q+1],v=b[q+2],p.markerPerPageElementsMap.set(t,[r,v]),q+=3;var B=b[q];q++;if(0<B)for(v=r=t=void 0,y=0;y<B;y++)t=b[q],r=b[q+1],v=b[q+2],p.glyphPerPageElementsMap.set(t,[r,v]),q+=3;this._renderBuckets.push(p);f+=5+3*k+3*B}else console.error("Bad bucket type!")}a=a.context;b=new Uint32Array(this._vectorTileData.bufferDataInfo);c=b.length;for(p=f=0;p<c;p+=2,f++)if(!(0>=b[p+1]||0===this._vectorTileData.bufferData[f].byteLength))switch(b[p]){case 1:this.fillVertexBuffer?
this.fillVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.fillVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 2:this.fillDDVertexBuffer?this.fillDDVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.fillDDVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 3:this.fillIndexBuffer?this.fillIndexBuffer.setData(this._vectorTileData.bufferData[f]):this.fillIndexBuffer=n.createIndex(a,35044,this._vectorTileData.bufferData[f]);
break;case 4:this.outlineVertexBuffer?this.outlineVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.outlineVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 5:this.outlineDDVertexBuffer?this.outlineDDVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.outlineDDVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 6:this.outlineIndexBuffer?this.outlineIndexBuffer.setData(this._vectorTileData.bufferData[f]):this.outlineIndexBuffer=
n.createIndex(a,35044,this._vectorTileData.bufferData[f]);break;case 7:this.lineVertexBuffer?this.lineVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.lineVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 8:this.lineDDVertexBuffer?this.lineDDVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.lineDDVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 9:this.lineIndexBuffer?this.lineIndexBuffer.setData(this._vectorTileData.bufferData[f]):
this.lineIndexBuffer=n.createIndex(a,35044,this._vectorTileData.bufferData[f]);break;case 10:this.iconVertexBuffer?this.iconVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.iconVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 11:this.iconDDVertexBuffer?this.iconDDVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.iconDDVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 12:this.iconIndexBuffer?this.iconIndexBuffer.setData(this._vectorTileData.bufferData[f]):
this.iconIndexBuffer=n.createIndex(a,35044,this._vectorTileData.bufferData[f]);break;case 13:this.textVertexBuffer?this.textVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.textVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 14:this.textDDVertexBuffer?this.textDDVertexBuffer.setData(this._vectorTileData.bufferData[f]):this.textDDVertexBuffer=n.createVertex(a,35044,this._vectorTileData.bufferData[f]);break;case 15:this.textIndexBuffer?this.textIndexBuffer.setData(this._vectorTileData.bufferData[f]):
this.textIndexBuffer=n.createIndex(a,35044,this._vectorTileData.bufferData[f])}this.status=4;return!0};r.prototype.detach=function(a){-1!==this.workerID&&this._connection&&6!==this.status&&7!==this.status&&this._connection.broadcast("destructTileData",{key:this.id,worker:this.workerID},[]);this.dispose();f.prototype.detach.call(this,a)};r.prototype.doRender=function(a){if(this.visible&&4===this.status){var b=a.context,c=a.renderer;if(b&&c){var f=a.drawphase;this._symbolUpdateData&&this._updateSymbolData(a);
b.setStencilFunction(514,this.stencilData.reference,this.stencilData.mask);var l=this.styleLayers,n=void 0!==a.layerOpacity?a.layerOpacity:1;if(0!==n){var k,q=this._renderBuckets.length,t=0;if(0===f)for(t=q-1;0<=t;t--)k=this._renderBuckets[t],3!==k.type&&k.hasData()&&c.renderBucket(b,k,a.displayLevel,a.requiredLevel,f,this,l.layers[k.layerID],n);else for(t=0;t<q;t++)k=this._renderBuckets[t],k.hasData()&&c.renderBucket(b,k,a.displayLevel,a.requiredLevel,f,this,l.layers[k.layerID],n)}}}};r.prototype._updateSymbolData=
function(a){if(!this._symbolUpdateData.bucketDataInfo)return!0;var b=new Uint32Array(this._symbolUpdateData.bucketDataInfo),c=b.length;if(0===c)return this._symbolUpdateData=null,!0;if(1>a.budget.remaining||4!==this.status)return this.requestRender(),!1;a=a.context;for(var f=new Uint32Array(this._symbolUpdateData.bufferDataInfo),k=f.length,p=0,q=0;q<k;q+=2,p++)switch(f[q]){case 10:this.iconVertexBuffer&&(this.iconVertexBuffer.dispose(),this.iconVertexBuffer=null);this.iconVertexBuffer=n.createVertex(a,
35044,this._symbolUpdateData.bufferData[p]);break;case 11:this.iconDDVertexBuffer&&(this.iconDDVertexBuffer.dispose(),this.iconDDVertexBuffer=null);this.iconDDVertexBuffer=n.createVertex(a,35044,this._symbolUpdateData.bufferData[p]);break;case 12:this.iconIndexBuffer&&(this.iconIndexBuffer.dispose(),this.iconIndexBuffer=null);this.iconIndexBuffer=n.createIndex(a,35044,this._symbolUpdateData.bufferData[p]);break;case 13:this.textVertexBuffer&&(this.textVertexBuffer.dispose(),this.textVertexBuffer=
null);this.textVertexBuffer=n.createVertex(a,35044,this._symbolUpdateData.bufferData[p]);break;case 14:this.textDDVertexBuffer&&(this.textDDVertexBuffer.dispose(),this.textDDVertexBuffer=null);this.textDDVertexBuffer=n.createVertex(a,35044,this._symbolUpdateData.bufferData[p]);break;case 15:this.textIndexBuffer&&(this.textIndexBuffer.dispose(),this.textIndexBuffer=null),this.textIndexBuffer=n.createIndex(a,35044,this._symbolUpdateData.bufferData[p])}a=this._renderBuckets.length;for(f=0;f<a;f++)this._renderBuckets[f]instanceof
l.SymbolRenderBucket&&(k=this._renderBuckets[f],k.markerPerPageElementsMap.clear(),k.glyphPerPageElementsMap.clear());for(a=0;a<c;){k=b[a];p=-1;q=this._renderBuckets.length;for(f=0;f<q;f++)if(this._renderBuckets[f].layerID===k){p=f;break}f=this._renderBuckets[p];f||(f=new l.SymbolRenderBucket,f.layerID=k,f.isSDF=0!==b[a+2],this._renderBuckets.push(f));var t=a+3,k=b[t];t++;if(0<k)for(var r=q=p=void 0,v=0;v<k;v++)p=b[t],q=b[t+1],r=b[t+2],f.markerPerPageElementsMap.set(p,[q,r]),t+=3;var y=b[t];t++;if(0<
y)for(r=q=p=void 0,v=0;v<y;v++)p=b[t],q=b[t+1],r=b[t+2],f.glyphPerPageElementsMap.set(p,[q,r]),t+=3;a+=5+3*k+3*y}this.iconVertexArrayObject&&(this.iconVertexArrayObject.dispose(),this.iconVertexArrayObject=null);this.iconDDVertexArrayObject&&(this.iconDDVertexArrayObject.dispose(),this.iconDDVertexArrayObject=null);this.textVertexArrayObject&&(this.textVertexArrayObject.dispose(),this.textVertexArrayObject=null);this.textDDVertexArrayObject&&(this.textDDVertexArrayObject.dispose(),this.textDDVertexArrayObject=
null);this._symbolUpdateData=null;return!0};r.pool=new c(r);return r}(f)})},"esri/core/libs/gl-matrix/vec2":function(){define(["./common"],function(x){var r={create:function(){var k=new x.ARRAY_TYPE(2);k[0]=0;k[1]=0;return k},clone:function(k){var a=new x.ARRAY_TYPE(2);a[0]=k[0];a[1]=k[1];return a},fromValues:function(k,a){var b=new x.ARRAY_TYPE(2);b[0]=k;b[1]=a;return b},copy:function(k,a){k[0]=a[0];k[1]=a[1];return k},set:function(k,a,b){k[0]=a;k[1]=b;return k},add:function(k,a,b){k[0]=a[0]+b[0];
k[1]=a[1]+b[1];return k},subtract:function(k,a,b){k[0]=a[0]-b[0];k[1]=a[1]-b[1];return k}};r.sub=r.subtract;r.multiply=function(k,a,b){k[0]=a[0]*b[0];k[1]=a[1]*b[1];return k};r.mul=r.multiply;r.divide=function(k,a,b){k[0]=a[0]/b[0];k[1]=a[1]/b[1];return k};r.div=r.divide;r.ceil=function(k,a){k[0]=Math.ceil(a[0]);k[1]=Math.ceil(a[1]);return k};r.floor=function(k,a){k[0]=Math.floor(a[0]);k[1]=Math.floor(a[1]);return k};r.min=function(k,a,b){k[0]=Math.min(a[0],b[0]);k[1]=Math.min(a[1],b[1]);return k};
r.max=function(k,a,b){k[0]=Math.max(a[0],b[0]);k[1]=Math.max(a[1],b[1]);return k};r.round=function(k,a){k[0]=Math.round(a[0]);k[1]=Math.round(a[1]);return k};r.scale=function(k,a,b){k[0]=a[0]*b;k[1]=a[1]*b;return k};r.scaleAndAdd=function(k,a,b,c){k[0]=a[0]+b[0]*c;k[1]=a[1]+b[1]*c;return k};r.distance=function(k,a){var b=a[0]-k[0];k=a[1]-k[1];return Math.sqrt(b*b+k*k)};r.dist=r.distance;r.squaredDistance=function(k,a){var b=a[0]-k[0];k=a[1]-k[1];return b*b+k*k};r.sqrDist=r.squaredDistance;r.length=
function(k){var a=k[0];k=k[1];return Math.sqrt(a*a+k*k)};r.len=r.length;r.squaredLength=function(k){var a=k[0];k=k[1];return a*a+k*k};r.sqrLen=r.squaredLength;r.negate=function(k,a){k[0]=-a[0];k[1]=-a[1];return k};r.inverse=function(k,a){k[0]=1/a[0];k[1]=1/a[1];return k};r.normalize=function(k,a){var b=a[0],c=a[1],b=b*b+c*c;0<b&&(b=1/Math.sqrt(b),k[0]=a[0]*b,k[1]=a[1]*b);return k};r.dot=function(k,a){return k[0]*a[0]+k[1]*a[1]};r.cross=function(k,a,b){a=a[0]*b[1]-a[1]*b[0];k[0]=k[1]=0;k[2]=a;return k};
r.lerp=function(k,a,b,c){var t=a[0];a=a[1];k[0]=t+c*(b[0]-t);k[1]=a+c*(b[1]-a);return k};r.random=function(k,a){a=a||1;var b=2*x.RANDOM()*Math.PI;k[0]=Math.cos(b)*a;k[1]=Math.sin(b)*a;return k};r.transformMat2=function(k,a,b){var c=a[0];a=a[1];k[0]=b[0]*c+b[2]*a;k[1]=b[1]*c+b[3]*a;return k};r.transformMat2d=function(k,a,b){var c=a[0];a=a[1];k[0]=b[0]*c+b[2]*a+b[4];k[1]=b[1]*c+b[3]*a+b[5];return k};r.transformMat3=function(k,a,b){var c=a[0];a=a[1];k[0]=b[0]*c+b[3]*a+b[6];k[1]=b[1]*c+b[4]*a+b[7];return k};
r.transformMat4=function(k,a,b){var c=a[0];a=a[1];k[0]=b[0]*c+b[4]*a+b[12];k[1]=b[1]*c+b[5]*a+b[13];return k};r.forEach=function(){var k=r.create();return function(a,b,c,t,n,f){b||(b=2);c||(c=0);for(t=t?Math.min(t*b+c,a.length):a.length;c<t;c+=b)k[0]=a[c],k[1]=a[c+1],n(k,k,f),a[c]=k[0],a[c+1]=k[1];return a}}();r.str=function(k){return"vec2("+k[0]+", "+k[1]+")"};r.exactEquals=function(k,a){return k[0]===a[0]&&k[1]===a[1]};r.equals=function(k,a){var b=k[0];k=k[1];var c=a[0];a=a[1];return Math.abs(b-
c)<=x.EPSILON*Math.max(1,Math.abs(b),Math.abs(c))&&Math.abs(k-a)<=x.EPSILON*Math.max(1,Math.abs(k),Math.abs(a))};return r})},"esri/core/libs/gl-matrix/common":function(){define([],function(){var x={EPSILON:1E-6};x.ARRAY_TYPE="undefined"!==typeof Float32Array?Float32Array:Array;x.RANDOM=Math.random;x.ENABLE_SIMD=!1;x.SIMD_AVAILABLE=x.ARRAY_TYPE===Float32Array&&"SIMD"in this;x.USE_SIMD=x.ENABLE_SIMD&&x.SIMD_AVAILABLE;x.setMatrixArrayType=function(k){x.ARRAY_TYPE=k};var r=Math.PI/180;x.toRadian=function(k){return k*
r};x.equals=function(k,a){return Math.abs(k-a)<=x.EPSILON*Math.max(1,Math.abs(k),Math.abs(a))};return x})},"esri/core/libs/gl-matrix/mat4":function(){define(["./common"],function(x){var r={scalar:{},SIMD:{},create:function(){var k=new x.ARRAY_TYPE(16);k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},clone:function(k){var a=new x.ARRAY_TYPE(16);a[0]=k[0];a[1]=k[1];a[2]=k[2];a[3]=k[3];a[4]=k[4];a[5]=k[5];a[6]=k[6];a[7]=k[7];
a[8]=k[8];a[9]=k[9];a[10]=k[10];a[11]=k[11];a[12]=k[12];a[13]=k[13];a[14]=k[14];a[15]=k[15];return a},copy:function(k,a){k[0]=a[0];k[1]=a[1];k[2]=a[2];k[3]=a[3];k[4]=a[4];k[5]=a[5];k[6]=a[6];k[7]=a[7];k[8]=a[8];k[9]=a[9];k[10]=a[10];k[11]=a[11];k[12]=a[12];k[13]=a[13];k[14]=a[14];k[15]=a[15];return k},fromValues:function(k,a,b,c,t,n,f,q,l,r,B,v,w,D,F,G){var p=new x.ARRAY_TYPE(16);p[0]=k;p[1]=a;p[2]=b;p[3]=c;p[4]=t;p[5]=n;p[6]=f;p[7]=q;p[8]=l;p[9]=r;p[10]=B;p[11]=v;p[12]=w;p[13]=D;p[14]=F;p[15]=G;
return p},set:function(k,a,b,c,t,n,f,q,l,r,B,v,w,D,F,x,p){k[0]=a;k[1]=b;k[2]=c;k[3]=t;k[4]=n;k[5]=f;k[6]=q;k[7]=l;k[8]=r;k[9]=B;k[10]=v;k[11]=w;k[12]=D;k[13]=F;k[14]=x;k[15]=p;return k},identity:function(k){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k}};r.scalar.transpose=function(k,a){if(k===a){var b=a[1],c=a[2],t=a[3],n=a[6],f=a[7],q=a[11];k[1]=a[4];k[2]=a[8];k[3]=a[12];k[4]=b;k[6]=a[9];k[7]=a[13];k[8]=c;k[9]=n;k[11]=
a[14];k[12]=t;k[13]=f;k[14]=q}else k[0]=a[0],k[1]=a[4],k[2]=a[8],k[3]=a[12],k[4]=a[1],k[5]=a[5],k[6]=a[9],k[7]=a[13],k[8]=a[2],k[9]=a[6],k[10]=a[10],k[11]=a[14],k[12]=a[3],k[13]=a[7],k[14]=a[11],k[15]=a[15];return k};r.SIMD.transpose=function(k,a){var b,c,t,n,f,q;b=SIMD.Float32x4.load(a,0);c=SIMD.Float32x4.load(a,4);t=SIMD.Float32x4.load(a,8);a=SIMD.Float32x4.load(a,12);n=SIMD.Float32x4.shuffle(b,c,0,1,4,5);f=SIMD.Float32x4.shuffle(t,a,0,1,4,5);q=SIMD.Float32x4.shuffle(n,f,0,2,4,6);n=SIMD.Float32x4.shuffle(n,
f,1,3,5,7);SIMD.Float32x4.store(k,0,q);SIMD.Float32x4.store(k,4,n);n=SIMD.Float32x4.shuffle(b,c,2,3,6,7);f=SIMD.Float32x4.shuffle(t,a,2,3,6,7);b=SIMD.Float32x4.shuffle(n,f,0,2,4,6);c=SIMD.Float32x4.shuffle(n,f,1,3,5,7);SIMD.Float32x4.store(k,8,b);SIMD.Float32x4.store(k,12,c);return k};r.transpose=x.USE_SIMD?r.SIMD.transpose:r.scalar.transpose;r.scalar.invert=function(k,a){var b=a[0],c=a[1],t=a[2],n=a[3],f=a[4],q=a[5],l=a[6],r=a[7],B=a[8],v=a[9],w=a[10],D=a[11],F=a[12],x=a[13],p=a[14];a=a[15];var z=
b*q-c*f,A=b*l-t*f,J=b*r-n*f,I=c*l-t*q,K=c*r-n*q,L=t*r-n*l,O=B*x-v*F,P=B*p-w*F,U=B*a-D*F,N=v*p-w*x,R=v*a-D*x,S=w*a-D*p,T=z*S-A*R+J*N+I*U-K*P+L*O;if(!T)return null;T=1/T;k[0]=(q*S-l*R+r*N)*T;k[1]=(t*R-c*S-n*N)*T;k[2]=(x*L-p*K+a*I)*T;k[3]=(w*K-v*L-D*I)*T;k[4]=(l*U-f*S-r*P)*T;k[5]=(b*S-t*U+n*P)*T;k[6]=(p*J-F*L-a*A)*T;k[7]=(B*L-w*J+D*A)*T;k[8]=(f*R-q*U+r*O)*T;k[9]=(c*U-b*R-n*O)*T;k[10]=(F*K-x*J+a*z)*T;k[11]=(v*J-B*K-D*z)*T;k[12]=(q*P-f*N-l*O)*T;k[13]=(b*N-c*P+t*O)*T;k[14]=(x*A-F*I-p*z)*T;k[15]=(B*I-v*
A+w*z)*T;return k};r.SIMD.invert=function(k,a){var b,c,t,n,f,q,l,r;f=SIMD.Float32x4.load(a,0);q=SIMD.Float32x4.load(a,4);l=SIMD.Float32x4.load(a,8);r=SIMD.Float32x4.load(a,12);a=SIMD.Float32x4.shuffle(f,q,0,1,4,5);c=SIMD.Float32x4.shuffle(l,r,0,1,4,5);b=SIMD.Float32x4.shuffle(a,c,0,2,4,6);c=SIMD.Float32x4.shuffle(c,a,1,3,5,7);a=SIMD.Float32x4.shuffle(f,q,2,3,6,7);n=SIMD.Float32x4.shuffle(l,r,2,3,6,7);t=SIMD.Float32x4.shuffle(a,n,0,2,4,6);n=SIMD.Float32x4.shuffle(n,a,1,3,5,7);a=SIMD.Float32x4.mul(t,
n);a=SIMD.Float32x4.swizzle(a,1,0,3,2);f=SIMD.Float32x4.mul(c,a);q=SIMD.Float32x4.mul(b,a);a=SIMD.Float32x4.swizzle(a,2,3,0,1);f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(c,a),f);q=SIMD.Float32x4.sub(SIMD.Float32x4.mul(b,a),q);q=SIMD.Float32x4.swizzle(q,2,3,0,1);a=SIMD.Float32x4.mul(c,t);a=SIMD.Float32x4.swizzle(a,1,0,3,2);f=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,a),f);r=SIMD.Float32x4.mul(b,a);a=SIMD.Float32x4.swizzle(a,2,3,0,1);f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(n,a));r=SIMD.Float32x4.sub(SIMD.Float32x4.mul(b,
a),r);r=SIMD.Float32x4.swizzle(r,2,3,0,1);a=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,2,3,0,1),n);a=SIMD.Float32x4.swizzle(a,1,0,3,2);t=SIMD.Float32x4.swizzle(t,2,3,0,1);f=SIMD.Float32x4.add(SIMD.Float32x4.mul(t,a),f);l=SIMD.Float32x4.mul(b,a);a=SIMD.Float32x4.swizzle(a,2,3,0,1);f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(t,a));l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(b,a),l);l=SIMD.Float32x4.swizzle(l,2,3,0,1);a=SIMD.Float32x4.mul(b,c);a=SIMD.Float32x4.swizzle(a,1,0,3,2);l=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,
a),l);r=SIMD.Float32x4.sub(SIMD.Float32x4.mul(t,a),r);a=SIMD.Float32x4.swizzle(a,2,3,0,1);l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,a),l);r=SIMD.Float32x4.sub(r,SIMD.Float32x4.mul(t,a));a=SIMD.Float32x4.mul(b,n);a=SIMD.Float32x4.swizzle(a,1,0,3,2);q=SIMD.Float32x4.sub(q,SIMD.Float32x4.mul(t,a));l=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,a),l);a=SIMD.Float32x4.swizzle(a,2,3,0,1);q=SIMD.Float32x4.add(SIMD.Float32x4.mul(t,a),q);l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(c,a));a=SIMD.Float32x4.mul(b,t);
a=SIMD.Float32x4.swizzle(a,1,0,3,2);q=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,a),q);r=SIMD.Float32x4.sub(r,SIMD.Float32x4.mul(c,a));a=SIMD.Float32x4.swizzle(a,2,3,0,1);q=SIMD.Float32x4.sub(q,SIMD.Float32x4.mul(n,a));r=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,a),r);b=SIMD.Float32x4.mul(b,f);b=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(b,2,3,0,1),b);b=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(b,1,0,3,2),b);a=SIMD.Float32x4.reciprocalApproximation(b);b=SIMD.Float32x4.sub(SIMD.Float32x4.add(a,a),SIMD.Float32x4.mul(b,
SIMD.Float32x4.mul(a,a)));b=SIMD.Float32x4.swizzle(b,0,0,0,0);if(!b)return null;SIMD.Float32x4.store(k,0,SIMD.Float32x4.mul(b,f));SIMD.Float32x4.store(k,4,SIMD.Float32x4.mul(b,q));SIMD.Float32x4.store(k,8,SIMD.Float32x4.mul(b,l));SIMD.Float32x4.store(k,12,SIMD.Float32x4.mul(b,r));return k};r.invert=x.USE_SIMD?r.SIMD.invert:r.scalar.invert;r.scalar.adjoint=function(k,a){var b=a[0],c=a[1],t=a[2],n=a[3],f=a[4],q=a[5],l=a[6],r=a[7],B=a[8],v=a[9],w=a[10],D=a[11],F=a[12],x=a[13],p=a[14];a=a[15];k[0]=q*
(w*a-D*p)-v*(l*a-r*p)+x*(l*D-r*w);k[1]=-(c*(w*a-D*p)-v*(t*a-n*p)+x*(t*D-n*w));k[2]=c*(l*a-r*p)-q*(t*a-n*p)+x*(t*r-n*l);k[3]=-(c*(l*D-r*w)-q*(t*D-n*w)+v*(t*r-n*l));k[4]=-(f*(w*a-D*p)-B*(l*a-r*p)+F*(l*D-r*w));k[5]=b*(w*a-D*p)-B*(t*a-n*p)+F*(t*D-n*w);k[6]=-(b*(l*a-r*p)-f*(t*a-n*p)+F*(t*r-n*l));k[7]=b*(l*D-r*w)-f*(t*D-n*w)+B*(t*r-n*l);k[8]=f*(v*a-D*x)-B*(q*a-r*x)+F*(q*D-r*v);k[9]=-(b*(v*a-D*x)-B*(c*a-n*x)+F*(c*D-n*v));k[10]=b*(q*a-r*x)-f*(c*a-n*x)+F*(c*r-n*q);k[11]=-(b*(q*D-r*v)-f*(c*D-n*v)+B*(c*r-n*
q));k[12]=-(f*(v*p-w*x)-B*(q*p-l*x)+F*(q*w-l*v));k[13]=b*(v*p-w*x)-B*(c*p-t*x)+F*(c*w-t*v);k[14]=-(b*(q*p-l*x)-f*(c*p-t*x)+F*(c*l-t*q));k[15]=b*(q*w-l*v)-f*(c*w-t*v)+B*(c*l-t*q);return k};r.SIMD.adjoint=function(k,a){var b,c,t,n,f,q,l,r;b=SIMD.Float32x4.load(a,0);c=SIMD.Float32x4.load(a,4);t=SIMD.Float32x4.load(a,8);n=SIMD.Float32x4.load(a,12);q=SIMD.Float32x4.shuffle(b,c,0,1,4,5);f=SIMD.Float32x4.shuffle(t,n,0,1,4,5);a=SIMD.Float32x4.shuffle(q,f,0,2,4,6);f=SIMD.Float32x4.shuffle(f,q,1,3,5,7);q=SIMD.Float32x4.shuffle(b,
c,2,3,6,7);c=SIMD.Float32x4.shuffle(t,n,2,3,6,7);b=SIMD.Float32x4.shuffle(q,c,0,2,4,6);c=SIMD.Float32x4.shuffle(c,q,1,3,5,7);q=SIMD.Float32x4.mul(b,c);q=SIMD.Float32x4.swizzle(q,1,0,3,2);t=SIMD.Float32x4.mul(f,q);n=SIMD.Float32x4.mul(a,q);q=SIMD.Float32x4.swizzle(q,2,3,0,1);t=SIMD.Float32x4.sub(SIMD.Float32x4.mul(f,q),t);n=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,q),n);n=SIMD.Float32x4.swizzle(n,2,3,0,1);q=SIMD.Float32x4.mul(f,b);q=SIMD.Float32x4.swizzle(q,1,0,3,2);t=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,
q),t);r=SIMD.Float32x4.mul(a,q);q=SIMD.Float32x4.swizzle(q,2,3,0,1);t=SIMD.Float32x4.sub(t,SIMD.Float32x4.mul(c,q));r=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,q),r);r=SIMD.Float32x4.swizzle(r,2,3,0,1);q=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,2,3,0,1),c);q=SIMD.Float32x4.swizzle(q,1,0,3,2);b=SIMD.Float32x4.swizzle(b,2,3,0,1);t=SIMD.Float32x4.add(SIMD.Float32x4.mul(b,q),t);l=SIMD.Float32x4.mul(a,q);q=SIMD.Float32x4.swizzle(q,2,3,0,1);t=SIMD.Float32x4.sub(t,SIMD.Float32x4.mul(b,q));l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,
q),l);l=SIMD.Float32x4.swizzle(l,2,3,0,1);q=SIMD.Float32x4.mul(a,f);q=SIMD.Float32x4.swizzle(q,1,0,3,2);l=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,q),l);r=SIMD.Float32x4.sub(SIMD.Float32x4.mul(b,q),r);q=SIMD.Float32x4.swizzle(q,2,3,0,1);l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(c,q),l);r=SIMD.Float32x4.sub(r,SIMD.Float32x4.mul(b,q));q=SIMD.Float32x4.mul(a,c);q=SIMD.Float32x4.swizzle(q,1,0,3,2);n=SIMD.Float32x4.sub(n,SIMD.Float32x4.mul(b,q));l=SIMD.Float32x4.add(SIMD.Float32x4.mul(f,q),l);q=SIMD.Float32x4.swizzle(q,
2,3,0,1);n=SIMD.Float32x4.add(SIMD.Float32x4.mul(b,q),n);l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(f,q));q=SIMD.Float32x4.mul(a,b);q=SIMD.Float32x4.swizzle(q,1,0,3,2);n=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,q),n);r=SIMD.Float32x4.sub(r,SIMD.Float32x4.mul(f,q));q=SIMD.Float32x4.swizzle(q,2,3,0,1);n=SIMD.Float32x4.sub(n,SIMD.Float32x4.mul(c,q));r=SIMD.Float32x4.add(SIMD.Float32x4.mul(f,q),r);SIMD.Float32x4.store(k,0,t);SIMD.Float32x4.store(k,4,n);SIMD.Float32x4.store(k,8,l);SIMD.Float32x4.store(k,
12,r);return k};r.adjoint=x.USE_SIMD?r.SIMD.adjoint:r.scalar.adjoint;r.determinant=function(k){var a=k[0],b=k[1],c=k[2],t=k[3],n=k[4],f=k[5],q=k[6],l=k[7],r=k[8],B=k[9],v=k[10],w=k[11],D=k[12],F=k[13],x=k[14];k=k[15];return(a*f-b*n)*(v*k-w*x)-(a*q-c*n)*(B*k-w*F)+(a*l-t*n)*(B*x-v*F)+(b*q-c*f)*(r*k-w*D)-(b*l-t*f)*(r*x-v*D)+(c*l-t*q)*(r*F-B*D)};r.SIMD.multiply=function(k,a,b){var c=SIMD.Float32x4.load(a,0),t=SIMD.Float32x4.load(a,4),n=SIMD.Float32x4.load(a,8);a=SIMD.Float32x4.load(a,12);var f=SIMD.Float32x4.load(b,
0),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,1,1,1,1),t),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,2,2,2,2),n),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,3,3,3,3),a))));SIMD.Float32x4.store(k,0,f);f=SIMD.Float32x4.load(b,4);f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,1,1,1,1),t),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,
2,2,2,2),n),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,3,3,3,3),a))));SIMD.Float32x4.store(k,4,f);f=SIMD.Float32x4.load(b,8);f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,1,1,1,1),t),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,2,2,2,2),n),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(f,3,3,3,3),a))));SIMD.Float32x4.store(k,8,f);b=SIMD.Float32x4.load(b,12);c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,
0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,1,1,1,1),t),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,2,2,2,2),n),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,3,3,3,3),a))));SIMD.Float32x4.store(k,12,c);return k};r.scalar.multiply=function(k,a,b){var c=a[0],t=a[1],n=a[2],f=a[3],q=a[4],l=a[5],r=a[6],B=a[7],v=a[8],w=a[9],D=a[10],F=a[11],x=a[12],p=a[13],z=a[14];a=a[15];var A=b[0],J=b[1],I=b[2],K=b[3];k[0]=A*c+J*q+I*v+K*x;k[1]=A*t+J*l+I*w+K*p;k[2]=A*n+J*
r+I*D+K*z;k[3]=A*f+J*B+I*F+K*a;A=b[4];J=b[5];I=b[6];K=b[7];k[4]=A*c+J*q+I*v+K*x;k[5]=A*t+J*l+I*w+K*p;k[6]=A*n+J*r+I*D+K*z;k[7]=A*f+J*B+I*F+K*a;A=b[8];J=b[9];I=b[10];K=b[11];k[8]=A*c+J*q+I*v+K*x;k[9]=A*t+J*l+I*w+K*p;k[10]=A*n+J*r+I*D+K*z;k[11]=A*f+J*B+I*F+K*a;A=b[12];J=b[13];I=b[14];K=b[15];k[12]=A*c+J*q+I*v+K*x;k[13]=A*t+J*l+I*w+K*p;k[14]=A*n+J*r+I*D+K*z;k[15]=A*f+J*B+I*F+K*a;return k};r.multiply=x.USE_SIMD?r.SIMD.multiply:r.scalar.multiply;r.mul=r.multiply;r.scalar.translate=function(k,a,b){var c=
b[0],t=b[1];b=b[2];var n,f,q,l,r,B,v,w,D,F,x,p;a===k?(k[12]=a[0]*c+a[4]*t+a[8]*b+a[12],k[13]=a[1]*c+a[5]*t+a[9]*b+a[13],k[14]=a[2]*c+a[6]*t+a[10]*b+a[14],k[15]=a[3]*c+a[7]*t+a[11]*b+a[15]):(n=a[0],f=a[1],q=a[2],l=a[3],r=a[4],B=a[5],v=a[6],w=a[7],D=a[8],F=a[9],x=a[10],p=a[11],k[0]=n,k[1]=f,k[2]=q,k[3]=l,k[4]=r,k[5]=B,k[6]=v,k[7]=w,k[8]=D,k[9]=F,k[10]=x,k[11]=p,k[12]=n*c+r*t+D*b+a[12],k[13]=f*c+B*t+F*b+a[13],k[14]=q*c+v*t+x*b+a[14],k[15]=l*c+w*t+p*b+a[15]);return k};r.SIMD.translate=function(k,a,b){var c=
SIMD.Float32x4.load(a,0),t=SIMD.Float32x4.load(a,4),n=SIMD.Float32x4.load(a,8),f=SIMD.Float32x4.load(a,12);b=SIMD.Float32x4(b[0],b[1],b[2],0);a!==k&&(k[0]=a[0],k[1]=a[1],k[2]=a[2],k[3]=a[3],k[4]=a[4],k[5]=a[5],k[6]=a[6],k[7]=a[7],k[8]=a[8],k[9]=a[9],k[10]=a[10],k[11]=a[11]);c=SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(b,0,0,0,0));t=SIMD.Float32x4.mul(t,SIMD.Float32x4.swizzle(b,1,1,1,1));n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(b,2,2,2,2));a=SIMD.Float32x4.add(c,SIMD.Float32x4.add(t,SIMD.Float32x4.add(n,
f)));SIMD.Float32x4.store(k,12,a);return k};r.translate=x.USE_SIMD?r.SIMD.translate:r.scalar.translate;r.scalar.scale=function(k,a,b){var c=b[0],t=b[1];b=b[2];k[0]=a[0]*c;k[1]=a[1]*c;k[2]=a[2]*c;k[3]=a[3]*c;k[4]=a[4]*t;k[5]=a[5]*t;k[6]=a[6]*t;k[7]=a[7]*t;k[8]=a[8]*b;k[9]=a[9]*b;k[10]=a[10]*b;k[11]=a[11]*b;k[12]=a[12];k[13]=a[13];k[14]=a[14];k[15]=a[15];return k};r.SIMD.scale=function(k,a,b){var c;b=SIMD.Float32x4(b[0],b[1],b[2],0);c=SIMD.Float32x4.load(a,0);SIMD.Float32x4.store(k,0,SIMD.Float32x4.mul(c,
SIMD.Float32x4.swizzle(b,0,0,0,0)));c=SIMD.Float32x4.load(a,4);SIMD.Float32x4.store(k,4,SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(b,1,1,1,1)));c=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(k,8,SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(b,2,2,2,2)));k[12]=a[12];k[13]=a[13];k[14]=a[14];k[15]=a[15];return k};r.scale=x.USE_SIMD?r.SIMD.scale:r.scalar.scale;r.rotate=function(k,a,b,c){var t=c[0],n=c[1];c=c[2];var f=Math.sqrt(t*t+n*n+c*c),q,l,r,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N;if(Math.abs(f)<x.EPSILON)return null;
f=1/f;t*=f;n*=f;c*=f;q=Math.sin(b);l=Math.cos(b);r=1-l;b=a[0];f=a[1];B=a[2];v=a[3];w=a[4];D=a[5];F=a[6];G=a[7];p=a[8];z=a[9];A=a[10];J=a[11];I=t*t*r+l;K=n*t*r+c*q;L=c*t*r-n*q;O=t*n*r-c*q;P=n*n*r+l;U=c*n*r+t*q;N=t*c*r+n*q;t=n*c*r-t*q;n=c*c*r+l;k[0]=b*I+w*K+p*L;k[1]=f*I+D*K+z*L;k[2]=B*I+F*K+A*L;k[3]=v*I+G*K+J*L;k[4]=b*O+w*P+p*U;k[5]=f*O+D*P+z*U;k[6]=B*O+F*P+A*U;k[7]=v*O+G*P+J*U;k[8]=b*N+w*t+p*n;k[9]=f*N+D*t+z*n;k[10]=B*N+F*t+A*n;k[11]=v*N+G*t+J*n;a!==k&&(k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);
return k};r.scalar.rotateX=function(k,a,b){var c=Math.sin(b);b=Math.cos(b);var t=a[4],n=a[5],f=a[6],q=a[7],l=a[8],r=a[9],B=a[10],v=a[11];a!==k&&(k[0]=a[0],k[1]=a[1],k[2]=a[2],k[3]=a[3],k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);k[4]=t*b+l*c;k[5]=n*b+r*c;k[6]=f*b+B*c;k[7]=q*b+v*c;k[8]=l*b-t*c;k[9]=r*b-n*c;k[10]=B*b-f*c;k[11]=v*b-q*c;return k};r.SIMD.rotateX=function(k,a,b){var c=SIMD.Float32x4.splat(Math.sin(b));b=SIMD.Float32x4.splat(Math.cos(b));a!==k&&(k[0]=a[0],k[1]=a[1],k[2]=a[2],k[3]=a[3],
k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);var t=SIMD.Float32x4.load(a,4);a=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(k,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(t,b),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(k,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,b),SIMD.Float32x4.mul(t,c)));return k};r.rotateX=x.USE_SIMD?r.SIMD.rotateX:r.scalar.rotateX;r.scalar.rotateY=function(k,a,b){var c=Math.sin(b);b=Math.cos(b);var t=a[0],n=a[1],f=a[2],q=a[3],l=a[8],r=a[9],B=a[10],v=a[11];a!==k&&(k[4]=a[4],
k[5]=a[5],k[6]=a[6],k[7]=a[7],k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);k[0]=t*b-l*c;k[1]=n*b-r*c;k[2]=f*b-B*c;k[3]=q*b-v*c;k[8]=t*c+l*b;k[9]=n*c+r*b;k[10]=f*c+B*b;k[11]=q*c+v*b;return k};r.SIMD.rotateY=function(k,a,b){var c=SIMD.Float32x4.splat(Math.sin(b));b=SIMD.Float32x4.splat(Math.cos(b));a!==k&&(k[4]=a[4],k[5]=a[5],k[6]=a[6],k[7]=a[7],k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);var t=SIMD.Float32x4.load(a,0);a=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(k,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(t,
b),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(k,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(t,c),SIMD.Float32x4.mul(a,b)));return k};r.rotateY=x.USE_SIMD?r.SIMD.rotateY:r.scalar.rotateY;r.scalar.rotateZ=function(k,a,b){var c=Math.sin(b);b=Math.cos(b);var t=a[0],n=a[1],f=a[2],q=a[3],l=a[4],r=a[5],B=a[6],v=a[7];a!==k&&(k[8]=a[8],k[9]=a[9],k[10]=a[10],k[11]=a[11],k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);k[0]=t*b+l*c;k[1]=n*b+r*c;k[2]=f*b+B*c;k[3]=q*b+v*c;k[4]=l*b-t*c;k[5]=r*b-n*c;k[6]=B*b-f*
c;k[7]=v*b-q*c;return k};r.SIMD.rotateZ=function(k,a,b){var c=SIMD.Float32x4.splat(Math.sin(b));b=SIMD.Float32x4.splat(Math.cos(b));a!==k&&(k[8]=a[8],k[9]=a[9],k[10]=a[10],k[11]=a[11],k[12]=a[12],k[13]=a[13],k[14]=a[14],k[15]=a[15]);var t=SIMD.Float32x4.load(a,0);a=SIMD.Float32x4.load(a,4);SIMD.Float32x4.store(k,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(t,b),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(k,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,b),SIMD.Float32x4.mul(t,c)));return k};r.rotateZ=x.USE_SIMD?
r.SIMD.rotateZ:r.scalar.rotateZ;r.fromTranslation=function(k,a){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=a[0];k[13]=a[1];k[14]=a[2];k[15]=1;return k};r.fromScaling=function(k,a){k[0]=a[0];k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=a[1];k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=a[2];k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.fromRotation=function(k,a,b){var c=b[0],t=b[1];b=b[2];var n=Math.sqrt(c*c+t*t+b*b),f;if(Math.abs(n)<x.EPSILON)return null;n=1/n;c*=n;
t*=n;b*=n;n=Math.sin(a);a=Math.cos(a);f=1-a;k[0]=c*c*f+a;k[1]=t*c*f+b*n;k[2]=b*c*f-t*n;k[3]=0;k[4]=c*t*f-b*n;k[5]=t*t*f+a;k[6]=b*t*f+c*n;k[7]=0;k[8]=c*b*f+t*n;k[9]=t*b*f-c*n;k[10]=b*b*f+a;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.fromXRotation=function(k,a){var b=Math.sin(a);a=Math.cos(a);k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=a;k[6]=b;k[7]=0;k[8]=0;k[9]=-b;k[10]=a;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.fromYRotation=function(k,a){var b=Math.sin(a);a=Math.cos(a);k[0]=a;k[1]=
0;k[2]=-b;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=b;k[9]=0;k[10]=a;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.fromZRotation=function(k,a){var b=Math.sin(a);a=Math.cos(a);k[0]=a;k[1]=b;k[2]=0;k[3]=0;k[4]=-b;k[5]=a;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.fromRotationTranslation=function(k,a,b){var c=a[0],t=a[1],n=a[2],f=a[3],q=c+c,l=t+t,r=n+n;a=c*q;var B=c*l,c=c*r,v=t*l,t=t*r,n=n*r,q=f*q,l=f*l,f=f*r;k[0]=1-(v+n);k[1]=B+f;k[2]=c-l;k[3]=0;k[4]=
B-f;k[5]=1-(a+n);k[6]=t+q;k[7]=0;k[8]=c+l;k[9]=t-q;k[10]=1-(a+v);k[11]=0;k[12]=b[0];k[13]=b[1];k[14]=b[2];k[15]=1;return k};r.getTranslation=function(k,a){k[0]=a[12];k[1]=a[13];k[2]=a[14];return k};r.getRotation=function(k,a){var b=a[0]+a[5]+a[10],c=0;0<b?(c=2*Math.sqrt(b+1),k[3]=.25*c,k[0]=(a[6]-a[9])/c,k[1]=(a[8]-a[2])/c,k[2]=(a[1]-a[4])/c):a[0]>a[5]&a[0]>a[10]?(c=2*Math.sqrt(1+a[0]-a[5]-a[10]),k[3]=(a[6]-a[9])/c,k[0]=.25*c,k[1]=(a[1]+a[4])/c,k[2]=(a[8]+a[2])/c):a[5]>a[10]?(c=2*Math.sqrt(1+a[5]-
a[0]-a[10]),k[3]=(a[8]-a[2])/c,k[0]=(a[1]+a[4])/c,k[1]=.25*c,k[2]=(a[6]+a[9])/c):(c=2*Math.sqrt(1+a[10]-a[0]-a[5]),k[3]=(a[1]-a[4])/c,k[0]=(a[8]+a[2])/c,k[1]=(a[6]+a[9])/c,k[2]=.25*c);return k};r.fromRotationTranslationScale=function(k,a,b,c){var t=a[0],n=a[1],f=a[2],q=a[3],l=t+t,r=n+n,B=f+f;a=t*l;var v=t*r,t=t*B,w=n*r,n=n*B,f=f*B,l=q*l,r=q*r,q=q*B,B=c[0],D=c[1];c=c[2];k[0]=(1-(w+f))*B;k[1]=(v+q)*B;k[2]=(t-r)*B;k[3]=0;k[4]=(v-q)*D;k[5]=(1-(a+f))*D;k[6]=(n+l)*D;k[7]=0;k[8]=(t+r)*c;k[9]=(n-l)*c;k[10]=
(1-(a+w))*c;k[11]=0;k[12]=b[0];k[13]=b[1];k[14]=b[2];k[15]=1;return k};r.fromRotationTranslationScaleOrigin=function(k,a,b,c,t){var n=a[0],f=a[1],q=a[2],l=a[3],r=n+n,B=f+f,v=q+q;a=n*r;var w=n*B,n=n*v,D=f*B,f=f*v,q=q*v,r=l*r,B=l*B,l=l*v,v=c[0],F=c[1];c=c[2];var x=t[0],p=t[1];t=t[2];k[0]=(1-(D+q))*v;k[1]=(w+l)*v;k[2]=(n-B)*v;k[3]=0;k[4]=(w-l)*F;k[5]=(1-(a+q))*F;k[6]=(f+r)*F;k[7]=0;k[8]=(n+B)*c;k[9]=(f-r)*c;k[10]=(1-(a+D))*c;k[11]=0;k[12]=b[0]+x-(k[0]*x+k[4]*p+k[8]*t);k[13]=b[1]+p-(k[1]*x+k[5]*p+k[9]*
t);k[14]=b[2]+t-(k[2]*x+k[6]*p+k[10]*t);k[15]=1;return k};r.fromQuat=function(k,a){var b=a[0],c=a[1],t=a[2];a=a[3];var n=b+b,f=c+c,q=t+t,b=b*n,l=c*n,c=c*f,r=t*n,B=t*f,t=t*q,n=a*n,f=a*f;a*=q;k[0]=1-c-t;k[1]=l+a;k[2]=r-f;k[3]=0;k[4]=l-a;k[5]=1-b-t;k[6]=B+n;k[7]=0;k[8]=r+f;k[9]=B-n;k[10]=1-b-c;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k};r.frustum=function(k,a,b,c,t,n,f){var q=1/(b-a),l=1/(t-c),r=1/(n-f);k[0]=2*n*q;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2*n*l;k[6]=0;k[7]=0;k[8]=(b+a)*q;k[9]=(t+c)*l;k[10]=
(f+n)*r;k[11]=-1;k[12]=0;k[13]=0;k[14]=f*n*2*r;k[15]=0;return k};r.perspective=function(k,a,b,c,t){a=1/Math.tan(a/2);var n=1/(c-t);k[0]=a/b;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=a;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=(t+c)*n;k[11]=-1;k[12]=0;k[13]=0;k[14]=2*t*c*n;k[15]=0;return k};r.perspectiveFromFieldOfView=function(k,a,b,c){var t=Math.tan(a.upDegrees*Math.PI/180),n=Math.tan(a.downDegrees*Math.PI/180),f=Math.tan(a.leftDegrees*Math.PI/180);a=Math.tan(a.rightDegrees*Math.PI/180);var q=2/(f+a),l=2/(t+n);k[0]=
q;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=l;k[6]=0;k[7]=0;k[8]=-((f-a)*q*.5);k[9]=(t-n)*l*.5;k[10]=c/(b-c);k[11]=-1;k[12]=0;k[13]=0;k[14]=c*b/(b-c);k[15]=0;return k};r.ortho=function(k,a,b,c,t,n,f){var q=1/(a-b),l=1/(c-t),r=1/(n-f);k[0]=-2*q;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=-2*l;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=2*r;k[11]=0;k[12]=(a+b)*q;k[13]=(t+c)*l;k[14]=(f+n)*r;k[15]=1;return k};r.lookAt=function(k,a,b,c){var t,n,f,q,l,y,B,v,w=a[0],D=a[1];a=a[2];f=c[0];q=c[1];n=c[2];B=b[0];c=b[1];t=b[2];if(Math.abs(w-
B)<x.EPSILON&&Math.abs(D-c)<x.EPSILON&&Math.abs(a-t)<x.EPSILON)return r.identity(k);b=w-B;c=D-c;B=a-t;v=1/Math.sqrt(b*b+c*c+B*B);b*=v;c*=v;B*=v;t=q*B-n*c;n=n*b-f*B;f=f*c-q*b;(v=Math.sqrt(t*t+n*n+f*f))?(v=1/v,t*=v,n*=v,f*=v):f=n=t=0;q=c*f-B*n;l=B*t-b*f;y=b*n-c*t;(v=Math.sqrt(q*q+l*l+y*y))?(v=1/v,q*=v,l*=v,y*=v):y=l=q=0;k[0]=t;k[1]=q;k[2]=b;k[3]=0;k[4]=n;k[5]=l;k[6]=c;k[7]=0;k[8]=f;k[9]=y;k[10]=B;k[11]=0;k[12]=-(t*w+n*D+f*a);k[13]=-(q*w+l*D+y*a);k[14]=-(b*w+c*D+B*a);k[15]=1;return k};r.str=function(k){return"mat4("+
k[0]+", "+k[1]+", "+k[2]+", "+k[3]+", "+k[4]+", "+k[5]+", "+k[6]+", "+k[7]+", "+k[8]+", "+k[9]+", "+k[10]+", "+k[11]+", "+k[12]+", "+k[13]+", "+k[14]+", "+k[15]+")"};r.frob=function(k){return Math.sqrt(Math.pow(k[0],2)+Math.pow(k[1],2)+Math.pow(k[2],2)+Math.pow(k[3],2)+Math.pow(k[4],2)+Math.pow(k[5],2)+Math.pow(k[6],2)+Math.pow(k[7],2)+Math.pow(k[8],2)+Math.pow(k[9],2)+Math.pow(k[10],2)+Math.pow(k[11],2)+Math.pow(k[12],2)+Math.pow(k[13],2)+Math.pow(k[14],2)+Math.pow(k[15],2))};r.add=function(k,a,
b){k[0]=a[0]+b[0];k[1]=a[1]+b[1];k[2]=a[2]+b[2];k[3]=a[3]+b[3];k[4]=a[4]+b[4];k[5]=a[5]+b[5];k[6]=a[6]+b[6];k[7]=a[7]+b[7];k[8]=a[8]+b[8];k[9]=a[9]+b[9];k[10]=a[10]+b[10];k[11]=a[11]+b[11];k[12]=a[12]+b[12];k[13]=a[13]+b[13];k[14]=a[14]+b[14];k[15]=a[15]+b[15];return k};r.subtract=function(k,a,b){k[0]=a[0]-b[0];k[1]=a[1]-b[1];k[2]=a[2]-b[2];k[3]=a[3]-b[3];k[4]=a[4]-b[4];k[5]=a[5]-b[5];k[6]=a[6]-b[6];k[7]=a[7]-b[7];k[8]=a[8]-b[8];k[9]=a[9]-b[9];k[10]=a[10]-b[10];k[11]=a[11]-b[11];k[12]=a[12]-b[12];
k[13]=a[13]-b[13];k[14]=a[14]-b[14];k[15]=a[15]-b[15];return k};r.sub=r.subtract;r.multiplyScalar=function(k,a,b){k[0]=a[0]*b;k[1]=a[1]*b;k[2]=a[2]*b;k[3]=a[3]*b;k[4]=a[4]*b;k[5]=a[5]*b;k[6]=a[6]*b;k[7]=a[7]*b;k[8]=a[8]*b;k[9]=a[9]*b;k[10]=a[10]*b;k[11]=a[11]*b;k[12]=a[12]*b;k[13]=a[13]*b;k[14]=a[14]*b;k[15]=a[15]*b;return k};r.multiplyScalarAndAdd=function(k,a,b,c){k[0]=a[0]+b[0]*c;k[1]=a[1]+b[1]*c;k[2]=a[2]+b[2]*c;k[3]=a[3]+b[3]*c;k[4]=a[4]+b[4]*c;k[5]=a[5]+b[5]*c;k[6]=a[6]+b[6]*c;k[7]=a[7]+b[7]*
c;k[8]=a[8]+b[8]*c;k[9]=a[9]+b[9]*c;k[10]=a[10]+b[10]*c;k[11]=a[11]+b[11]*c;k[12]=a[12]+b[12]*c;k[13]=a[13]+b[13]*c;k[14]=a[14]+b[14]*c;k[15]=a[15]+b[15]*c;return k};r.exactEquals=function(k,a){return k[0]===a[0]&&k[1]===a[1]&&k[2]===a[2]&&k[3]===a[3]&&k[4]===a[4]&&k[5]===a[5]&&k[6]===a[6]&&k[7]===a[7]&&k[8]===a[8]&&k[9]===a[9]&&k[10]===a[10]&&k[11]===a[11]&&k[12]===a[12]&&k[13]===a[13]&&k[14]===a[14]&&k[15]===a[15]};r.equals=function(k,a){var b=k[0],c=k[1],t=k[2],n=k[3],f=k[4],q=k[5],l=k[6],r=k[7],
B=k[8],v=k[9],w=k[10],D=k[11],F=k[12],G=k[13],p=k[14];k=k[15];var z=a[0],A=a[1],J=a[2],I=a[3],K=a[4],L=a[5],O=a[6],P=a[7],U=a[8],N=a[9],R=a[10],S=a[11],T=a[12],V=a[13],h=a[14];a=a[15];return Math.abs(b-z)<=x.EPSILON*Math.max(1,Math.abs(b),Math.abs(z))&&Math.abs(c-A)<=x.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(t-J)<=x.EPSILON*Math.max(1,Math.abs(t),Math.abs(J))&&Math.abs(n-I)<=x.EPSILON*Math.max(1,Math.abs(n),Math.abs(I))&&Math.abs(f-K)<=x.EPSILON*Math.max(1,Math.abs(f),Math.abs(K))&&
Math.abs(q-L)<=x.EPSILON*Math.max(1,Math.abs(q),Math.abs(L))&&Math.abs(l-O)<=x.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(r-P)<=x.EPSILON*Math.max(1,Math.abs(r),Math.abs(P))&&Math.abs(B-U)<=x.EPSILON*Math.max(1,Math.abs(B),Math.abs(U))&&Math.abs(v-N)<=x.EPSILON*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(w-R)<=x.EPSILON*Math.max(1,Math.abs(w),Math.abs(R))&&Math.abs(D-S)<=x.EPSILON*Math.max(1,Math.abs(D),Math.abs(S))&&Math.abs(F-T)<=x.EPSILON*Math.max(1,Math.abs(F),Math.abs(T))&&Math.abs(G-
V)<=x.EPSILON*Math.max(1,Math.abs(G),Math.abs(V))&&Math.abs(p-h)<=x.EPSILON*Math.max(1,Math.abs(p),Math.abs(h))&&Math.abs(k-a)<=x.EPSILON*Math.max(1,Math.abs(k),Math.abs(a))};return r})},"esri/views/2d/engine/DisplayObject":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","./Evented"],function(x,r,k,a){return function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;b._renderRequestedCalled=!1;b._attached=!1;b._opacity=1;b.renderRequested=!1;b._visible=!0;
return b}k(b,a);Object.defineProperty(b.prototype,"attached",{get:function(){return this._attached},set:function(a){this._attached!==a&&((this._attached=a)?this.hasEventListener("attach")&&this.emit("attach"):this.hasEventListener("detach")&&this.emit("detach"))},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"opacity",{get:function(){return this._opacity},set:function(a){this._opacity!==a&&(this._opacity=a,this.requestRender())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
"visible",{get:function(){return this._visible},set:function(a){this._visible!==a&&(this._visible=a,this.requestRender())},enumerable:!0,configurable:!0});b.prototype.attach=function(a){return!0};b.prototype.detach=function(a){};b.prototype.processRender=function(a){this._renderRequestedCalled=!1;this.doRender(a);this._renderRequestedCalled||(this.renderRequested=!1);this.hasEventListener("post-render")&&this.emit("post-render")};b.prototype.requestRender=function(){var a=this.renderRequested;this.renderRequested=
this._renderRequestedCalled=!0;this.parent&&this.parent.requestChildRender(this);a!==this.renderRequested&&this.hasEventListener("will-render")&&this.emit("will-render")};b.prototype.dispose=function(){};return b}(a.Evented)})},"esri/views/2d/engine/Evented":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","dojo/aspect","dojo/on"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function c(){}c.prototype.on=function(b,c){return a.after(this,
"on"+b,c,!0)};c.prototype.once=function(a,c){return b.once(this,a,c)};c.prototype.emit=function(a){b.emit(this,a,this)};c.prototype.hasEventListener=function(a){a="on"+a;return!(!this[a]||!this[a].after)};return c}();r.Evented=x;r.EventedMixin=function(c){return function(c){function n(){return null!==c&&c.apply(this,arguments)||this}k(n,c);n.prototype.on=function(b,c){return a.after(this,"on"+b,c,!0)};n.prototype.once=function(a,c){return b.once(this,a,c)};n.prototype.emit=function(a,c){b.emit(this,
a,c)};n.prototype.hasEventListener=function(a){a="on"+a;return!(!this[a]||!this[a].after)};return n}(c)}})},"esri/views/vectorTiles/RenderBucket":function(){define(["require","exports","../../core/tsSupport/extendsHelper","../../core/tsSupport/decorateHelper"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});x=function(){return function(a){this.type=a}}();r.RenderBucket=x;a=function(a){function b(){var b=a.call(this,2)||this;b.triangleElementStart=0;b.triangleElementCount=0;b.joinStart=
0;b.joinCount=0;return b}k(b,a);b.prototype.hasData=function(){return 0<this.triangleElementCount||0<this.joinCount};return b}(x);r.LineRenderBucket=a;a=function(a){function b(){var b=a.call(this,1)||this;b.triangleElementStart=0;b.triangleElementCount=0;b.outlineElementStart=0;b.outlineElementCount=0;return b}k(b,a);b.prototype.hasData=function(){return 0<this.triangleElementCount||0<this.outlineElementCount};return b}(x);r.FillRenderBucket=a;a=function(a){function b(){var b=a.call(this,3)||this;
b.markerPerPageElementsMap=new Map;b.glyphPerPageElementsMap=new Map;b.isSDF=!1;return b}k(b,a);b.prototype.hasData=function(){return 0<this.markerPerPageElementsMap.size||0<this.glyphPerPageElementsMap.size};return b}(x);r.SymbolRenderBucket=a;x=function(a){function b(){return a.call(this,0)||this}k(b,a);b.prototype.hasData=function(){return!0};return b}(x);r.BackgroundRenderBucket=x})},"esri/views/3d/terrain/ElevationTileAgent":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/ObjectPool ./TerrainConst ./TileAgentBase ./UpsampleInfo".split(" "),
function(x,r,k,a,b,c,t){return function(c){function f(){var a=null!==c&&c.apply(this,arguments)||this;a._scaleRangeEnabled=!1;return a}k(f,c);f.prototype.dataArrived=function(a){a!==this.tile?this._setUpsamplingTile(a):(this._unsetUpsamplingTile(),this.updateGeometry());this._dataRequested=null;this._requestNext()};f.prototype.updateGeometry=function(){this._tileLayerInfo.pendingUpdates|=b.TileUpdateTypes.UPDATE_GEOMETRY;this.tile.updateGeometry()};f.prototype._findAncestorWithData=function(){for(var a=
this.layerClass,c=this.layerIdx,f=this.tile,k=f.vlevel,n;f&&!(f.layerInfo[a][c].data&&(n=f,k-f.lij[0]>=b.ELEVATION_DESIRED_RESOLUTION_LEVEL));)f=f.parent;return n?(a=t.Pool.acquire(),a.init(n,0,0,1),a):null};f.prototype._desiredMinLevelDelta=function(){return b.ELEVATION_DESIRED_RESOLUTION_LEVEL-(this.tile.vlevel-this.tile.lij[0])};f.prototype._setUpsamplingTile=function(a){this._unsetUpsamplingTile();var b=t.Pool.acquire();b.init(a,0,0,1);this._tileLayerInfo.upsampleFromTile=b;this.updateGeometry()};
f.Pool=new a(f);return f}(c)})},"esri/views/3d/terrain/MapTileAgent":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/ObjectPool ./TileAgentBase ./tileUtils".split(" "),function(x,r,k,a,b,c){return function(b){function n(){var a=b.call(this)||this;a._scaleRangeEnabled=!0;return a}k(n,b);n.prototype.dataArrived=function(a){a!==this.tile?this._setUpsamplingTile(a):(this._unsetUpsamplingTile(),this.tile.updateTexture());this._dataRequested=null;a!==this.tile&&this._requestNext()};
n.prototype._desiredMinLevelDelta=function(){return 0};n.prototype._setUpsamplingTile=function(a){this._tileLayerInfo.upsampleFromTile&&this._tileLayerInfo.upsampleFromTile.tile===a||(this._unsetUpsamplingTile(),this._tileLayerInfo.upsampleFromTile=c.computeUpsampleInfoForAncestor(this.tile,a),this.tile.updateTexture())};n.Pool=new a(n);return n}(b)})},"esri/views/3d/terrain/TileGeometryFactory":function(){define("../webgl-engine/lib/Geometry ../webgl-engine/lib/GeometryData ../lib/glMatrix ../support/earthUtils ../support/mathUtils ./TerrainConst".split(" "),
function(x,r,k,a,b,c){function t(a,b,c,f,l){a<f[0]&&(f[0]=a);a>l[0]&&(l[0]=a);b<f[1]&&(f[1]=b);b>l[1]&&(l[1]=b);c<f[2]&&(f[2]=c);c>l[2]&&(l[2]=c)}function n(a,f,l){for(var k=0;k<l.length;k++){var n=l[k];if(n){var p=n.safeWidth,q=n.width,t=n.pixelData,r=b.clamp(n.dy*(n.y1-f),0,p),n=b.clamp(n.dx*(a-n.x0),0,p),p=Math.floor(r),v=Math.floor(n),y=p*q+v,h=y+q,A=t[y],q=t[h],y=t[y+1],t=t[h+1];if(A+q+y+t<.5*c.ELEVATION_NODATA_VALUE)return r-=p,n-=v,a=A+(y-A)*n,a+(q+(t-q)*n-a)*r}}return null}var f=a.earthRadius,
q=k.vec3d,l=b.lerp,y=function(){var a=q.create(),b=q.create(),c=q.create(),f,l,k;this.init=function(n,p){l=n;k=p;q.subtract(c,b,a);f=.5*q.length(a);q.lerp(b,c,.5,a)};this.getCenter=function(){return a};this.getBSRadius=function(){return f};this.getBBMin=function(){return b};this.getBBMax=function(){return c};this.getPosition=function(){return l};this.getIndices=function(){return k};this.getPrimitiveIndices=function(){};this.getChildren=function(){}},B=function(a,b,c,l){a*=f;for(var k=0;k<=b;k++)c[5*
l]=0,c[5*l+1]=0,c[5*l+2]=a,l++},v=new function(){var a=Array(50),b=0,c={};this.get=function(l){var k=c[l];k||(k={ptr:0,data:Array(50)},c[l]=k);0<k.ptr?(f.vertexArrayHits++,l=k.data[--k.ptr],k.data[k.ptr]=null):(f.vertexArrayMisses++,l=new Float32Array(l));if(0<b)return f.geometryHits++,k=a[--b],a[b]=null,k.getData().getVertexAttr().terrain.data=l,k;f.geometryMisses++;k={};k.terrain={size:5,data:l};l=new y;return new x(new r(k,{terrain:null}),"tile",l)};this.put=function(f){var l=f.getData(),k=l.getVertexAttr(),
n=k.terrain.data,p=c[n.length];50>p.ptr&&(p.data[p.ptr++]=n);k.terrain.data=null;l.indices.terrain=null;50>b&&(a[b++]=f)};var f={geometryHits:0,geometryMisses:0,vertexArrayHits:0,vertexArrayMisses:0};this.stats=f;this._pools={geometry:a,vertexArray:c}},w=[],D=Array(c.MAX_TILE_TESSELATION+1),F=Array(c.MAX_TILE_TESSELATION+1),G=Array(c.MAX_TILE_TESSELATION+1),p=Array(c.MAX_TILE_TESSELATION+1),z={values:null,numSurfaceIndices:0,numSkirtIndices:0},A=function(a,b,c){c||(a.values=b.values);a.numSurfaceIndices=
b.numSurfaceIndices;a.numSkirtIndices=b.numSkirtIndices;return a},J=function(a,b,c,f,l){var k;k=z;var n=c&2,p=b+(f?1024:0)+(n?2048:0),q=w[p];k||(k={});if(q)A(k,q);else{var q=b-1,t=b-1,r=b*b,h=2*q+2*t,v=q*t*6,y=6*h,e=6*(2*q+t-1);f&&(v*=2,y*=2,e*=2);for(var h=65536<r+h?new Uint32Array(v+y):new Uint16Array(v+y),d=0,g=0,m=v,u,B,D,I,F=0,x=0;x<=t;x++){n&&(F=0===x?e:x===t?-e:0);for(var m=m+F,J=0;J<=q;J++)I=B=-1,0===x&&(B=r+J,J!==q&&(I=d+1)),J===q&&(B=r+q+x,x<t&&(I=d+q+1)),x===t&&(B=r+q+t+(q-J),0<J&&(I=d-
1)),0===J&&0<x&&(B=r+2*q+t+(t-x),I=d-(q+1)),-1<B&&(D=0===J&&1===x?r:B+1,-1<I&&(u=d,f?(h[m+0]=u,h[m+1]=B,h[m+2]=B,h[m+3]=D,h[m+4]=D,h[m+5]=u,h[m+6]=D,h[m+7]=I,h[m+8]=I,h[m+9]=u,h[m+10]=u,h[m+11]=D,m+=12):(h[m+0]=u,h[m+1]=B,h[m+2]=D,h[m+3]=D,h[m+4]=I,h[m+5]=u,m+=6))),++d,J<q&&x<t&&(u=x*(q+1)+J,B=u+1,D=B+(q+1),I=D-1,f?(h[g+0]=u,h[g+1]=B,h[g+2]=B,h[g+3]=D,h[g+4]=D,h[g+5]=u,h[g+6]=D,h[g+7]=I,h[g+8]=I,h[g+9]=u,h[g+10]=u,h[g+11]=D,g+=12):(h[g+0]=u,h[g+1]=B,h[g+2]=D,h[g+3]=D,h[g+4]=I,h[g+5]=u,g+=6));m-=F}k.values=
h;k.numSurfaceIndices=v;k.numSkirtIndices=y;w[p]=A({},k)}n=a.getData();p=n.getAttribute("terrain");n.indices.terrain=k.values;a.getBoundingInfo().init(p,k.values);l||(l={});l.geometry=a;l.numWithoutSkirtIndices=k.numSurfaceIndices+(c?6*(b-1)*(f?2:1):0);l.numVertsPerRow=b;return A(l,k,!0)};return{createPlanarGlobeTile:function(a,b,c,f,l,k,p){var r=b[0],y=b[1],A=b[2]-r;b=b[3]-y;var w=.1*A,h=a-1,B=a-1,z=a*a,e=v.get(5*(z+(2*h+2*B))),d=e.getData().getVertexAttr().terrain.data,g,m,u=0;g=e.getBoundingInfo();
var C=g.getBBMin(),D=g.getBBMax();q.set3(1E7,1E7,1E7,C);q.set3(-1E7,-1E7,-1E7,D);for(m=0;m<=B;m++){var I=m/B,F=y+I*b;k&&(F<k[1]?(F=k[1],I=(F-y)/b):F>k[3]&&(F=k[3],I=(F-y)/b));for(g=0;g<=h;g++){var x=g/h,K=r+x*A;k&&(K<k[0]?(K=k[0],x=(K-r)/A):K>k[2]&&(K=k[2],x=(K-r)/A));var G=c?n(K,F,c)||0:0,K=K-f[0],L=F-f[1],G=G-f[2];t(K,L,G,C,D);d[5*u]=K;d[5*u+1]=L;d[5*u+2]=G;d[5*u+3]=x;d[5*u+4]=I;var O=-1;0===m&&(O=z+g);g===h&&(O=z+h+m);m===B&&(O=z+h+B+(h-g));0===g&&0<m&&(O=z+2*h+B+(B-m));-1<O&&(d[5*O]=K,d[5*O+1]=
L,d[5*O+2]=G-w,d[5*O+3]=x,d[5*O+4]=I,t(K,L,G-w,C,D));++u}}return J(e,a,0,l,p)},createSphericalGlobeTile:function(a,b,c,k,r,y,A,w,z){var I=c[0],x=c[1],h=c[2],K=c[3],L=Math.max(.9,1-.5*(h-I));c=a-1;var e=a-1,d=a*a,g=v.get(5*(d+(2*c+2*e))),m=g.getData().getVertexAttr().terrain.data,u=b[2]-b[0],C=b[3]-b[1],M=h-I,h=y[0],O=y[1];y=y[2];var P=g.getBoundingInfo(),N=P.getBBMin(),P=P.getBBMax();q.set3(1E7,1E7,1E7,N);q.set3(-1E7,-1E7,-1E7,P);var R;for(R=0;R<=c;R++){var U=R/c,S=I+U*M;D[R]=Math.sin(S);F[R]=Math.cos(S);
G[R]=U;p[R]=b[0]+U*u}for(I=u=0;I<=e;I++){M=I/e;R=l(x,K,M);var S=Math.cos(R),ja=Math.sin(R),ga;k?(ga=f/2*Math.log((1+ja)/(1-ja)),M=(ga-b[1])/C):ga=180*R/Math.PI;for(R=0;R<=c;R++){var U=G[R],la=D[R],ia=F[R],Z=f;r&&(Z+=n(p[R],ga,r)||0);var ia=ia*S*Z,la=la*S*Z,Z=ja*Z,pa=ia-h,ma=la-O,sa=Z-y;t(pa,ma,sa,N,P);var E=5*u;m[E+0]=pa;m[E+1]=ma;m[E+2]=sa;m[E+3]=U;m[E+4]=M;E=-1;0===I&&(E=d+R);R===c&&(E=d+c+I);I===e&&(E=d+c+e+(c-R));0===R&&0<I&&(E=d+2*c+e+(e-I));-1<E&&(ia=ia*L-h,la=la*L-O,Z=Z*L-y,t(ia,la,Z,N,P),
E*=5,m[E+0]=ia,m[E+1]=la,m[E+2]=Z,m[E+3]=U,m[E+4]=M);++u}}k&&(b=!!(A&2),A&1&&B(-1,c,m,d),b&&B(1,c,m,d+c+e));return J(g,a,k?A:0,w,z)},releaseGeometry:v.put,elevationSampler:n,_geometryObjectPool:v}})},"esri/views/3d/webgl-engine/lib/Geometry":function(){define("require exports ./IdGen ./Util ./BoundingInfo ./ComponentUtils ./Util".split(" "),function(x,r,k,a,b,c,t){return function(){function n(a,b,c){this.singleUse=!1;this.componentAABB=null;this.id=n.__idGen.gen(b);this.data=a;this.boundingInfo=c}
n.prototype.getId=function(){return this.id};n.prototype.getData=function(){return this.data};n.prototype.getComponentCount=function(){return c.componentCount(this.data.componentOffsets)};n.prototype.getComponentAABB=function(a,b){null==this.componentAABB&&(this.componentAABB=this._computeComponentAABB());for(var c=0;6>c;c++)b[c]=this.componentAABB[6*a+c];return b};n.prototype._computeComponentAABB=function(){for(var a=this.getComponentCount(),b=new Float32Array(6*a),c=0;c<a;c++)this._calculateAABB(c,
b,6*c);return b};n.prototype._calculateAABB=function(a,b,c){void 0===c&&(c=0);var f=this.data.getIndices(t.VertexAttrConstants.POSITION),l=this.data.getAttribute(t.VertexAttrConstants.POSITION),k=this.data.componentOffsets,n=k.length?k[a+1]:f.length,q=Infinity,r=Infinity,x=Infinity,p=-Infinity,z=-Infinity,A=-Infinity,J=l.offsetIdx,I=l.strideIdx;for(a=k.length?k[a]:0;a<n;a++)var K=J+I*f[a],k=l.data[K],L=l.data[K+1],K=l.data[K+2],q=Math.min(q,k),r=Math.min(r,L),x=Math.min(x,K),p=Math.max(p,k),z=Math.max(z,
L),A=Math.max(A,K);b?(b[c]=q,b[c+1]=r,b[c+2]=x,b[c+3]=p,b[c+4]=z,b[c+5]=A):b=[q,r,x,p,z,A];return b};n.prototype.calculateBoundingInfo=function(){var c=this.data.getIndices(t.VertexAttrConstants.POSITION),k=this.data.getAttribute(t.VertexAttrConstants.POSITION),l="triangle"===this.data.primitiveType?3:1;if(0===c.length)for(var c=new Uint32Array(l),n=0;n<l;++n)c[n]=n;n=c.length;a.assert(0===n%l);for(var r=n/l,v=new Uint32Array(r),n=0;n<r;++n)v[n]=n;return new b(v,l,c,k)};n.prototype.getBoundingInfo=
function(){null==this.boundingInfo&&(this.boundingInfo=this.calculateBoundingInfo());return this.boundingInfo};n.prototype.invalidateBoundingInfo=function(){this.boundingInfo=null};n.__idGen=new k;return n}()})},"esri/views/3d/webgl-engine/lib/BoundingInfo":function(){define(["require","exports","./Util","./gl-matrix"],function(x,r,k,a){var b=a.vec3d;return function(){function a(a,c,f,q){k.assert(1<=a.length);k.assert(0===f.length%c);k.assert(f.length>=a.length*c);k.assert(3===q.size||4===q.size);
this.primitiveIndices=a;this.indices=f;this._position=q;this._numIndexPerPrimitive=c;var l=q.data,n=q.offsetIdx;q=q.strideIdx;var t=a.length,r=n+q*f[c*a[0]];this.bbMin=b.createFrom(l[r],l[r+1],l[r+2]);this.bbMax=b.create(this.bbMin);for(var w=0;w<t;++w)for(var D=c*a[w],x=0;x<c;++x)for(var r=n+q*f[D+x],G=0;3>G;++G){var p=l[r+G];p<this.bbMin[G]?this.bbMin[G]=p:p>this.bbMax[G]&&(this.bbMax[G]=p)}this.center=b.create();b.lerp(this.bbMin,this.bbMax,.5,this.center);for(w=this.bsRadius=0;w<t;++w)for(D=c*
a[w],x=0;x<c;++x)r=n+q*f[D+x],G=l[r]-this.center[0],p=l[r+1]-this.center[1],r=l[r+2]-this.center[2],r=G*G+p*p+r*r,r>this.bsRadius&&(this.bsRadius=r);this.bsRadius=Math.sqrt(this.bsRadius)}a.prototype.getCenter=function(){return this.center};a.prototype.getBSRadius=function(){return this.bsRadius};a.prototype.getBBMin=function(){return this.bbMin};a.prototype.getBBMax=function(){return this.bbMax};a.prototype.getPrimitiveIndices=function(){return this.primitiveIndices};a.prototype.getIndices=function(){return this.indices};
a.prototype.getPosition=function(){return this._position};a.prototype.getChildren=function(){if(this.children)return this.children;if(1<b.dist2(this.bbMin,this.bbMax)){for(var c=b.lerp(this.bbMin,this.bbMax,.5,b.create()),k=this.primitiveIndices.length,f=new Uint8Array(k),q=Array(8),l=0;8>l;++l)q[l]=0;for(var l=this._position,r=l.data,B=l.offsetIdx,v=l.strideIdx,l=0;l<k;++l){for(var w=0,D=this._numIndexPerPrimitive*this.primitiveIndices[l],x=B+v*this.indices[D],G=r[x],p=r[x+1],z=r[x+2],A=1;A<this._numIndexPerPrimitive;++A){var x=
B+v*this.indices[D+A],J=r[x],I=r[x+1],x=r[x+2];J<G&&(G=J);I<p&&(p=I);x<z&&(z=x)}G<c[0]&&(w|=1);p<c[1]&&(w|=2);z<c[2]&&(w|=4);f[l]=w;++q[w]}for(l=c=0;8>l;++l)0<q[l]&&++c;if(2>c)return;c=Array(8);for(l=0;8>l;++l)c[l]=0<q[l]?new Uint32Array(q[l]):void 0;for(l=0;8>l;++l)q[l]=0;for(l=0;l<k;++l)w=f[l],c[w][q[w]++]=this.primitiveIndices[l];this.children=Array(8);for(l=0;8>l;++l)void 0!==c[l]&&(this.children[l]=new a(c[l],this._numIndexPerPrimitive,this.indices,this._position))}return this.children};return a}()})},
"esri/views/3d/terrain/SphericalTile":function(){define("./TileBase ./TileGeometryFactory ../../../core/ObjectPool ../support/mathUtils ../support/earthUtils ../lib/glMatrix".split(" "),function(x,r,k,a,b,c){var t=c.vec3d,n=b.earthRadius,f=function(a,b,c,f){c=n+c;var l=Math.cos(a);f[0]=Math.cos(b)*l*c;f[1]=Math.sin(b)*l*c;f[2]=Math.sin(a)*c};b=function(a,b,c,f){x.call(this);this.tileUp=t.create();this.obb=Array(8);this._isWebMercator=!1;for(var l=0;8>l;l++)this.obb[l]=t.create();void 0!==a&&this.init(a,
b,c,f)};b.prototype=new x;b.prototype.constructor=b;b.prototype.init=function(b,c,k,r){x.prototype.init.call(this,b,c,k,r);this._isWebMercator=r.spatialReference.isWebMercator;c=this.extentWGS84Rad[0];k=this.extentWGS84Rad[1];r=this.extentWGS84Rad[2];var l=this.extentWGS84Rad[3];b=b[0];var q=a.lerp(k,l,.5),y=a.lerp(c,r,.5);this.edgeLen=(r-c)*Math.cos(0===b?0:Math.min(Math.abs(k),Math.abs(l)))*n;this.curvatureHeight=n-Math.sqrt(n*n-this.edgeLen*this.edgeLen/4);f(q,y,0,this.centerAtSeaLevel);t.set(this.centerAtSeaLevel,
this.tileUp);t.normalize(this.tileUp);this._updateOBB();this.updateRadiusAndCenter()};b.prototype.isVisible=function(a,b){if(!this.intersectsClippingArea)return!1;if(9<this.lij[0]){b=this.obb;for(var c=0;6>c;c++){for(var f=0;8>f&&!(0>a[c][0]*b[f][0]+a[c][1]*b[f][1]+a[c][2]*b[f][2]+a[c][3]);f++);if(8===f)return!1}}else if(b=this.radius,c=this.center,a[0][0]*c[0]+a[0][1]*c[1]+a[0][2]*c[2]+a[0][3]>b||a[1][0]*c[0]+a[1][1]*c[1]+a[1][2]*c[2]+a[1][3]>b||a[2][0]*c[0]+a[2][1]*c[1]+a[2][2]*c[2]+a[2][3]>b||
a[3][0]*c[0]+a[3][1]*c[1]+a[3][2]*c[2]+a[3][3]>b||a[4][0]*c[0]+a[4][1]*c[1]+a[4][2]*c[2]+a[4][3]>b||a[5][0]*c[0]+a[5][1]*c[1]+a[5][2]*c[2]+a[5][3]>b)return!1;return!0};b.prototype.computeElevationBounds=function(){x.prototype.computeElevationBounds.call(this);this._updateOBB()};b.prototype.updateRadiusAndCenter=function(){if(0===this.lij[0])t.set3(0,0,0,this.center),this.radius=n+this.elevationBounds[1];else{x.prototype.updateRadiusAndCenter.call(this);var a=Math.max(t.dist2(this.center,this.obb[0]),
t.dist2(this.center,this.obb[1]));this.radius=Math.sqrt(a)}};b.prototype._numSubdivisionsAtLevel=[128,64,32,16,16,8,8,4];b.prototype.createGeometry=function(a,b,c){var f=this._isPole(this.lij[1],this.lij[0]);a.needsUpdate=!1;return r.createSphericalGlobeTile(a.numVertsPerRow,this.extent,this.extentWGS84Rad,this._isWebMercator,a.samplerData,b,f,c)};b.prototype._updateOBB=function(){var a=this.extentWGS84Rad,b=this.obb,c;for(c=0;2>c;c++){var k=this.elevationBounds[c],r=4*c;f(a[1],a[0],k,b[r++]);f(a[3],
a[0],k,b[r++]);f(a[3],a[2],k,b[r++]);f(a[1],a[2],k,b[r++])}this._isWebMercator&&(a=this._isPole(this.lij[1],this.lij[0]),2===a?(t.set3(0,0,n,b[1]),t.set3(0,0,n,b[2]),t.set3(0,0,n,b[5]),t.set3(0,0,n,b[6])):1===a&&(t.set3(0,0,-n,b[0]),t.set3(0,0,-n,b[3]),t.set3(0,0,-n,b[4]),t.set3(0,0,-n,b[7])))};b.prototype._isPole=function(a,b){var c=0;a===(1<<b)-1&&(c+=1);0===a&&(c+=2);return c};b.Pool=new k(b);return b})},"esri/views/3d/terrain/SurfaceExtentHelper":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/arrayUtils ../../../core/HandleRegistry ../../../geometry/support/webMercatorUtils ../../../views/3d/support/aaBoundingRect ./terrainUtils ./TerrainConst".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){function B(a,b){a&&!a.spatialReference.equals(b)&&(a=f.canProject(a.spatialReference,b)?f.project(a,b):null);return a}Object.defineProperty(r,"__esModule",{value:!0});x=function(c){function f(a){a=c.call(this,a)||this;a._changeListeners=new n;return a}k(f,c);f.prototype.initialize=function(){var a=this;this._changeListeners.add([this.layerViews.on("change",function(){return a.notifyChange("stencilEnabledExtents")})])};f.prototype.destroy=function(){this._changeListeners.destroy();
this._changeListeners=null};Object.defineProperty(f.prototype,"layerViewsExtent",{get:function(){return this._computeLayerViewsExtent()},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"tiledLayersExtent",{get:function(){return this._computeTiledLayersExtent()},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"stencilEnabledExtents",{get:function(){return this._computeStencilEnabledExtents(this.layerViews,this.spatialReference)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
"spatialReference",{set:function(a){this.tilingScheme||this._set("spatialReference",a)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"tilingScheme",{set:function(a){this._set("tilingScheme",a);this._set("spatialReference",a.spatialReference)},enumerable:!0,configurable:!0});f.prototype._computeStencilEnabledExtents=function(a,b){var c=[],f=0;for(a=a.items;f<a.length;f++){var l=a[f].layer;"IntegratedMeshLayer"===l.operationalLayerType&&null!=b&&(l=B(l.fullExtent,b),null!=l&&c.push([l.xmin,
l.ymin,l.xmax,l.ymax]))}return c};a([b.property({readOnly:!0})],f.prototype,"layerViewsExtent",null);a([b.property({readOnly:!0,dependsOn:["spatialReference","tilingScheme"]})],f.prototype,"tiledLayersExtent",null);a([b.property({readOnly:!0,dependsOn:["spatialReference"]})],f.prototype,"stencilEnabledExtents",null);a([b.property()],f.prototype,"spatialReference",null);a([b.property()],f.prototype,"tilingScheme",null);a([b.property()],f.prototype,"defaultTiledLayersExtent",void 0);a([b.property({constructOnly:!0})],
f.prototype,"layers",void 0);a([b.property({constructOnly:!0})],f.prototype,"layerViews",void 0);return f=a([b.subclass()],f)}(b.declared(c));c=function(c){function f(){return null!==c&&c.apply(this,arguments)||this}k(f,c);f.prototype._computeLayerViewsExtent=function(){return this._getGlobalExtent()};f.prototype._computeTiledLayersExtent=function(){return this._getGlobalExtent()};f.prototype._getGlobalExtent=function(){return this.spatialReference.isWebMercator?y.WEBMERCATOR_WORLD_EXTENT:y.GEOGRAPHIC_WORLD_EXTENT};
a([b.property({dependsOn:["spatialReference"]})],f.prototype,"layerViewsExtent",void 0);return f=a([b.subclass()],f)}(b.declared(x));r.SurfaceExtentHelperGlobal=c;x=function(c){function f(){return null!==c&&c.apply(this,arguments)||this}k(f,c);f.prototype.initialize=function(){var a=this;this._changeListeners.add([this.layers.on("change",function(){return a.notifyChange("tiledLayersExtent")}),this.layerViews.on("change",function(){return a.notifyChange("layerViewsExtent")})])};f.prototype._computeLayerViewsExtent=
function(){var a=q.create(q.NEGATIVE_INFINITY),b=this.spatialReference;this.layerViews.forEach(function(c){c.isResolved()&&(c=c.fullExtentInViewSpatialReference||c.layer.fullExtent,(c=B(c,b))&&q.expand(a,c))});var c=q.allFinite(a)?a:null,f=this._get("layerViewsExtent");return t.equals(c,f)?f:c};f.prototype._computeTiledLayersExtent=function(){var a=this.tilingScheme;if(!a)return null;var b=this.spatialReference,c=q.create(q.NEGATIVE_INFINITY);this.layers.forEach(function(f){if(f.loaded&&l.isTiledLayer(f)){var k=
l.getTiledLayerInfo(f,b,"local");f=k.tileInfo;k=k.fullExtent;f&&a.compatibleWith(f)&&k&&k.spatialReference.equals(b)&&q.expand(c,k)}});this.defaultTiledLayersExtent&&q.expand(c,this.defaultTiledLayersExtent);var f=q.allFinite(c)?c:null,k=this._get("tiledLayersExtent");return t.equals(f,k)?k:f};return f=a([b.subclass()],f)}(b.declared(x));r.SurfaceExtentHelperLocal=x})},"esri/views/3d/terrain/SurfaceTilingSchemeLogic":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/HandleRegistry ./terrainUtils ./TilingScheme".split(" "),
function(x,r,k,a,b,c,t,n,f){return function(c){function l(a){a=c.call(this,a)||this;a._changeHandles=new t;return a}k(l,c);l.prototype.initialize=function(){var a=this;this._changeHandles.add(this.layers.on("change",function(){return a._update()}));this._changeHandles.add(this.extentHelper.watch("layerViewsExtent",function(){return a._setAdHocTilingScheme()}));this._update();this.tilingSchemeLocked||this._setAdHocTilingScheme()};l.prototype.destroy=function(){this._changeHandles.destroy();this._changeHandles=
null};l.prototype._update=function(){var a=this;this._waitTask=null;if(!this.tilingSchemeLocked){this._set("tilingSchemeDone",!1);var b=this.layers.find(function(b){return n.isTiledLayer(b)?b.isFulfilled()?b.isRejected()?!1:!!n.getTiledLayerInfo(b,a.viewSpatialReference,a.manifold).tileInfo:!0:!1});if(b)if(b.isResolved()){var c=n.getTiledLayerInfo(b,this.viewSpatialReference,this.manifold).tileInfo,c=new f(c),b=n.getKnownTiledServiceLevelCap(b.url);Infinity>b&&c.capMaxLod(b);this._set("tilingSchemeDone",
!0);this._lockTilingScheme(c)}else this._updateWhen(b);else this._set("tilingSchemeDone",!0)}};l.prototype._updateWhen=function(a){var b=this,c=a.when().always(function(){c===b._waitTask&&b._update()});this._waitTask=c};l.prototype._lockTilingScheme=function(a){var b=this;if("spherical"===this.manifold){var c=a.levels.length-1;a=a.spatialReference.isWebMercator?f.makeWebMercatorAuxiliarySphere(c):f.makeWGS84WithTileSize(a.pixelSize[0],c)}this.tilingSchemeLocked=!0;this.tilingScheme=a;this.extentHelper.tilingScheme=
this.tilingScheme;this._updateTiledLayerExtent();this._changeHandles.removeAll();this._changeHandles.add(this.extentHelper.watch("tiledLayersExtent",function(){return b._updateTiledLayerExtent()}))};l.prototype._updateTiledLayerExtent=function(){this.extent=this.extentHelper.tiledLayersExtent};l.prototype._setAdHocTilingScheme=function(){if("spherical"===this.manifold)this.tilingScheme=this.extentHelper.spatialReference.isWebMercator?f.WebMercatorAuxiliarySphere:f.makeWGS84WithTileSize(256),this.extent=
this.extentHelper.layerViewsExtent;else{var a=this.extentHelper.layerViewsExtent;a&&(this.tilingScheme=f.fromExtent(a,this.extentHelper.spatialReference),this.extent=a)}};a([b.property()],l.prototype,"tilingScheme",void 0);a([b.property()],l.prototype,"extent",void 0);a([b.property({value:!1})],l.prototype,"tilingSchemeLocked",void 0);a([b.property({readOnly:!0,value:!1})],l.prototype,"tilingSchemeDone",void 0);a([b.property({constructOnly:!0})],l.prototype,"viewSpatialReference",void 0);a([b.property({constructOnly:!0})],
l.prototype,"layers",void 0);a([b.property({constructOnly:!0})],l.prototype,"extentHelper",void 0);a([b.property({constructOnly:!0})],l.prototype,"manifold",void 0);return l=a([b.subclass()],l)}(b.declared(c))})},"esri/views/3d/terrain/TerrainRenderer":function(){define("dojo/when ./tileUtils ./TerrainConst ./TileGeometryFactory ./TileRenderData ./ResourceCounter ./TileRenderer ../support/PreallocArray ../../../core/ObjectPool ../../../core/promiseUtils ../support/imageUtils ../webgl-engine/lib/ShaderVariations dojo/text!./TerrainMaterial.xml ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/Util ../lib/glMatrix ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/tracer ../../webgl/Texture ../../webgl/VertexArrayObject ../../webgl/BufferObject ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/screenSizePerspectiveUtils ../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P){var U=w.assert;w=D.vec2d;var N=D.vec3d,R=D.vec4d,S=D.mat4d.identity(),T=[2,2],V=G.OPAQUE_TERRAIN,h=G.TRANSPARENT_TERRAIN,ca=N.create(),Q=w.create();D=function(e,d,g){function m(a,b){a=a.screenDepth;b=b.screenDepth;return a<b?-xa:a>b?xa:0}function u(a,b){return 0===a.tiles.length?-xa:0===b.tiles.length?xa:m(a.tiles.data[0],b.tiles.data[0])}d=d||256;var w,D=!1,G=null,W=null,da=null,fa={},aa,ea,ja=new f(b),ga=new n(10,function(){return{root:null,
tiles:new n(300)}}),la=!0,ia=new r.IteratorPreorder,Z=null,pa=!0,ma=1,sa=!0,E=!1,na={mode:"none",width:1.5,falloff:1.5,wireOpacity:1,surfaceOpacity:0,color:[1,1,1,0],resolution:64},wa=!1,ya=!1,Ba=!1,xa=1,va=!0,ba=!0,Ca=null,za=null,Da=null,Ja=!1,ab=[];this.updateTileBackground=function(a){Da&&Da.cancel();Da=a?l.requestImage(a).otherwise(function(){return null}):q.resolve(null);this.renderTileBackground();return Da};var Xa=0,qa=0,Ga=0,Sa=0;this.resourceCounter=new c;this.castShadows=!0;this.clippingExtent=
null;this.loaded=function(){};var Ya=!1;this.needsRender=!0;this.receiveShadows=this.needsHighlight=this.didRender=!1;var Fa=new n(10),Ta=0,Ua=new n(30),bb=new f(function(){this.extent=R.create();this.maxLevel=this.minLevel=0;this.callback=null},!1);this.renderTileBackground=function(){if(aa&&Da&&za)return Da.then(function(a){za&&(Ja=!0,za.setGridImage(a),G&&r.traverseTilesPreorder(G,function(a){za.updateTileTexture(a)}.bind(this)))}.bind(this))};this.initializeRenderContext=function(a){aa=a.rctx;
ea=a.rctx.gl;var b=function(a){x(a).then(function(){D=!0;this.setNeedsRender()}.bind(this)).otherwise(b)}.bind(this);b(this.renderTileBackground());w=a.textureRep;var e=a.shaderSnippets,c=a.shaderRep;a=a.programRep;e.vsTerrain||e._parse(B);aa.extensions.standardDerivatives;var g=new y("terrain",["vsTerrain","fsTerrain"],null,a,c,e,aa);g.addDefine("Spherical","SPHERICAL");g.addDefine("Overlay","OVERLAY");g.addDefine("Atmosphere","ATMOSPHERE");g.addDefine("Wireframe","WIREFRAME");g.addDefine("TileBorders",
"TILE_BORDERS");g.addBinaryShaderSnippetSuffix("Wireframe","Wireframe",[!1,!0]);g.addDefine("ReceiveShadows","RECEIVE_SHADOWS");g.addDefine("ScreenSizePerspective","SCREEN_SIZE_PERSPECTIVE");c=new y("terrainNormal",["vsTerrainNormal","fsNormal"],null,a,c,e,aa);c.addDefine("Spherical","SPHERICAL");c.addDefine("AlphaZero","ALPHA_ZERO");da={depth:a.get("depth"),depthShadowMap:a.get("depthShadowMap"),depthOnly:new I(aa,e.vsTerrainDepthOnly,e.fsTerrainDepthOnly,K.Default3D),highlight:new I(aa,e.vsTerrainHighlight,
e.fsTerrainHighlight,K.Default3D)};W={color:g,normal:c};this._updatePrograms();za=new t(aa,d,a,this.resourceCounter,this.setNeedsRender.bind(this));this.renderTileBackground();Ca=new z(aa,{target:ea.TEXTURE_2D,pixelFormat:ea.RGBA,dataType:ea.UNSIGNED_BYTE,samplingMode:ea.NEAREST,width:4,height:4})};this.uninitializeRenderContext=function(a){null!=Ca&&(Ca.dispose(),Ca=null);za&&(za.dispose(),za=null)};this._updatePrograms=function(){var a="spherical"===e,b="shader"===na.mode;da.color=W.color.getProgram([a,
!0,a&&ba,b,wa,b||wa,this.receiveShadows,E]);da.normal=W.normal.getProgram([a,!0]);this.setNeedsRender()};this.destroy=function(a){this.uninstall(a);Da&&(Da.cancel(),Da=null)};this.install=function(a){a.addExternalRenderer([V,h],this)};this.uninstall=function(a){a.removeExternalRenderer(this)};this.setRootTiles=function(a){G=a;this.setNeedsRender()};this.setNeedsHighlight=function(a){this.needsHighlight=a;this.setNeedsRender()};this.setStencilEnabledLayerExtents=function(a){ab=a;this.setNeedsRender()};
this.setTileSize=function(a){d=a;za&&(za.tileSize=a);this.setNeedsRender()};this.loadTile=function(a){U(null===a.renderData);a.renderData=ja.acquire();a.renderData.init();var b=this.getLocalOriginOfTile(a),d=a.createGeometry(a.renderData.updateGeometryState(a),b,"debug"===na.mode,a.renderData.geometryInfo);a.renderData.localOrigin=b;this._setTileGeometry(a,d);Ja&&za.updateTileTexture(a)};this.queryVisibleLevelRange=function(a,b,d,e){var c=bb.acquire();R.set(a,c.extent);c.minLevel=b?b:-Number.MAX_VALUE;
c.maxLevel=null!=d?d:Number.MAX_VALUE;c.callback=e;Ua.push(c);this.setNeedsRender()};this.updateTileTexture=function(a){za&&Ja&&za.updateTileTexture(a)};this.updateTileGeometryNeedsUpdate=function(a){return a.renderData.updateGeometryState(a).needsUpdate};this._updateTileGeometry=function(a){for(var b=a.renderData.geometryState,d=a.layerInfo[k.LayerClass.ELEVATION],e=0;e<d.length;e++)d[e].pendingUpdates&=~k.TileUpdateTypes.UPDATE_GEOMETRY;return b.needsUpdate?(a.renderData.vao&&this._releaseTileGeometry(a),
b=a.createGeometry(b,a.renderData.localOrigin,"debug"===na.mode,a.renderData.geometryInfo),this._setTileGeometry(a,b),!0):!1};this.updateTileGeometry=function(a){a.renderData.updateGeometryState(a);return this._updateTileGeometry(a)};this.unloadTile=function(a){this._releaseTileGeometry(a);a.renderData.texture&&a.renderData.texture.dispose();ja.release(a.renderData);a.renderData=null};this.getLocalOriginOfTile=function(a){if(10<=a.lij[0]){for(;7<a.lij[0];)a=a.parent;return a.centerAtSeaLevel}if("spherical"===
e)return ca;for(;a.parent;)a=a.parent;return a.centerAtSeaLevel};this.setVisibility=function(a){pa=a;this.setNeedsRender()};this.getStats=function(){return{numTilesRendered:qa,numTilesCulled:Ga,numTrianglesRendered:Xa,numOriginsRendered:Sa}};this.setDisableRendering=function(a){ya=!!a;this.setNeedsRender()};this.getOpacity=function(){return ma};this.getWireframeEnabled=function(){return"shader"===na.mode};this.setDebugScreenSizePerspective=function(a){a!==E&&(E=a,this._updatePrograms())};this.setWireframe=
function(a){a&&!0!==a||(a={mode:a?"shader":"none"});if(void 0!==a.mode&&na.mode!==a.mode){var b="debug"===na.mode,e="debug"===a.mode;na.mode=a.mode;this._updatePrograms();b!==e&&G&&r.traverseTilesPreorder(G,function(a){if(a.renderData){a.renderData.vao&&this._releaseTileGeometry(a);var b=a.createGeometry(a.renderData.updateGeometryState(a),a.renderData.localOrigin,e,a.renderData.geometryInfo);this._setTileGeometry(a,b)}}.bind(this))}for(var c in a)na.hasOwnProperty(c)&&(na[c]=a[c]),this.setNeedsRender();
na.resolution&&(na.resolution=Math.min(na.resolution,d),na.resolution=1<<Math.round(Math.log(na.resolution)/Math.LN2))};this.setOpacity=function(a){ma=a;this.setNeedsRender()};this.setDrawSkirts=function(a){sa=a;this.setNeedsRender()};this.setCullBackFaces=function(a){Ba=a;this.setNeedsRender()};this.setRenderOrder=function(a){xa=a;this.setNeedsRender()};this.setBorders=function(a){wa!==a&&(wa=a,this._updatePrograms())};this.setFrontMostTransparent=function(a){va!==a&&(va=a,this.setNeedsRender())};
this.setVelvetOverground=function(a){ba!==a&&(ba=a,this._updatePrograms())};this.setNeedsRender=function(){this.needsRender=!0;this.didRender=!1;la=!0};this.resetNeedsRender=function(){this.didRender&&(this.needsRender=0!==Ua.length,this.didRender=!1)};var ka=N.create();this.isTransparent=function(){return 1>ma||"shader"===na.mode&&(1>na.wireOpacity||1>na.surfaceOpacity)};this._renderMaterialPass=function(a,b){var d=this.isTransparent(),e=a.shadowMap&&a.shadowMap.getEnableState();this.receiveShadows!=
e&&(this.receiveShadows=e,this._updatePrograms());e=a.camera;aa.setDepthTestEnabled(!0);aa.setBlendingEnabled(d);d&&aa.setBlendFunctionSeparate(ea.SRC_ALPHA,ea.ONE_MINUS_SRC_ALPHA,ea.ONE,ea.ONE_MINUS_SRC_ALPHA);d&&va?(d=da.depthOnly,aa.bindProgram(d),aa.setColorMask(!1,!1,!1,!1),aa.setDepthWriteEnabled(!0),this._renderTilesAuxiliary(a,d,b),aa.setColorMask(!0,!0,!0,!0),aa.setDepthFunction(ea.EQUAL),aa.setDepthWriteEnabled(!1)):aa.setDepthFunction(ea.LESS);d=da.color;aa.bindProgram(d);d.setUniform1f("opacity",
ma);if("shader"===na.mode||wa)d.setUniform1f("wireframe.width",na.width),d.setUniform1f("wireframe.falloff",Math.min(na.width,na.falloff)),d.setUniform1f("wireframe.wireOpacity",na.wireOpacity*ma),d.setUniform1f("wireframe.surfaceOpacity",na.surfaceOpacity*ma),d.setUniform4fv("wireframe.color",na.color);e=a.camera;a.shadowMap&&a.shadowMap.bind(d);a.ssaoHelper&&a.ssaoHelper.setUniforms(d);d.setUniform1i("tex",4);d.setUniform1i("overlayTex",5);d.setUniformMatrix4fv("viewNormal",e.viewInverseTransposeMatrix);
d.setUniformMatrix4fv("proj",e.projectionMatrix);a.lightingData.helper.setUniforms(d,!0);e=e.viewMatrix;N.set3(e[12],e[13],e[14],ka);N.normalize(ka);d.setUniform3fv("viewDirection",ka);for(Sa=Xa=Ga=qa=0;Fa.length<Fa.data.length&&0<Ua.length;)e=Ua.pop(),Fa.push(e);Ta=Fa.length;this._renderTiles(a,d,b);aa.setBlendingEnabled(!1);aa.setDepthFunction(ea.LESS);aa.setDepthWriteEnabled(!0);for(a=0;a<Fa.length;a++)b=Fa.data[a],bb.release(b),b.callback(a>=Ta),b.callback=null;Fa.clear();0<qa&&!Ya&&(Ya=!0,this.loaded&&
this.loaded())};this._renderDepthPass=function(a,b,d){var e=a.camera;aa.bindProgram(b);aa.setBlendingEnabled(!1);aa.setDepthTestEnabled(!0);aa.setDepthFunction(ea.LESS);b.setUniformMatrix4fv("model",S);b.setUniformMatrix4fv("viewNormal",e.viewInverseTransposeMatrix);Q[0]=e.near;Q[1]=e.far;b.setUniform2fv("nearFar",Q);this._renderTilesAuxiliary(a,b,d)};this._renderNormalPass=function(a,b){var d=a.camera,e=da.normal;aa.bindProgram(e);aa.setBlendingEnabled(!1);aa.setDepthTestEnabled(!0);aa.setDepthFunction(ea.LESS);
e.setUniformMatrix4fv("viewNormal",d.viewInverseTransposeMatrix);this._renderTilesAuxiliary(a,e,b)};this._renderHighlightPass=function(a,b){var d=da.highlight;aa.bindProgram(d);aa.setBlendingEnabled(!1);aa.setDepthTestEnabled(!0);aa.setDepthFunction(ea.LESS);var e=a.offscreenRenderingHelper;aa.bindTexture(e.getDepthTexture(),6);d.setUniform1i("depthTex",6);d.setUniform4f("highlightViewportPixelSz",0,0,1/e.width,1/e.height);this._renderTilesAuxiliary(a,d,b,!0)};this.render=function(a){if(D&&!ya&&pa&&
G&&Ja){var b=this.isTransparent()?h:V;if(a.slot===b){p.trace("# BEGIN RENDER TERRAIN");b=a.pass;aa.setFaceCullingEnabled(Ba);var d=1===a.lightingData.helper.globalFactor;b===F.MATERIAL?this._renderMaterialPass(a,this._updatePerOriginTileData()):b===F.MATERIAL_DEPTH_SHADOWMAP&&this.castShadows&&d?this._renderDepthPass(a,da.depthShadowMap,this._updatePerOriginTileData()):b===F.MATERIAL_DEPTH?this._renderDepthPass(a,da.depth,this._updatePerOriginTileData()):b===F.MATERIAL_NORMAL?this._renderNormalPass(a,
this._updatePerOriginTileData()):b===F.MATERIAL_HIGHLIGHT&&this.needsHighlight&&(this._renderHighlightPass(a,this._updatePerOriginTileData()),aa.clear(aa.gl.DEPTH_BUFFER_BIT));Ba&&aa.setFaceCullingEnabled(!1);p.trace("# END RENDER TERRAIN");return!0}}};this._updatePerOriginTileData=function(){if(!la)return ga;Z=null;this._renderCollectOrigins();if(0!==xa){for(var a=0;a<ga.length;a++)this._sortFrontToBack(ga.data[a].tiles,m);this._sortFrontToBack(ga,u)}la=!1;return ga};this._renderCollectOrigins=function(){ga.clear();
for(var a=0;a<G.length;a++){var b=G[a],d=ga.next();d.root=b;d.origin="spherical"===e?ca:b.centerAtSeaLevel;d.tiles.clear();this._renderCollectOriginsForRoot(d)}return!0};this._renderCollectOriginsForRoot=function(a){for(ia.reset(a.root);!ia.done;){var b=ia.next(),d=b.renderData;if(d&&!b.visible)Ga++,ia.skip();else{var e=ga.peek();if(7===b.lij[0]){if(e===a||0!==e.tiles.length)e=ga.next(),e.tiles.clear();e.root=b;e.origin=b.centerAtSeaLevel}if(d){10<=b.lij[0]?ga.peek().tiles.push(b):a.tiles.push(b);
if(!Z||b.vlevel>Z.vlevel)Z=b;ia.skip()}}}};this._sortFrontToBack=function(a,b){a.sort(b)};this._updateStencilReadStateForTile=function(a,b){if(a.stencilRenderingHelper&&a.stencilRenderingHelper.getEnableState()){for(var d=!1,e=0;e<ab.length;e++)if(b.intersectsExtent(ab[e])){d=!0;break}d?a.stencilRenderingHelper.enableStencilRead():a.stencilRenderingHelper.disableStencilRead()}};this._renderTilesAuxiliary=function(a,b,d,e){var c=a.camera,g=c.viewMatrix,f=a.rctx;b.setUniformMatrix4fv("proj",c.projectionMatrix);
e&&b.setUniform1i("overlayTex",5);for(c=0;c<d.length;c++){var h=d.data[c];b.setUniform3fv("origin",h.origin);v.bindView(h.origin,g,b);for(var m=0;m<h.tiles.length;m++){var l=h.tiles.data[m],k=l.renderData;e&&(k.highlightOverlayTexId?Ka(b,k,k.highlightOverlayTexId):f.bindTexture(Ca,5));this._updateStencilReadStateForTile(a,l);f.bindVAO(k.vao);P.assertCompatibleVertexAttributeLocations(k.vao,b);l=k.vao.indexBuffer.size;sa||(l=k.geometryInfo.numWithoutSkirtIndices);f.drawElements(ea.TRIANGLES,l,k.vao.indexBuffer.indexType,
0)}}f.bindVAO(null);f.stencilRenderingHelper&&f.stencilRenderingHelper.disableStencilRead()};this._renderTiles=function(a,b,c){var f=a.camera.viewMatrix;if(E){var h=O.getSettings(e);h.update({distance:g.distanceToSurface,fovY:g.fovY});v.bindScreenSizePerspective(h,b,"screenSizePerspective")}for(h=0;h<c.length;h++){var m=c.data[h];b.setUniform3fv("origin",m.origin);v.bindView(m.origin,f,b);a.shadowMap&&a.shadowMap.bindView(b,m.origin);Sa++;var l=m.tiles;if(0!==l.length){var k=ea.TRIANGLES;"debug"===
na.mode&&(k=ea.LINES);var n=Z,q;n?(n=n.vlevel,q=d/na.resolution):(n=16,q=d/64);for(var t=0;t<l.length;t++){var r=l.data[t],m=r.renderData;this._updateStencilReadStateForTile(a,r);p.trace("# RENDER TILE "+r.lij[0]+"/"+r.lij[1]+"/"+r.lij[2]+", screenDepth:"+r.screenDepth);b.setUniform2fv("texOffset",m.texOffset);b.setUniform1f("texScale",m.texScale);aa.bindTexture(m.textureReference||m.texture,4);m.overlayTexId?Ka(b,m,m.overlayTexId):(b.setUniform2fv("overlayTexOffset",T),aa.bindTexture(Ca,5));("shader"===
na.mode||wa)&&b.setUniform1f("wireframe.subdivision",q*(1<<n-r.vlevel));var u=m.vao.indexBuffer.size;sa||(u=m.geometryInfo.numWithoutSkirtIndices);aa.bindVAO(m.vao);P.assertCompatibleVertexAttributeLocations(m.vao,b);aa.drawElements(k,u,m.vao.indexBuffer.indexType,0);r.renderOrder=qa;qa++;Xa+=u/3;m=r.extent;r=r.lij[0];for(u=0;u<Ta;){var y=Fa.data[u],A=y.extent;r>=y.minLevel&&r<=y.maxLevel&&A[0]<=m[2]&&A[2]>=m[0]&&A[1]<=m[3]&&A[3]>=m[1]?(Fa.swap(u,Ta-1),Ta--):u++}}}}aa.bindVAO(null);a.stencilRenderingHelper&&
a.stencilRenderingHelper.disableStencilRead()};var Ka=function(a,b,d){var e=fa[d];e||(e=w.aquire(d).getGLTexture(),U(e),fa[d]=e);a.setUniform2fv("overlayTexOffset",b.overlayTexOffset);a.setUniform2fv("overlayTexScale",b.overlayTexScale);a.setUniform1f("overlayOpacity",b.overlayOpacity);aa.bindTexture(e,5)},La=N.create(),Ha=N.create(),Va=N.create(),Ma=this.clippingExtent;this.intersect=function(a,b,d){if(G&&(!a.isSelection||!this.isTransparent())&&a.enableTerrain){N.subtract(d,b,La);var e=a.getMinResult(),
c=a.getMaxResult();ia.reset(G);for(var g={};!ia.done;){var f=ia.next();if(null!==f.renderData){if(a.enableInvisibleTerrain){if(!f.visible&&Ma&&!f.intersectsExtent(Ma))continue}else if(!f.visible)continue;var h=f.renderData.geometryInfo.geometry,m=f.renderData.localOrigin;N.subtract(b,m,Ha);N.subtract(d,m,Va);v.intersectTriangleGeometry(h,g,void 0,a,Ha,Va,function(b,d,g){if((sa||!(3*g>=f.renderData.geometryInfo.numWithoutSkirtIndices))&&0<=b&&(a.enableBackfacesTerrain||0>N.dot(d,La))){if(void 0===
e.dist||b<e.dist)g=r.lij2str(f.lij[0],f.lij[1],f.lij[2]),e.set(void 0,g,b,d,void 0),e.setIntersector("terrain");if(void 0===c.dist||b>c.dist)g=r.lij2str(f.lij[0],f.lij[1],f.lij[2]),c.set(void 0,g,b,d,void 0),c.setIntersector("terrain")}})}}}};this._setTileGeometry=function(b,d){b=b.renderData;var e=d.geometry.getData(),c=e.getVertexAttr().terrain.data,e=e.indices.terrain;b.vao=new A(aa,K.Default3D,{geometry:L.Pos3Tex},{geometry:J.createVertex(aa,ea.STATIC_DRAW,c)},J.createIndex(aa,ea.STATIC_DRAW,
e));b.geometryInfo.geometry&&a.releaseGeometry(b.geometryInfo.geometry);b.geometryInfo=d;this.setNeedsRender()};this._releaseTileGeometry=function(b){b=b.renderData;b.vao.dispose(!0);b.vao=null;b.geometryInfo.geometry&&a.releaseGeometry(b.geometryInfo.geometry);b.geometryInfo.geometry=null;this.setNeedsRender()}};D.TileRenderData=b;return D})},"esri/views/3d/terrain/TileRenderData":function(){define(["require","exports","../lib/glMatrix"],function(x,r,k){var a=k.vec2d;return function(){function b(){this.overlayTexOffset=
a.create();this.texOffset=a.create();this.geometryInfo={geometry:null,numSurfaceIndices:0,numSkirtIndices:0,numWithoutSkirtIndices:0,numVertsPerRow:0};this.init()}b.prototype.init=function(){this.geometryInfo.geometry=null;this.geometryInfo.numSurfaceIndices=0;this.geometryInfo.numSkirtIndices=0;this.geometryInfo.numWithoutSkirtIndices=0;this.geometryInfo.numVertsPerRow=0;this.textureReference=this.texture=this.vao=this.geometryState=null;a.set2(0,0,this.texOffset);this.texScale=1;this.highlightOverlayTexId=
this.overlayTexId=null;this.overlayTexScale=[1,1];this.overlayOpacity=1;this.localOrigin=null};b.prototype.updateGeometryState=function(a){return this.geometryState=a.geometryState(this.geometryState)};return b}()})},"esri/views/3d/terrain/ResourceCounter":function(){define(["require","exports"],function(x,r){return function(){function k(){this._numTileTexturesComposited=0}Object.defineProperty(k.prototype,"numTileTexturesComposited",{get:function(){return this._numTileTexturesComposited},enumerable:!0,
configurable:!0});k.prototype.incrementNumTileTexturesComposited=function(){this._numTileTexturesComposited++};k.prototype.resetNumTileTexturesComposited=function(){this._numTileTexturesComposited=0};return k}()})},"esri/views/3d/terrain/TileRenderer":function(){define("require exports ../lib/glMatrix ../../webgl/FramebufferObject ../../webgl/VertexArrayObject ../../webgl/Texture ../../webgl/BufferObject ../../webgl/Util ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../../vectorTiles/VectorTileDisplayObject ../../vectorTiles/tileRendererHelper3D ./TerrainConst".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){var v=k.vec2d,w=Array(20),D=[0,0];return function(){function k(a,c,l,k,n){this._gridTex=null;this.tileSize=256;this._context=a;this.tileSize=c;this._resourceCounter=k;this._setNeedsRender=n;a.extensions.textureFilterAnisotropic&&(this._maxAnisotropy=Math.min(8,a.parameters.maxMaxAnisotropy));c=new Float32Array(20);c[0]=-1;c[1]=-1;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=-1;c[7]=0;c[8]=1;c[9]=0;c[10]=-1;c[11]=1;c[12]=0;c[13]=0;c[14]=1;c[15]=1;c[16]=1;c[17]=0;c[18]=1;c[19]=
1;this._vaoQuad=new b(a,f.Default3D,{geometry:q.Pos3Tex},{geometry:t.createVertex(a,35044,c)});this._blendLayersProgram=l.get("blendLayers")}k.prototype.dispose=function(){this._fbo&&(this._fbo.dispose(),this._fbo=null);this._vaoQuad&&(this._vaoQuad.dispose(),this._vaoQuad=null);this._gridTex&&(this._gridTex.dispose(),this._gridTex=null);this._blendLayersProgram&&(this._blendLayersProgram.dispose(),this._blendLayersProgram=null);this._context&&(this._context=null)};k.prototype.updateTileTexture=function(a){for(var b=
B.LayerClass.MAP,c=a.layerInfo[b],f=0;f<c.length;f++)c[f].pendingUpdates&=~B.TileUpdateTypes.UPDATE_TEXTURE;if(a.renderData){var l,f=a.renderData,k,n=0,q=!0;for(k=0;k<c.length;k++){l=c[k];var t=a.parentSurface.layerViewByIndex(k,b);w[k]=t.fullOpacity;if(l.data||l.upsampleFromTile)if(n++,!t.isTransparent){q=!1;break}}k===c.length&&k--;0===n&&this._gridTex?(f.textureReference=this._gridTex,v.set2(0,0,f.texOffset),f.texScale=1):1!==n||q?(this._composeMapLayers(a,c,k,q,w),f.textureReference=null,v.set2(0,
0,f.texOffset),f.texScale=1):(l=c[k],l.data?(b=l,v.set2(0,0,f.texOffset),f.texScale=1):(a=l.upsampleFromTile,b=a.tile.layerInfo[b][k],v.set(a.offset,f.texOffset),f.texScale=a.scale),b&&(b.data instanceof HTMLImageElement&&(b.data=this._buildTexture(b.data)),f.textureReference=b.data));this._setNeedsRender()}};k.prototype.setGridImage=function(a){this._gridTex=this._buildTexture(a)};k.prototype._buildTexture=function(a){var b={target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9729,
maxAnisotropy:this._maxAnisotropy,flipped:!0,hasMipmap:!0},f=this._context,l;if(a)try{l=new c(f,b,a)}catch(J){b.width=b.height=this.tileSize,l=new c(f,b),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}else b.width=b.height=this.tileSize,l=new c(f,b);f.bindTexture(l);l.generateMipmap();return l};k.prototype._drawVectorData=function(a,b,c,f,l,k,n,q,t){void 0===t&&(t=1);y(this._context,c,a,b.renderer,b.schemeHelper,c[0],f,l,0,k,n,q,t)};k.prototype._drawRasterData=
function(a,b,c,f){void 0===f&&(f=1);var l=this._context,k=this._blendLayersProgram,p=this._vaoQuad;l.bindProgram(k);l.bindVAO(p);n.assertCompatibleVertexAttributeLocations(p,k);l.bindTexture(a,0);k.setUniform1i("tex",0);k.setUniform1f("scale",b);k.setUniform2f("offset",c[0],c[1]);k.setUniform1f("opacity",f);l.drawArrays(5,0,n.vertexCount(p,"geometry"))};k.prototype._composeMapLayers=function(b,c,f,k,n){var p=B.LayerClass.MAP,q=this._context;b.renderData.texture||(b.renderData.texture=this._buildTexture());
var t=b.renderData.texture,r=this._fbo;r&&r.width===t.descriptor.width&&r.height===t.descriptor.height||(this._fbo=r=a.create(q,{colorTarget:0,depthStencilTarget:1,width:t.descriptor.width,height:t.descriptor.height}));var v=q.gl;q.bindFramebuffer(r);q.setViewport(0,0,this.tileSize,this.tileSize);q.setClearColor(0,0,0,0);q.setClearDepth(1);q.clear(v.COLOR_BUFFER_BIT|v.DEPTH_BUFFER_BIT);q.setDepthTestEnabled(!1);q.setBlendFunctionSeparate(1,771,1,771);q.setBlendEquation(32774);q.setBlendingEnabled(!0);
var y,A,w;for(k&&this._gridTex&&this._drawRasterData(this._gridTex,1,D);0<=f;f--)if(k=null,r=c[f],r.data?(k=r,y=D,A=1):r.upsampleFromTile&&(A=r.upsampleFromTile,k=A.tile.layerInfo[p][f],w=A.tile.lij[0],y=A.offset,A=A.scale),k){if(k.data instanceof HTMLImageElement||k.data instanceof HTMLCanvasElement)k.data=this._buildTexture(k.data);k.data instanceof l?(r=b.parentSurface.layerViewByIndex(f,p),this._drawVectorData(k.data,r,b.lij,t.descriptor.width,t.descriptor.height,A,y,w,n[f])):this._drawRasterData(k.data,
A,y,n[f])}q.bindTexture(t);v.copyTexImage2D(q.gl.TEXTURE_2D,0,t.descriptor.pixelFormat,0,0,t.descriptor.width,t.descriptor.height,0);t.generateMipmap();q.bindFramebuffer(null);q.setBlendFunctionSeparate(770,771,1,771);q.setBlendingEnabled(!1);this._resourceCounter.incrementNumTileTexturesComposited()};return k}()})},"esri/views/vectorTiles/tileRendererHelper3D":function(){define(["require","exports","dojo/has","../../core/libs/gl-matrix/vec3","../../core/libs/gl-matrix/mat4"],function(x,r,k,a,b){var c=
{extent:{xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:{wkid:102100,isWrappable:!0},intersects:function(a){return!1}},center:[0,0],scale:1,resolution:1,rotation:0,width:1,height:1,pixelRatio:1,size:[256,256],spatialReference:{wkid:102100,isWrappable:!0},worldScreenWidth:1,viewpoint:{},toMap:function(a,b){return[0,0]},toScreen:function(a,b){return[0,0]},clone:function(){return null},copy:function(a){return this}},t=a.create();return function(a,f,q,l,r,B,v,w,D,x,G,p,z){D=[f[0],f[1],f[2]];for(var n=x;1>
n;n*=2)D[0]--,D[1]>>=1,D[2]>>=1;f={context:a,budget:null,state:c,stationary:!0,devicePixelRatio:1,displayLevel:r.adjustLevel(B),requiredLevel:r.adjustLevel(f[0]),drawphase:0,renderer:l,layerOpacity:z};if(v!==w)throw Error("It is expected that tiles are square!");B=1/x;z=r.getSchemaShift(D,B);n=z[1];q.tileTransform.displayCoord[0]=-1-2*B*G[0]-z[0];q.tileTransform.displayCoord[1]=1+2*B*(1-G[1]-x)+n;x=q.tileTransform.transform;b.identity(x);r.isWGS84&&512===r.lockedSchemaPixelSize&&(B*=2);0===p&&(B/=
2);r=.25*B/v;t.set([r,-r,1]);b.scale(x,x,t);a.setBlendFunctionSeparate(1,771,1,771);a.setClearDepth(1);a.clear(a.gl.DEPTH_BUFFER_BIT);f.state.size=[v,w];f.state.width=v;f.state.height=w;l.setStateParams(f.state,f.devicePixelRatio,D[0]);q.attach(f);a.setFaceCullingEnabled(!1);a.setDepthFunction(515);a.setBlendingEnabled(!1);a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);q.processRender(f);a.setDepthWriteEnabled(!1);a.setBlendingEnabled(!0);f.drawphase=1;q.processRender(f);f.drawphase=2;q.processRender(f);
k("esri-vector-tiles-debug")&&l.renderTileInfo(a,q);a.setDepthWriteEnabled(!0);a.setDepthTestEnabled(!1);a.setFaceCullingEnabled(!0)}})},"esri/core/libs/gl-matrix/vec3":function(){define(["./common"],function(x){var r={create:function(){var k=new x.ARRAY_TYPE(3);k[0]=0;k[1]=0;k[2]=0;return k},clone:function(k){var a=new x.ARRAY_TYPE(3);a[0]=k[0];a[1]=k[1];a[2]=k[2];return a},fromValues:function(k,a,b){var c=new x.ARRAY_TYPE(3);c[0]=k;c[1]=a;c[2]=b;return c},copy:function(k,a){k[0]=a[0];k[1]=a[1];
k[2]=a[2];return k},set:function(k,a,b,c){k[0]=a;k[1]=b;k[2]=c;return k},add:function(k,a,b){k[0]=a[0]+b[0];k[1]=a[1]+b[1];k[2]=a[2]+b[2];return k},subtract:function(k,a,b){k[0]=a[0]-b[0];k[1]=a[1]-b[1];k[2]=a[2]-b[2];return k}};r.sub=r.subtract;r.multiply=function(k,a,b){k[0]=a[0]*b[0];k[1]=a[1]*b[1];k[2]=a[2]*b[2];return k};r.mul=r.multiply;r.divide=function(k,a,b){k[0]=a[0]/b[0];k[1]=a[1]/b[1];k[2]=a[2]/b[2];return k};r.div=r.divide;r.ceil=function(k,a){k[0]=Math.ceil(a[0]);k[1]=Math.ceil(a[1]);
k[2]=Math.ceil(a[2]);return k};r.floor=function(k,a){k[0]=Math.floor(a[0]);k[1]=Math.floor(a[1]);k[2]=Math.floor(a[2]);return k};r.min=function(k,a,b){k[0]=Math.min(a[0],b[0]);k[1]=Math.min(a[1],b[1]);k[2]=Math.min(a[2],b[2]);return k};r.max=function(k,a,b){k[0]=Math.max(a[0],b[0]);k[1]=Math.max(a[1],b[1]);k[2]=Math.max(a[2],b[2]);return k};r.round=function(k,a){k[0]=Math.round(a[0]);k[1]=Math.round(a[1]);k[2]=Math.round(a[2]);return k};r.scale=function(k,a,b){k[0]=a[0]*b;k[1]=a[1]*b;k[2]=a[2]*b;
return k};r.scaleAndAdd=function(k,a,b,c){k[0]=a[0]+b[0]*c;k[1]=a[1]+b[1]*c;k[2]=a[2]+b[2]*c;return k};r.distance=function(k,a){var b=a[0]-k[0],c=a[1]-k[1];k=a[2]-k[2];return Math.sqrt(b*b+c*c+k*k)};r.dist=r.distance;r.squaredDistance=function(k,a){var b=a[0]-k[0],c=a[1]-k[1];k=a[2]-k[2];return b*b+c*c+k*k};r.sqrDist=r.squaredDistance;r.length=function(k){var a=k[0],b=k[1];k=k[2];return Math.sqrt(a*a+b*b+k*k)};r.len=r.length;r.squaredLength=function(k){var a=k[0],b=k[1];k=k[2];return a*a+b*b+k*k};
r.sqrLen=r.squaredLength;r.negate=function(k,a){k[0]=-a[0];k[1]=-a[1];k[2]=-a[2];return k};r.inverse=function(k,a){k[0]=1/a[0];k[1]=1/a[1];k[2]=1/a[2];return k};r.normalize=function(k,a){var b=a[0],c=a[1],t=a[2],b=b*b+c*c+t*t;0<b&&(b=1/Math.sqrt(b),k[0]=a[0]*b,k[1]=a[1]*b,k[2]=a[2]*b);return k};r.dot=function(k,a){return k[0]*a[0]+k[1]*a[1]+k[2]*a[2]};r.cross=function(k,a,b){var c=a[0],t=a[1];a=a[2];var n=b[0],f=b[1];b=b[2];k[0]=t*b-a*f;k[1]=a*n-c*b;k[2]=c*f-t*n;return k};r.lerp=function(k,a,b,c){var t=
a[0],n=a[1];a=a[2];k[0]=t+c*(b[0]-t);k[1]=n+c*(b[1]-n);k[2]=a+c*(b[2]-a);return k};r.hermite=function(k,a,b,c,t,n){var f=n*n,q=f*(2*n-3)+1,l=f*(n-2)+n,r=f*(n-1);n=f*(3-2*n);k[0]=a[0]*q+b[0]*l+c[0]*r+t[0]*n;k[1]=a[1]*q+b[1]*l+c[1]*r+t[1]*n;k[2]=a[2]*q+b[2]*l+c[2]*r+t[2]*n;return k};r.bezier=function(k,a,b,c,t,n){var f=1-n,q=f*f,l=n*n,r=q*f,q=3*n*q,f=3*l*f;n*=l;k[0]=a[0]*r+b[0]*q+c[0]*f+t[0]*n;k[1]=a[1]*r+b[1]*q+c[1]*f+t[1]*n;k[2]=a[2]*r+b[2]*q+c[2]*f+t[2]*n;return k};r.random=function(k,a){a=a||1;
var b=2*x.RANDOM()*Math.PI,c=2*x.RANDOM()-1,t=Math.sqrt(1-c*c)*a;k[0]=Math.cos(b)*t;k[1]=Math.sin(b)*t;k[2]=c*a;return k};r.transformMat4=function(k,a,b){var c=a[0],t=a[1];a=a[2];var n=b[3]*c+b[7]*t+b[11]*a+b[15],n=n||1;k[0]=(b[0]*c+b[4]*t+b[8]*a+b[12])/n;k[1]=(b[1]*c+b[5]*t+b[9]*a+b[13])/n;k[2]=(b[2]*c+b[6]*t+b[10]*a+b[14])/n;return k};r.transformMat3=function(k,a,b){var c=a[0],t=a[1];a=a[2];k[0]=c*b[0]+t*b[3]+a*b[6];k[1]=c*b[1]+t*b[4]+a*b[7];k[2]=c*b[2]+t*b[5]+a*b[8];return k};r.transformQuat=function(k,
a,b){var c=a[0],t=a[1],n=a[2];a=b[0];var f=b[1],q=b[2];b=b[3];var l=b*c+f*n-q*t,r=b*t+q*c-a*n,B=b*n+a*t-f*c,c=-a*c-f*t-q*n;k[0]=l*b+c*-a+r*-q-B*-f;k[1]=r*b+c*-f+B*-a-l*-q;k[2]=B*b+c*-q+l*-f-r*-a;return k};r.rotateX=function(k,a,b,c){var t=[],n=[];t[0]=a[0]-b[0];t[1]=a[1]-b[1];t[2]=a[2]-b[2];n[0]=t[0];n[1]=t[1]*Math.cos(c)-t[2]*Math.sin(c);n[2]=t[1]*Math.sin(c)+t[2]*Math.cos(c);k[0]=n[0]+b[0];k[1]=n[1]+b[1];k[2]=n[2]+b[2];return k};r.rotateY=function(k,a,b,c){var t=[],n=[];t[0]=a[0]-b[0];t[1]=a[1]-
b[1];t[2]=a[2]-b[2];n[0]=t[2]*Math.sin(c)+t[0]*Math.cos(c);n[1]=t[1];n[2]=t[2]*Math.cos(c)-t[0]*Math.sin(c);k[0]=n[0]+b[0];k[1]=n[1]+b[1];k[2]=n[2]+b[2];return k};r.rotateZ=function(k,a,b,c){var t=[],n=[];t[0]=a[0]-b[0];t[1]=a[1]-b[1];t[2]=a[2]-b[2];n[0]=t[0]*Math.cos(c)-t[1]*Math.sin(c);n[1]=t[0]*Math.sin(c)+t[1]*Math.cos(c);n[2]=t[2];k[0]=n[0]+b[0];k[1]=n[1]+b[1];k[2]=n[2]+b[2];return k};r.forEach=function(){var k=r.create();return function(a,b,c,t,n,f){b||(b=3);c||(c=0);for(t=t?Math.min(t*b+c,
a.length):a.length;c<t;c+=b)k[0]=a[c],k[1]=a[c+1],k[2]=a[c+2],n(k,k,f),a[c]=k[0],a[c+1]=k[1],a[c+2]=k[2];return a}}();r.angle=function(k,a){k=r.fromValues(k[0],k[1],k[2]);a=r.fromValues(a[0],a[1],a[2]);r.normalize(k,k);r.normalize(a,a);a=r.dot(k,a);return 1<a?0:Math.acos(a)};r.str=function(k){return"vec3("+k[0]+", "+k[1]+", "+k[2]+")"};r.exactEquals=function(k,a){return k[0]===a[0]&&k[1]===a[1]&&k[2]===a[2]};r.equals=function(k,a){var b=k[0],c=k[1];k=k[2];var t=a[0],n=a[1];a=a[2];return Math.abs(b-
t)<=x.EPSILON*Math.max(1,Math.abs(b),Math.abs(t))&&Math.abs(c-n)<=x.EPSILON*Math.max(1,Math.abs(c),Math.abs(n))&&Math.abs(k-a)<=x.EPSILON*Math.max(1,Math.abs(k),Math.abs(a))};return r})},"esri/views/3d/terrain/TilemapOnlyTile":function(){define(["require","exports","./TerrainConst","./TilePerLayerInfo"],function(x,r,k,a){return function(){function b(a){this.parent=null;this.lij=a;this.layerInfo=Array(k.LayerClass.LAYER_CLASS_COUNT)}b.prototype.tileDataAvailable=function(a,b,k){return(b=this.layerInfo[k][b].tilemap)?
"unavailable"!==b.getAvailability(a.lij[1],a.lij[2]):!0};b.prototype.modifyLayers=function(b,k,n){b=k.length;for(var c=this.layerInfo[n],q=Array(b),l=0;l<b;l++){var t=k[l];q[l]=-1<t?c[t]:new a(n)}this.layerInfo[n]=q};return b}()})},"esri/views/3d/layers/graphics/Deconflictor":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/watchUtils ../../../../core/HandleRegistry ../../../../core/Logger ../../support/aaBoundingRect ../../support/PreallocArray ./deconflictorDebug ../../lib/glMatrix ../../webgl-engine/lib/Util ../../webgl-engine/lib/screenSizePerspectiveUtils ../../webgl-engine/materials/internal/MaterialUtil ../../webgl-engine/materials/HUDMaterial".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){function w(a){return!!a&&"selection"===a.type}var D=q.vec2d;x=q.vec4d;var F=l.VertexAttrConstants,G=c.getLogger("esri.views.3d.graphics.Deconflictor"),p=x.create(),z=x.create(),A=x.create(),J=x.create(),I=D.create(),K=t.create(),L=t.create(),O=new Set,P=l.lerp,U=new n(100),N=new n(100),R=function(){function a(a,b){this.creator=a;this.disposer=b;this.list=[];this.currentIndex=0}a.prototype.alloc=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];
this.currentIndex>=this.list.length&&this.list.push(new this.creator(a));return this.list[this.currentIndex++]};a.prototype.freeAll=function(){for(var a=this.currentIndex,b=this.disposer,e=this.list;0<=--a;)b(e[a]);this.currentIndex=0};return a}(),S=function(){function a(){this.graphics3DGraphic=null;this.positions=[D.create(),D.create(),D.create(),D.create()];this.posView=this.yMax=this.yMin=this.xMax=this.xMin=0;this.graphicsOwner=null;this.graphicId=this.id=0}a.release=function(a){a.graphics3DGraphic=
null;a.graphicsOwner=null};return a}();c=function(){function c(c){var f=this;this.graphicsOwners=[];this.deconflictTimeoutId=0;this.handles=new b;this.graphicInfoPool=new R(S,S.release);this.nextGraphicInfoId=0;this.accBinsNumX=15;this.accBinsNumY=20;this.accBinsSizeY=this.accBinsSizeX=0;this.accBins=null;this.accNumTests=0;this.iconMarginFactor=-.1;this.view=c;this.handles.add([c.watch("state.camera",function(){return f.scheduleRun()}),a.whenNot(c,"ready",function(){return f.clearDeconflictTimeout()})])}
c.prototype.destroy=function(){this.handles.destroy();this.handles=null;this.clearDeconflictTimeout();this.graphicInfoPool.freeAll();this.view=this.graphicInfoPool=null};c.prototype.clearDeconflictTimeout=function(){this.deconflictTimeoutId&&(clearTimeout(this.deconflictTimeoutId),this.deconflictTimeoutId=0)};c.prototype.addGraphicsOwner=function(a){var b=this;this.graphicsOwners.push(a);this.setDirty();a.layer&&"function"===typeof a.layer.watch&&a.layer.watch("featureReduction",function(e,d){w(e)?
b.setDirty():w(d)&&(b._removeIconVisibilityFlags(a),b.setDirty())})};c.prototype.removeGraphicsOwner=function(a){a=this.graphicsOwners.indexOf(a);0<=a&&this.graphicsOwners.splice(a,1);this.setDirty()};c.prototype.setDirty=function(){this.scheduleRun(10)};c.prototype.initializeLabelVisibility=function(a){a.setVisibilityFlag(2,!1,1)};c.prototype.doesIntersectExistingPoly=function(a){var b=a.graphicId,e=a.positions;O.clear();for(var d=Math.floor(a.xMin/this.accBinsSizeX);d<=Math.floor(a.xMax/this.accBinsSizeX);d++)if(!(0>
d||d>=this.accBinsNumX))for(var c=Math.floor(a.yMin/this.accBinsSizeY);c<=Math.floor(a.yMax/this.accBinsSizeY);c++)if(!(0>c||c>=this.accBinsNumY)){var f=this.accBins[d][c],h=0;a:for(;h<f.length;h++){var l=f.data[h];if(l.graphicId!==b&&!O.has(l.id)){O.add(l.id);l=l.positions;this.accNumTests++;for(var k=0;2>k;k++){var n=0===k?e:l,p=0===k?l:e,q=0;b:for(;4>q;q++){var t=n[q],r=n[(q+1)%4],v=n[(q+2)%4];I[0]=r[0]-t[0];I[1]=r[1]-t[1];r=D.normalize(I);A=[-r[1],r[0]];r[0]=A[0];r[1]=A[1];t=r[0]*t[0]+r[1]*t[1];
v=r[0]*v[0]+r[1]*v[1]<t;for(A=0;4>A;A++){var y=p[A],y=r[0]*y[0]+r[1]*y[1];if(v&&y<t||!v&&y>t)continue b}continue a}}return!0}}}return!1;var A};c.prototype.initBins=function(a,b){if(null==this.accBins){this.accBins=[];for(var e=0;e<this.accBinsNumX;e++){this.accBins.push([]);for(var d=this.accBins[this.accBins.length-1],c=0;c<this.accBinsNumY;c++)d.push(new n(10))}}for(e=0;e<this.accBinsNumX;e++)for(c=0;c<this.accBinsNumY;c++)this.accBins[e][c].clear();this.accBinsSizeX=a/this.accBinsNumX;this.accBinsSizeY=
b/this.accBinsNumY;this.accNumTests=0};c.prototype.addToBins=function(a){for(var b=Math.floor(a.xMin/this.accBinsSizeX);b<=Math.floor(a.xMax/this.accBinsSizeX);b++)if(!(0>b||b>=this.accBinsNumX))for(var e=Math.floor(a.yMin/this.accBinsSizeY);e<=Math.floor(a.yMax/this.accBinsSizeY);e++)0>e||e>=this.accBinsNumY||this.accBins[b][e].push(a)};c.prototype.scheduleRun=function(a){var b=this;void 0===a&&(a=200);0===this.deconflictTimeoutId&&(this.deconflictTimeoutId=setTimeout(function(){return b.run()},
a))};c.prototype.run=function(){var a=this.view;this.clearDeconflictTimeout();if(a.ready){var b=a.state.camera;this.graphicInfoPool.freeAll();this.nextGraphicInfoId=0;var e=b.fullWidth,d=b.fullHeight;f.prepare(a);U.clear();N.clear();for(var a=!1,c=0;c<this.graphicsOwners.length;c++){var h=this.graphicsOwners[c];if(null!=h.getGraphics3DGraphics&&null!=h.getGraphics3DGraphicsKeys){var l=null!=h.labelsEnabled&&h.labelsEnabled(),k=w(h.layer?h.layer.featureReduction:null);if(l||k){a||(this.initBins(e,
d),a=!0);for(var n=h.getGraphics3DGraphics(),p=h.getGraphics3DGraphicsKeys(),q=0;q<p.length;q++){var t=n[p[q]];t.areVisibilityFlagsSet(void 0,2)&&(k&&this._collectGraphics(t,!1,h,b,U,this.iconMarginFactor),l&&this._collectGraphics(t,!0,h,b,N))}}}}U.sort(function(a,b){return b.posView-a.posView});N.sort(function(a,b){return b.posView-a.posView});this._deconflictVisibleObjects(U,!1);N.length&&this._deconflictVisibleObjects(N,!0);f.drawAccelerationStruct(this,U);f.drawAccelerationStruct(this,N)}else this.setDirty()};
c.prototype._collectGraphics=function(a,b,e,d,c,f){void 0===f&&(f=0);var g=b?a._labelGraphics:a._graphics,h=b?1:0;if(g.length){b=t.set(K,t.NEGATIVE_INFINITY);for(var l,m,k,n=0;n<g.length;n++){var q=g[n];if(!q.isDraped()){var r=q.stageObject,w=r?r.getNumGeometryRecords():0;if(!(1>w)){var D=r.getGeometryRecord(0),I=D.materials[0];if(I instanceof v)if(1<w)G.warn("Graphic objects with more than 1 geometry record are not supported");else{w=D.geometry.getData().getVertexAttr();if(!m){m=r.getCenter();k=
D.origin.vec3;m=B.transformToWorld(m,k,p);m=B.transformToView(m,k,d.viewMatrix,z);I.applyVerticalOffsetTransformation(m,w[F.NORMAL].data,r.objectTransformation,d,T);r=w[F.AUXPOS1].data;w="screen"!==I.getParams().centerOffsetUnits;k=B.transformToProjection(m,d.projectionMatrix,w?r:[0,0,0],A);k=B.transformToNDC(k,J);w||(k[0]+=r[0]/d.fullWidth*2,k[1]+=r[1]/d.fullHeight*2);if(-1>k[0]||-1>k[1]||-1>k[2]||1<=k[0]||1<=k[1])break;l=m[2];a.areVisibilityFlagsSet(2,void 0,h)&&(l*=.7)}q=q.getScreenSize(V);y.applyPrecomputedScaleFactorVec2(q,
T.factor,q);I=t.offset(I.calculateRelativeScreenBounds(q,T.scaleAlignment,L),P(0,d.fullWidth,.5+.5*k[0]),P(0,d.fullHeight,.5+.5*k[1]));0!==f&&(q=f*Math.min(t.width(I),t.height(I)),I[0]-=q,I[1]-=q,I[2]+=q,I[3]+=q);t.expand(b,I)}}}}null!=l&&(d=this.graphicInfoPool.alloc(),d.id=this.nextGraphicInfoId++,d.graphicId=a.graphic.uid,d.xMin=b[0],d.yMin=b[1],d.xMax=b[2],d.yMax=b[3],d.positions[0][0]=b[0],d.positions[0][1]=b[1],d.positions[1][0]=b[0],d.positions[1][1]=b[3],d.positions[2][0]=b[2],d.positions[2][1]=
b[3],d.positions[3][0]=b[2],d.positions[3][1]=b[1],d.graphics3DGraphic=a,d.posView=l,d.graphicsOwner=e,c.push(d))}};c.prototype._deconflictVisibleObjects=function(a,b){for(var e=b?1:0,d=0;d<a.length;d++){var c=a.data[d],h=c.graphics3DGraphic,l=!(b&&!1===h.areVisibilityFlagsSet(2,void 0))&&!this.doesIntersectExistingPoly(c);l&&this.addToBins(c);h.setVisibilityFlag(2,l,e);f.drawPoly(c.positions,l?"green":"red")}};c.prototype._removeIconVisibilityFlags=function(a){if(null!=a.getGraphics3DGraphics&&null!=
a.getGraphics3DGraphicsKeys){var b=a.getGraphics3DGraphics(),e=0;for(a=a.getGraphics3DGraphicsKeys();e<a.length;e++)b[a[e]].setVisibilityFlag(2,void 0)}};return c}();var T={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},scaleAlignment:0,minPixelSizeAlignment:0},V=D.create();return c})},"esri/views/3d/layers/graphics/deconflictorDebug":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../lib/glMatrix","../../support/debugFlags"],function(x,r,k,a,b){function c(a,
b){if(n){var c=q.height,f=l;f.beginPath();f.lineWidth=1;f.strokeStyle=b;f.moveTo(a[0][0],c-a[0][1]);for(b=1;4>b;b++)f.lineTo(a[b][0],c-a[b][1]),f.stroke();f.lineTo(a[0][0],c-a[0][1]);f.stroke();f.closePath()}}Object.defineProperty(r,"__esModule",{value:!0});var t=a.vec2d,n=!1,f=!1,q,l;r.drawAccelerationStruct=function(a,b){if(f&&l){for(var k=l,n=[t.create(),t.create(),t.create(),t.create()],q=0,r=0;r<a.accBinsNumX;r++)for(var y=0;y<a.accBinsNumY;y++){var p=a.accBins[r][y],q=q+p.length,B=r*a.accBinsSizeX,
A=(r+1)*a.accBinsSizeX,x=y*a.accBinsSizeY,I=(y+1)*a.accBinsSizeY;n[0][0]=B;n[0][1]=x;n[1][0]=A;n[1][1]=x;n[2][0]=A;n[2][1]=I;n[3][0]=B;n[3][1]=I;k.fillText(p.length.toFixed(),B+5,x+15);c(n,"blue")}k.fillText("total totalShownLabels: "+q,70,40);k.fillText("total visible labels: "+b.length,70,50);k.fillText("total numTests: "+a.accNumTests,70,30)}};r.prepare=function(a){n=b.DECONFLICTOR_SHOW_OUTLINES;f=b.DECONFLICTOR_SHOW_GRID;if(n||f)null==q&&(q=document.createElement("canvas"),q.setAttribute("id",
"canvas2d"),a.surface.parentElement.style.position="relative",a.surface.parentElement.appendChild(q)),q.setAttribute("width",a.width+"px"),q.setAttribute("height",a.height+"px"),q.setAttribute("style","position:absolute;left:0px;top:0px;display:block;pointer-events:none;"),l=q.getContext("2d"),l.clearRect(0,0,a.width,a.height),l.font="8px Arial"};r.drawPoly=c})},"esri/views/3d/layers/GraphicsView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../layers/GraphicsView ./graphics/Graphics3DCore ./graphics/Graphics3DSpatialIndex ./graphics/Graphics3DElevationAlignment ../support/PromiseLightweight ../../../core/promiseUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){return function(c){function r(){var a=null!==c&&c.apply(this,arguments)||this;a.graphicsCore=null;a.spatialIndex=null;a.elevationAlignment=null;a.supportsDraping=!0;a._overlayUpdating=!1;a._eventHandles=[];return a}k(r,c);Object.defineProperty(r.prototype,"graphics",{set:function(a){a!==this.loadedGraphics&&(this.loadedGraphics=a);this._set("graphics",a)},enumerable:!0,configurable:!0});r.prototype.initialize=function(){var a=this;this.mockLayerId="__sceneView.graphics-"+
Date.now().toString(16);this.spatialIndex=new n;this.spatialIndex.whenLoaded().then(function(){return a.deferredInitialize()})};r.prototype.deferredInitialize=function(){var a=this;if(!this.destroyed){this.loadedGraphics=this.graphics;this.graphicsCore=new t;this.elevationAlignment=new f;var b={id:this.mockLayerId,uid:this.mockLayerId};this.spatialIndex.initialize(this,b,this.view.spatialReference,this.graphicsCore);this.elevationAlignment.initialize(this,function(b,c,f){a.spatialIndex.intersects(b,
c,f)},this.graphicsCore,this.view.elevationProvider);this.graphicsCore.initialize(this,b,this.elevationAlignment,null,this.spatialIndex,null,null,null,null,this.view.basemapTerrain);this._eventHandles.push(this.view.watch("clippingArea",function(){return a.updateClippingExtent()}));this.updateClippingExtent();this.view.resourceController.registerIdleFrameWorker(this,{needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate})}};r.prototype.destroy=function(){this._eventHandles.forEach(function(a){return a.remove()});
this._eventHandles=null;this.view.resourceController.deregisterIdleFrameWorker(this);this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.elevationAlignment&&(this.elevationAlignment.destroy(),this.elevationAlignment=null);this.graphicsCore&&(this.graphicsCore.destroy(),this.graphicsCore=null);this.loadedGraphics=null};r.prototype.getGraphicsFromStageObject=function(a,b){var c=a.getMetadata().graphicId,f=null;this.loadedGraphics&&this.loadedGraphics.some(function(a){return a.uid===
c?(f=a,!0):!1});a=new q.Promise;null!==f?a.done(f):a.reject();return a};r.prototype.whenGraphicBounds=function(a){var b=this;return this.spatialIndex?this.spatialIndex.whenLoaded().then(function(){return b.graphicsCore?b.graphicsCore.whenGraphicBounds(a):l.reject()}):l.reject()};r.prototype._needsIdleUpdate=function(){return this.elevationAlignment.needsIdleUpdate()};r.prototype._idleUpdate=function(a){this.elevationAlignment.idleUpdate(a)};r.prototype._notifySuspendedChange=function(){};r.prototype._notifyDrapedDataChange=
function(){this.view.basemapTerrain&&this.view.basemapTerrain.overlayManager.setOverlayDirty()};r.prototype._evaluateUpdatingState=function(){if(this.elevationAlignment){var a;a=0+this.elevationAlignment.numNodesUpdating();a+=this.graphicsCore.numNodesUpdating();this.updating=a=(a=(a=(a=0<a||this._overlayUpdating)||this.spatialIndex.isUpdating())||this.elevationAlignment.isUpdating())||this.graphicsCore.needsIdleUpdate()}else this.updating=!1};r.prototype.updateClippingExtent=function(){this.graphicsCore.setClippingExtent(this.view.clippingArea,
this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()};a([b.property()],r.prototype,"graphics",null);a([b.property()],r.prototype,"loadedGraphics",void 0);a([b.property({value:!0})],r.prototype,"updating",void 0);a([b.property({value:!1})],r.prototype,"suspended",void 0);return r=a([b.subclass("esri.views.3d.layers.GraphicsView3D")],r)}(b.declared(c))})},"esri/views/layers/GraphicsView":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../core/Accessor ../../core/Collection ../../Graphic".split(" "),
function(x,r,k,a,b,c,t,n){return function(c){function f(){var a=null!==c&&c.apply(this,arguments)||this;a.graphics=null;a.renderer=null;a.view=null;return a}k(f,c);a([b.property({type:t.ofType(n)})],f.prototype,"graphics",void 0);a([b.property()],f.prototype,"renderer",void 0);a([b.property()],f.prototype,"view",void 0);return f=a([b.subclass("esri.views.layers.GraphicsView")],f)}(b.declared(c))})},"esri/views/3d/layers/graphics/Graphics3DCore":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ../../../../core/watchUtils ../../../../core/arrayUtils ../../../../core/Error ../../../../core/Logger ../../../../core/promiseUtils ../../support/projectionUtils ../../../../renderers/UniqueValueRenderer ../../../../renderers/support/rendererConversion ../../../../renderers/support/diffUtils ../../../../geometry/Point ../../../../geometry/Extent ../../webgl-engine/Stage ../../webgl-engine/lib/Util ../../webgl-engine/lib/Layer ../../webgl-engine/lib/FloatingBoxLocalOriginFactory ../../../../symbols/WebStyleSymbol ../../../../symbols/LabelSymbol3D ../../../../symbols/TextSymbol ../../../../symbols/support/symbolConversion ../../../../symbols/support/unitConversionUtils ../../lib/glMatrix ./featureExpressionInfoUtils ./Graphics3DGraphic ./Graphics3DWebStyleSymbol ./graphicUtils ./Graphics3DSymbolFactory ./Graphics3DOwner ./ElevationQuery ../../support/aaBoundingBox ../../support/mathUtils dojo/Deferred".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S,T,V,h,ca){function Q(a){(a=a.elevationInfo&&a.elevationInfo.unit)&&!K.supportsUnit(a)&&g.warn("elevationInfo.unit","'"+a+"' is not a valid unit")}x=L.vec3d;var e=new v,d=x.create(),g=n.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");return function(){function m(a){void 0===a&&(a=!0);this.elevationFeatureExpressionEnabled=a;this.graphics={};this.graphicsDrapedIds={};this.graphicsBySymbol={};this.graphicsKeys=[];this.symbols=
{};this.graphicsWithoutSymbol={};this.computedExtent=null;this.symbolCreationContext=new S.Graphics3DSymbolCreationContext;this.hasDraped=!1;this.updatingGraphicIds=new Set;this.graphicTransformFunc=this.onComputedExtentChange=this.stage=this.labelStageLayer=this.stageLayer=this.tilingSchemeHandle=this.lastFastUpdate=null;this.eventHandles=[];this.sharedSymbolResourcesOwnerHandle=this.highlights=this.elevationQueryService=this.labeling=this.spatialIndex=this.scaleVisibility=this.elevation=this.layer=
this.layerView=this.viewSR=null;this.whenGraphics3DGraphicRequests={}}m.prototype.initialize=function(a,d,e,c,f,h,l,k,n,p){var q=this;this.layerView=a;this.layer=d;this.viewSR=a.view.spatialReference;this.elevation=e;this.scaleVisibility=c;this.spatialIndex=f;this.labeling=h;this.highlights=l;this.onComputedExtentChange=k;this.graphicTransformFunc=n;var t=this.layerView.view;this.elevationQueryService=new T.ElevationQuery(this.viewSR,function(){return t.map.ground},{maximumAutoTileRequests:4});this.initializeStage(t,
this.layer.uid);this.symbolCreationContext.sharedResources=t.sharedSymbolResources;this.sharedSymbolResourcesOwnerHandle=t.sharedSymbolResources.addGraphicsOwner(this);this.symbolCreationContext.renderer=this.layer.renderer;this.symbolCreationContext.stage=this.stage;this.symbolCreationContext.streamDataSupplier=t.sharedSymbolResources.streamDataSupplier;this.symbolCreationContext.renderSpatialReference=t.renderSpatialReference;this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper;this.symbolCreationContext.layer=
this.layer;this.symbolCreationContext.layerView=this.layerView;this.symbolCreationContext.layerOrder=0;this.symbolCreationContext.localOriginFactory=m.createLocalOriginFactory();this.symbolCreationContext.elevationProvider=t.elevationProvider;Q(this.layer);d=O.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=O.createContext(d,this.viewSR,g);t.deconflictor.addGraphicsOwner(this);this.symbolCreationContext.screenSizePerspectiveEnabled=
t.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;this.tilingSchemeHandle=b.when(p,"tilingScheme",function(a){a.spatialReference.equals(q.symbolCreationContext.overlaySR)||(q.symbolCreationContext.overlaySR=p.spatialReference,q.recreateAllGraphics())});this.eventHandles.push(this.layerView.watch("suspended",function(){return q.suspendedChange()}));this.eventHandles.push(this.layerView.watch("layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled",function(){q.symbolCreationContext.screenSizePerspectiveEnabled=
t.screenSizePerspectiveEnabled&&q.layer.screenSizePerspectiveEnabled;q.recreateAllGraphics()}));this.eventHandles.push(b.on(a,"loadedGraphics","change",function(a){return q.graphicsCollectionChanged(a)},function(){q.clearSymbolsAndGraphics();q.graphicsCollectionChanged({added:q.layerView.loadedGraphics.toArray(),removed:[]})}));this.validateRenderer(this.layer.renderer)};m.prototype.destroy=function(){var a=this;this.layerView.view.deconflictor.removeGraphicsOwner(this);this.clear();if(this.stage){var b=
[this.stageLayer.getId()];this.labelStageLayer&&b.push(this.labelStageLayer.getId());this.stage.removeFromViewContent(b);b.forEach(function(b){return a.stage.remove(D.ModelContentType.LAYER,b)});this.stage=this.labelStageLayer=this.stageLayer=null}this.tilingSchemeHandle&&(this.tilingSchemeHandle.remove(),this.tilingSchemeHandle=null);this.eventHandles.forEach(function(a){return a.remove()});this.layerView=this.labeling=this.scaleVisibility=this.viewSR=this.onComputedExtentChange=this.eventHandles=
null;for(var d in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[d].reject(new t("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null;this.sharedSymbolResourcesOwnerHandle&&(this.sharedSymbolResourcesOwnerHandle.remove(),this.sharedSymbolResourcesOwnerHandle=null)};m.prototype.clear=function(){var a=!1,b;for(b in this.graphics){var d=this.graphics[b],a=a||d.isDraped();d.destroy()}this.graphics={};this.graphicsKeys=null;for(var e in this.symbols)(b=
this.symbols[e])&&b.destroy();this.symbols={};this.graphicsBySymbol={};this.graphicsWithoutSymbol={};this.hasDraped=!1;a&&this.layerView._notifyDrapedDataChange()};m.prototype.initializeStage=function(a,b){this.stage=a._stage;this.stageLayer=new G(b,{state:this.layerView.suspended?"HIDDEN":"VISIBLE"},b);this.stage.add(D.ModelContentType.LAYER,this.stageLayer);a=[this.stageLayer.getId()];this.labeling&&(this.labelStageLayer=new G(b,{state:this.layerView.suspended?"HIDDEN":"IGNORED"},b+"_labels"),this.stage.add(D.ModelContentType.LAYER,
this.labelStageLayer),a.push(this.labelStageLayer.getId()));this.stage.addToViewContent(a)};m.prototype.setDrawingOrder=function(a){this.symbolCreationContext.layerOrder=a;var b={},d={},e;for(e in this.graphics)this.graphics[e].setDrawOrder(a,b,d);for(var c in d)(d=this.symbols[c])&&d.setDrawOrder(a,b);F.objectEmpty(b)||(this.stage.getTextureGraphicsRenderer().updateRenderOrder(b),this.layerView._notifyDrapedDataChange())};m.prototype.suspendedChange=function(){!0===this.layerView.suspended?(this.stageLayer.setState("HIDDEN"),
this.labelStageLayer&&this.labelStageLayer.setState("HIDDEN"),this.hideAllGraphics()):!1===this.layerView.suspended&&(this.stageLayer.setState("VISIBLE"),this.labelStageLayer&&this.labelStageLayer.setState("IGNORED"),this.updateAllGraphicsVisibility())};m.prototype.getGraphics3DGraphics=function(){return this.graphics};m.prototype.getGraphics3DGraphicById=function(a){return this.graphics[a]};m.prototype.getGraphics3DGraphicsKeys=function(){null===this.graphicsKeys&&(this.graphicsKeys=Object.keys(this.graphics));
return this.graphicsKeys};m.prototype.labelsEnabled=function(){return!(!this.labeling||!this.labeling.layerLabelsEnabled())};m.prototype.getSymbolUpdateType=function(){var a=0,b=0,d=0,e;for(e in this.symbols){var c=this.symbols[e];c&&(c=c.getFastUpdateStatus(),a+=c.loading,d+=c.fast,b+=c.slow)}return 0<a?"unknown":0<=d&&0===b?"fast":0<=b&&0===d?"slow":"mixed"};m.prototype.numNodesUpdating=function(){return this.updatingGraphicIds.size};m.prototype.needsIdleUpdate=function(){return!!this.lastFastUpdate&&
500<performance.now()-this.lastFastUpdate};m.prototype.idleUpdate=function(a){a.done()||(this.lastFastUpdate&&(this.labeling&&this.labeling.updateLabelingInfo(),this.lastFastUpdate=null),this.layerView._evaluateUpdatingState())};m.prototype.whenGraphics3DGraphic=function(a){var b=this.graphics[a.uid];if(b)return f.resolve(b);b=this.whenGraphics3DGraphicRequests[a.uid];b||(b=new ca,this.whenGraphics3DGraphicRequests[a.uid]=b);return b.promise};m.prototype.boundsForGraphics3DGraphic=function(b){return a(this,
void 0,void 0,function(){var a,c,g,f,h,l,m,n,p;return k(this,function(k){switch(k.label){case 0:return a=this.layerView.view.spatialReference,c=this.layerView.view.renderSpatialReference,g=this.layerView.view.basemapTerrain.spatialReference,f=function(b,d,e){return q.bufferToBuffer(b,c,d,b,a,d,e)},h=function(b,d,e){return q.bufferToBuffer(b,g,d,b,a,d,e)},[4,b.getProjectedBoundingBox(f,h,this.elevationQueryService)];case 1:l=k.sent();if(!l)return[2,null];m=l.boundingBox;l.requiresDrapedElevation&&
(n=this.symbolCreationContext.elevationProvider)&&(V.center(m,d),e.x=d[0],e.y=d[1],e.z=void 0,e.spatialReference=a,p=n.getElevation(e)||0,m[2]=Math.min(m[2],p),m[5]=Math.max(m[5],p));return[2,{boundingBox:m,screenSpaceObjects:l.screenSpaceObjects}]}})})};m.prototype.whenGraphicBounds=function(a){var d=this;return b.whenOnce(this.layerView,"loadedGraphics").then(function(){var b=d.layerView.layer&&d.layerView.layer.objectIdField,e=d.layerView.loadedGraphics.find(function(d){return d===a||b&&d.attributes&&
a.attributes&&d.attributes[b]===a.attributes[b]?!0:!1});if(e)return d.whenGraphics3DGraphic(e);throw new t("internal:graphic-not-part-of-view","Graphic is not part of this view");}).then(function(a){return d.boundsForGraphics3DGraphic(a)})};m.prototype.graphicsCollectionChanged=function(a){var b=this.graphicTransformFunc?this.graphicTransformFunc(a.added):a.added;this.add(b);this.remove(a.removed)};m.prototype.graphicUpdateHandler=function(a){var b=this.graphics[a.graphic.uid];if(b)switch(a.property){case "visible":b.setVisibilityFlag(0,
a.newValue)&&(b.isDraped()&&this.layerView._notifyDrapedDataChange(),this.labeling&&this.layerView.view.deconflictor.setDirty())}};m.prototype.beginGraphicUpdate=function(a){this.updatingGraphicIds.add(a.uid);"symbolsUpdating"in this.layerView&&!this.layerView.get("symbolsUpdating")&&this.layerView.set("symbolsUpdating",!0);this.layerView._evaluateUpdatingState()};m.prototype.endGraphicUpdate=function(a){a&&this.updatingGraphicIds.delete(a.uid);"symbolsUpdating"in this.layerView&&this.layerView.get("symbolsUpdating")&&
0===this.updatingGraphicIds.size&&(this.layerView.view.flushDisplayModifications(),this.layerView.set("symbolsUpdating",!1));this.layerView._evaluateUpdatingState()};m.prototype.expandComputedExtent=function(a){var b,d,e,c,g,f;if("point"===a.type)b=d=a.x,e=c=a.y,a.z&&(g=f=a.z);else if("polygon"===a.type||"polyline"===a.type||"multipoint"===a.type){f=a.extent;if(!f)return;b=f.xmin;d=f.xmax;e=f.ymin;c=f.ymax;g=f.zmin;f=f.zmax}var l=this.viewSR,k=m.tmpVec;!a.spatialReference.equals(l)&&q.xyzToVector(b,
e,0,a.spatialReference,k,l)&&(b=k[0],e=k[1],q.xyzToVector(d,c,0,a.spatialReference,k,l),d=k[0],c=k[1]);if(h.isFinite(b)&&h.isFinite(d)&&h.isFinite(e)&&h.isFinite(c)){(l=this.computedExtent)?(b<l.xmin&&(l.xmin=b),d>l.xmax&&(l.xmax=d),e<l.ymin&&(l.ymin=e),c>l.ymax&&(l.ymax=c)):this.computedExtent=l=new w(b,e,d,c,a.spatialReference);if(h.isFinite(g)&&!h.isFinite(f)){if(null==l.zmin||g<l.zmin)l.zmin=g;if(null==l.zmax||f>l.zmax)l.zmax=f}this.onComputedExtentChange&&this.onComputedExtentChange()}};m.prototype.updateHasDraped=
function(){this.hasDraped=!1;for(var a in this.graphicsDrapedIds)if(this.graphicsDrapedIds.hasOwnProperty(a)){this.hasDraped=!0;break}};m.prototype.elevationInfoChange=function(){Q(this.layer);var a=O.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=O.createContext(a,this.viewSR,g);this.labeling&&this.labeling.elevationInfoChange();this.layer.renderer!==this.symbolCreationContext.renderer&&this.rendererChange(this.layer.renderer);
for(var b in this.graphicsBySymbol){var d=this.symbols[b],a=this.graphicsBySymbol[b];if(d&&d.layerPropertyChanged("elevationInfo",a)){for(var e in a){var c=a[e],d=c.graphic,c=c._labelGraphics;this.elevation&&this.elevation.markGraphicElevationDirty(d.uid);for(var f=0;f<c.length;f++){var h=c[f];h.graphics3DSymbolLayer.updateGraphicElevationContext(d,h)}}this.layerView._evaluateUpdatingState()}else this._recreateSymbol(b)}};m.prototype.clearSymbolsAndGraphics=function(){this.clear();this.elevation&&
this.elevation.clear();this.labeling&&this.labeling.clear()};m.prototype.recreateAllGraphics=function(){this.clearSymbolsAndGraphics();this.computedExtent=null;this.onComputedExtentChange&&this.onComputedExtentChange();this.layerView.loadedGraphics&&this.layerView.view.basemapTerrain.tilingScheme&&this.add(this.layerView.loadedGraphics.toArray())};m.prototype._recreateSymbol=function(a){var b=this.graphicsBySymbol[a],d=[],e=!1,c;for(c in b){var g=b[c];g.isDraped()&&(delete this.graphicsDrapedIds[c],
e=!0);d.push(g.graphic);g.destroy();delete this.graphics[c]}this.graphicsBySymbol[a]={};(b=this.symbols[a])&&b.destroy();delete this.symbols[a];this.updateHasDraped();e&&this.layerView._notifyDrapedDataChange();this.add(d)};m.prototype.add=function(a){if(this.layerView.view.basemapTerrain&&this.layerView.view.basemapTerrain.tilingScheme){for(var b=a.length,d=Array(b),e=Array(b),c=Array(b),f=!1,h=0;h<b;h++){var l=a[h],m=l.geometry;if(m)if(this.expandComputedExtent(m),m=this.layerView.getRenderingInfo?
this.layerView.getRenderingInfo(l):{symbol:l.symbol},this.graphicsWithoutSymbol[l.uid]=l,m&&m.symbol){if(e[h]=m.symbol,c[h]=m,m=this.getOrCreateGraphics3DSymbol(e[h],m.renderer))d[h]=m,this.beginGraphicUpdate(l)}else f||(f=!0,g.warn("Graphic in layer "+this.layer.id+" has no symbol and will not render"))}for(h=0;h<b;h++)this.waitForSymbol(d[h],e[h],a[h],c[h])}};m.prototype.waitForSymbol=function(a,b,d,e){var c=this;a&&a.then(function(){c.createGraphics3DGraphic(a,d,e);c.endGraphicUpdate(d);c.labeling&&
c.layerView.view.deconflictor.setDirty()},function(){c.endGraphicUpdate(d)})};m.prototype.remove=function(a){for(var b=!1,d=a.length,e=0;e<d;e++){var c=a[e].uid,g=this.graphics[c];if(g){g.isDraped()&&(delete this.graphicsDrapedIds[c],b=!0);var f=g.graphics3DSymbol.symbol.id;g.destroy();delete this.graphics[c];delete this.graphicsBySymbol[f][c];delete this.graphicsWithoutSymbol[c];this.graphicsKeys=null}}this.updateHasDraped();b&&this.layerView._notifyDrapedDataChange();this.layerView.view.deconflictor.setDirty()};
m.prototype.hasLabelingContext=function(a){if(a instanceof A||a instanceof J){var b=this.symbolCreationContext.layer;return b.labelingInfo?b.labelingInfo.some(function(b){return b.symbol===a}):!1}return!1};m.prototype.hasValidSymbolCreationContext=function(a){return a instanceof A&&!this.hasLabelingContext(a)?(g.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1):!0};m.prototype.createGraphics3DSymbol=function(a,b){if(!this.hasValidSymbolCreationContext(a))return null;
a=I.to3D(a,!0,!1,this.hasLabelingContext(a));if(a.symbol){var d=void 0;b&&b.backgroundFillSymbol&&(b=I.to3D(b.backgroundFillSymbol,!1,!0),b.symbol&&(d=b.symbol.symbolLayers));return R.make(a.symbol,this.symbolCreationContext,d)}a.error&&g.error(a.error.message);return null};m.prototype.getOrCreateGraphics3DSymbol=function(a,b){var d=this,e=this.symbols[a.id];void 0===e&&(e=a instanceof z?new U(a,function(a){return d.createGraphics3DSymbol(a,b)}):this.createGraphics3DSymbol(a,b),this.symbols[a.id]=
e);return e};m.prototype.createGraphics3DGraphic=function(a,b,d){delete this.graphicsWithoutSymbol[b.uid];if(!this.symbols[a.symbol.id])this.add([b]);else if(!this.graphics[b.uid]){d=a.createGraphics3DGraphic(b,d);this.graphics[b.uid]=d;this.graphicsKeys=null;this.graphicsBySymbol[a.symbol.id]||(this.graphicsBySymbol[a.symbol.id]={});this.graphicsBySymbol[a.symbol.id][b.uid]=d;d.initialize(this.stageLayer,this.stage);d.isDraped()&&(this.hasDraped=this.graphicsDrapedIds[b.uid]=!0,this.layerView._notifyDrapedDataChange());
d.centroid=null;"point"!==b.geometry.type&&d instanceof P&&(d.centroid=N.computeCentroid(b.geometry,this.viewSR));a=this.scaleVisibility&&this.scaleVisibility.scaleRangeActive();this.spatialIndex&&this.spatialIndex.shouldAddToSpatialIndex(b,d,a)&&this.spatialIndex.addGraphicToSpatialIndex(b,d);this.labeling&&this.labeling.layerLabelsEnabled()&&this.labeling.createLabelsForGraphic(b,d);a&&this.scaleVisibility.updateGraphicScaleVisibility(b,d);d.setVisibilityFlag(0,b.visible&&!this.layerView.suspended);
if(a=this.whenGraphics3DGraphicRequests[b.uid])delete this.whenGraphics3DGraphicRequests[b.uid],a.resolve(d);this.highlights&&this.highlights.graphicCreated(d)}};m.prototype.rendererChange=function(a){var b=this.symbolCreationContext.renderer;if(a!==b){this.validateRenderer(a);var d=B.diff(b,a);this.updateUnchangedSymbolMappings(d,a,b);this.symbolCreationContext.renderer=a;d&&("complete"===d.type?this.recreateAllGraphics():"partial"===d.type&&(this.applyRendererDiff(d,a,b)?this.volatileGraphicsUpdated():
this.recreateAllGraphics()))}};m.prototype.diffHasSymbolChange=function(a){for(var b in a.diff)switch(b){case "visualVariables":break;case "defaultSymbol":break;case "uniqueValueInfos":break;case "authoringInfo":case "fieldDelimiter":delete a.diff[b];break;default:return!0}return!1};m.prototype.applySymbolSetDiff=function(a,b,d,e){e=!1;a=a||[];b=b||[];for(var c=[],g=0;g<b.length;g++){var f=b[g],h=this.graphicsBySymbol[f.id],l;for(l in h){var m=h[l],k=m.graphic;if(f!==d.defaultSymbol||d.getSymbol(k)!==
d.defaultSymbol)m.isDraped()&&(delete this.graphicsDrapedIds[l],e=!0),a.length||d.defaultSymbol?c.push(k):this.graphicsWithoutSymbol[l]=k,m.destroy(),this.highlights&&this.highlights.graphicDeleted(this.graphics[l]),delete h[l],delete this.graphics[l],this.graphicsKeys=null}if(void 0===h||0===Object.keys(h).length)delete this.graphicsBySymbol[f.id],(h=this.symbols[f.id])&&h.destroy(),delete this.symbols[f.id]}if(a.length||c.length){for(l in this.graphicsWithoutSymbol)c.push(this.graphicsWithoutSymbol[l]);
this.graphicsWithoutSymbol={};this.add(c)}this.updateHasDraped();e&&this.layerView._notifyDrapedDataChange();this.layerView.view.deconflictor.setDirty()};m.prototype.applyUniqueValueRendererDiff=function(a,b,d){var e=a.diff.defaultSymbol,c=a.diff.uniqueValueInfos;if(e||c){var g=c?c.added.map(function(a){return a.symbol}):[],f=c?c.removed.map(function(a){return a.symbol}):[];if(c)for(var h=0;h<c.changed.length;h++)g.push(c.changed[h].newValue.symbol),f.push(c.changed[h].oldValue.symbol);e?(d.defaultSymbol&&
f.push(d.defaultSymbol),b.defaultSymbol&&g.push(b.defaultSymbol)):d.defaultSymbol&&g.length&&f.push(b.defaultSymbol);this.applySymbolSetDiff(g,f,b,d);delete a.diff.defaultSymbol;delete a.diff.uniqueValueInfos;return!0}return!1};m.prototype.calculateUnchangedSymbolMapping=function(a,b,d){if(b instanceof l&&d instanceof l)if(!a){if(d&&d.defaultSymbol)return[{oldId:d.defaultSymbol.id,newId:b.defaultSymbol.id}]}else if("partial"===a.type){var e=a.diff;a=e.defaultSymbol;var e=e.uniqueValueInfos,c=void 0,
c=e?e.unchanged.map(function(a){return{oldId:a.oldValue.symbol.id,newId:a.newValue.symbol.id}}):d.uniqueValueInfos.map(function(a,d){return{oldId:a.symbol.id,newId:b.uniqueValueInfos[d].symbol.id}});!a&&d.defaultSymbol&&c.push({oldId:d.defaultSymbol.id,newId:b.defaultSymbol.id});return c}return[]};m.prototype.updateUnchangedSymbolMappings=function(a,b,d){var e=0;for(a=this.calculateUnchangedSymbolMapping(a,b,d);e<a.length;e++)if(d=a[e],b=d.oldId,d=d.newId,b&&b!==d){var c=this.graphicsBySymbol[b];
delete this.graphicsBySymbol[b];void 0!==c&&(this.graphicsBySymbol[d]=c);c=this.symbols[b];delete this.symbols[b];void 0!==c&&(this.symbols[d]=c,c.symbol.id=d)}};m.prototype.applyRendererDiff=function(a,b,d){var e=!1;if(this.diffHasSymbolChange(a))return!1;if(b instanceof l&&d instanceof l&&this.applyUniqueValueRendererDiff(a,b,d)&&0===Object.keys(a.diff).length)return!0;for(var c in this.graphicsBySymbol)if(d=this.symbols[c]){var g=this.graphicsBySymbol[c];if(!d.applyRendererDiff(a,b,g))return!1;
if(!e)for(var f in g)if(g[f].isDraped()){this.layerView._notifyDrapedDataChange();e=!0;break}}return!0};m.prototype.opacityChange=function(){var a=!1,b;for(b in this.graphicsBySymbol){var d=this.symbols[b];if(d){var e=this.graphicsBySymbol[b];d.layerPropertyChanged("opacity");if(!a)for(var c in e)if(e[c].isDraped()){this.layerView._notifyDrapedDataChange();a=!0;break}}}};m.prototype.setClippingExtent=function(a,b){var d=this.symbolCreationContext.clippingExtent,e=[];q.extentToBoundingRect(a,e,b)?
this.symbolCreationContext.clippingExtent=[e[0],e[1],-Infinity,e[2],e[3],Infinity]:this.symbolCreationContext.clippingExtent=null;return!c.equals(this.symbolCreationContext.clippingExtent,d)};m.prototype.forEachGraphics3DGraphic=function(a){var b=this;if(this.layerView.loadedGraphics){var d=!1,e=!1;this.layerView.loadedGraphics.forEach(function(c){var g=b.getGraphics3DGraphicById(c.uid);g&&a(g,c)&&(d=!0,e=e||g.isDraped())});d&&this.layerView.view.deconflictor.setDirty();e&&this.layerView._notifyDrapedDataChange()}};
m.prototype.updateAllGraphicsVisibility=function(){var a=this;this.forEachGraphics3DGraphic(function(b,d){var e=b.setVisibilityFlag(0,d.visible),c=!1;a.scaleVisibility&&(c=a.scaleVisibility.updateGraphicScaleVisibility(d,b));return e||c})};m.prototype.hideAllGraphics=function(){this.forEachGraphics3DGraphic(function(a){return a.setVisibilityFlag(0,!1)})};m.prototype.validateRenderer=function(a){(a=y.validateTo3D(a))&&g.warn("Renderer for layer '"+(this.layer.title?this.layer.title+", ":"")+", id:"+
this.layer.id+"' is not supported in a SceneView",a.message)};m.prototype.volatileGraphicsUpdated=function(){this.labeling&&(this.lastFastUpdate=performance.now());this.stageLayer.invalidateSpatialQueryAccelerator();this.stageLayer.shaderTransformationChanged();this.layerView._evaluateUpdatingState()};m.createLocalOriginFactory=function(){return new p(5E6,16)};m.prototype.snapshotInternals=function(){var a=this;return{graphics:Object.keys(this.graphics).sort(),symbols:Object.keys(this.symbols).sort(),
graphicsBySymbol:Object.keys(this.graphicsBySymbol).sort().map(function(b){return{symbolId:b,graphics:Object.keys(a.graphicsBySymbol[b]).sort()}}),graphicsWithoutSymbol:Object.keys(this.graphicsWithoutSymbol).sort(),graphicsDrapedIds:Object.keys(this.graphicsDrapedIds).sort()}};m.tmpVec=L.vec3d.create();return m}()})},"esri/core/tsSupport/generatorHelper":function(){define([],function(){return function(x,r){function k(b){return function(c){return a([b,c])}}function a(a){if(c)throw new TypeError("Generator is already executing.");
for(;b;)try{if(c=1,t&&(n=t[a[0]&2?"return":a[0]?"throw":"next"])&&!(n=n.call(t,a[1])).done)return n;if(t=0,n)a=[0,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:return b.label++,{value:a[1],done:!1};case 5:b.label++;t=a[1];a=[0];continue;case 7:a=b.ops.pop();b.trys.pop();continue;default:if(!(n=b.trys,n=0<n.length&&n[n.length-1])&&(6===a[0]||2===a[0])){b=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3]))b.label=a[1];else if(6===a[0]&&b.label<n[1])b.label=n[1],n=a;else if(n&&b.label<n[2])b.label=
n[2],b.ops.push(a);else{n[2]&&b.ops.pop();b.trys.pop();continue}}a=r.call(x,b)}catch(l){a=[6,l],t=0}finally{c=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var b={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},c,t,n,f;return f={next:k(0),"throw":k(1),"return":k(2)},"function"===typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f}})},"esri/core/tsSupport/awaiterHelper":function(){define(["dojo/Deferred","dojo/when"],function(x,r){return function(k,
a,b,c){function t(a){try{f(c.next(a))}catch(y){q.reject(y)}}function n(a){try{f(c["throw"](a))}catch(y){q.reject(y)}}function f(a){a.done?r(a.value).then(q.resolve,q.reject):r(a.value).then(t,n)}var q=new x;f((c=c.apply(k,a||[])).next());return q.promise}})},"esri/renderers/support/rendererConversion":function(){define(["require","exports","../../core/Error","../../symbols/support/symbolConversion"],function(x,r,k,a){function b(a,b){if(!b)return null;b=Array.isArray(b)?b:[b];if(0<b.length){var c=
b.map(function(a){return a.details.symbol.type||a.details.symbol.declaredClass}).filter(function(a){return!!a});c.sort();var f=[];c.forEach(function(a,b){0!==b&&a===c[b-1]||f.push(a)});return new k("renderer-conversion-3d:unsupported-symbols","Renderer contains symbols ("+f.join(", ")+") which are not supported in 3D",{renderer:a,symbolErrors:b})}return null}function c(c){var f=c.uniqueValueInfos.map(function(b){return a.to3D(b.symbol).error}).filter(function(a){return!!a}),k=a.to3D(c.defaultSymbol);
k.error&&f.unshift(k.error);return b(c,f)}function t(c){var f=c.classBreakInfos.map(function(b){return a.to3D(b.symbol).error}).filter(function(a){return!!a}),k=a.to3D(c.defaultSymbol);k.error&&f.unshift(k.error);return b(c,f)}Object.defineProperty(r,"__esModule",{value:!0});r.validateTo3D=function(n){return n?"simple"===n.type?b(n,a.to3D(n.symbol).error):"unique-value"===n.type?c(n):"class-breaks"===n.type?t(n):new k("renderer-conversion-3d:unsupported-renderer","Unsupported renderer of type '"+
(n.type||n.declaredClass)+"'",{renderer:n}):null}})},"esri/views/3d/webgl-engine/lib/Layer":function(){define("require exports dojo/has ./IdGen ./Octree ./PerformanceTimer ./Util ./gl-matrix ./ModelContentType".split(" "),function(x,r,k,a,b,c,t,n,f){var q=n.vec3d;return function(){function c(a,b,f){this._parentStages=[];this._children=[];this.id=c._idGen.gen(f);this.name=a;b=b||{};this.group=b.group||"";this.state=b.state||"VISIBLE";this.interaction=b.interaction||"PICKABLE";this.translation=q.create(b.translation);
this._extent=[q.createFrom(0,0,0),q.createFrom(1E3,1E3,1E3)];this._extentDirty=!0}c.prototype.getId=function(){return this.id};c.prototype.getParentStages=function(){return this._parentStages};c.prototype.addParentStage=function(a){-1===this._parentStages.indexOf(a)&&this._parentStages.push(a)};c.prototype.removeParentStage=function(a){a=this._parentStages.indexOf(a);-1<a&&this._parentStages.splice(a,1)};c.prototype.getName=function(){return this.name};c.prototype.getGroup=function(){return this.group};
c.prototype.getState=function(){return this.state};c.prototype.getInteraction=function(){return this.interaction};c.prototype.getTranslation=function(){return this.translation};c.prototype.getObjectIds=function(){return this._children.map(function(a){return a.getId()})};c.prototype.getObjects=function(){return this._children};c.prototype.setState=function(a){this.state=a};c.prototype.getExtent=function(){this._updateExtent();return this._extent};c.prototype.addObject=function(a){this._children.push(a);
a.addParentLayer(this);this.notifyDirty("layObjectAdded",a);this._invalidateExtent();this._spatialAccelerator&&this._spatialAccelerator.add(a)};c.prototype.hasObject=function(a){return-1<this._children.indexOf(a)};c.prototype.removeObject=function(a){return null!=t.arrayRemove(this._children,a)?(a.removeParentLayer(this),this.notifyDirty("layObjectRemoved",a),this._invalidateExtent(),this._spatialAccelerator&&this._spatialAccelerator.remove(a),!0):!1};c.prototype.replaceObject=function(a,b){var c=
this._children.indexOf(a);t.assert(-1<c,"Layer.replaceObject: layer doesn't contain specified object");this._children[c]=b;a.removeParentLayer(this);b.addParentLayer(this);this.notifyDirty("layObjectReplaced",[a,b]);this._invalidateExtent();this._spatialAccelerator&&(this._spatialAccelerator.remove(a),this._spatialAccelerator.add(b))};c.prototype.notifyObjectBBChanged=function(a,b){this._spatialAccelerator&&this._spatialAccelerator.update(a,b)};c.prototype.getCenter=function(){this._updateExtent();
var a=q.create();return q.lerp(this._extent[0],this._extent[1],.5,a)};c.prototype.getBSRadius=function(){this._updateExtent();return.5*q.dist(this._extent[0],this._extent[1])};c.prototype.getSpatialQueryAccelerator=function(){if(this._spatialAccelerator)return this._spatialAccelerator;if(50<this._children.length)return this._createOctree(),this._spatialAccelerator};c.prototype.shaderTransformationChanged=function(){this.notifyDirty("shaderTransformationChanged",null)};c.prototype.invalidateSpatialQueryAccelerator=
function(){this._spatialAccelerator=null};c.prototype.notifyDirty=function(a,b,c,l){c=c||f.LAYER;l=l||this;for(var k=0;k<this._parentStages.length;k++)this._parentStages[k].notifyDirty(c,l,a,b)};c.prototype._createOctree=function(){for(var a=this.getExtent(),c=0,f=0;3>f;f++)c=Math.max(c,a[1][f]-a[0][f]);f=q.create();q.lerp(a[0],a[1],.5,f);this._spatialAccelerator=new b(f,1.2*c);this._spatialAccelerator.add(this._children)};c.prototype._invalidateExtent=function(){this._extentDirty=!0};c.prototype._updateExtent=
function(){if(this._extentDirty)if(0===this._children.length)this._extent=[[0,0,0],[0,0,0]];else{var a=this._children[0];this._extent=[q.create(a.getBBMin()),q.create(a.getBBMax())];for(a=0;a<this._children.length;++a)for(var b=this._children[a],c=b.getBBMin(),b=b.getBBMax(),f=0;3>f;++f)this._extent[0][f]=Math.min(this._extent[0][f],c[f]),this._extent[1][f]=Math.max(this._extent[1][f],b[f]);this._extentDirty=!1}};c._idGen=new a;return c}()})},"esri/views/3d/webgl-engine/lib/Octree":function(){define("require exports ./gl-matrix ./Util dojo/has ./PerformanceTimer".split(" "),
function(x,r,k,a,b,c){function t(a,b,c){c=c||a;c[0]=a[0]+b;c[1]=a[1]+b;c[2]=a[2]+b;return c}var n=k.vec3d;x=function(){function b(a,b,c){this._maximumObjectsPerNode=10;this._maximumDepth=20;this._autoResize=!0;this._outsiders=[];c&&(void 0!==c.maximumObjectsPerNode&&(this._maximumObjectsPerNode=c.maximumObjectsPerNode),void 0!==c.maximumDepth&&(this._maximumDepth=c.maximumDepth),void 0!==c.autoResize&&(this._autoResize=c.autoResize));isNaN(a[0])||isNaN(a[1])||isNaN(a[2])||isNaN(b)?this._root=new f(null,
n.createFrom(0,0,0),.5):this._root=new f(null,a,b/2)}Object.defineProperty(b.prototype,"center",{get:function(){return this._root.center},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"size",{get:function(){return 2*this._root.halfSize},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"root",{get:function(){return this._root.node},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"outsiders",{get:function(){return this._outsiders.slice()},enumerable:!0,
configurable:!0});Object.defineProperty(b.prototype,"maximumObjectsPerNode",{get:function(){return this._maximumObjectsPerNode},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"maximumDepth",{get:function(){return this._maximumDepth},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"autoResize",{get:function(){return this._autoResize},enumerable:!0,configurable:!0});b.prototype.add=function(a){a=this._objectOrObjectsArray(a);this._grow(a);for(var b=f.acquire(),c=
0;c<a.length;c++){var l=a[c];b.init(this._root);0===l.getBSRadius()||isNaN(l.getBSRadius())||!this._autoResize&&!this._fitsInsideTree(this._boundingSphereFromObject(l,D))?this._outsiders.push(l):this._add(l,b)}f.release(b)};b.prototype.remove=function(b,c){b=this._objectOrObjectsArray(b);for(var l=f.acquire(),k=!0,n=0;n<b.length;n++){var k=b[n],p=this._boundingSphereFromObject(c||k,D);0===p.radius||isNaN(p.radius)||!this._autoResize&&!this._fitsInsideTree(p)?k=null!=a.arrayRemove(this._outsiders,
k):(l.init(this._root),k=this._remove(k,p,l))}f.release(l);this._shrink();return k};b.prototype.update=function(a,b){this.remove(a,b);this.add(a)};b.prototype.forEachAlongRay=function(b,c,f){this._forEachTest(function(f){t(f.center,2*-f.halfSize,B);t(f.center,2*f.halfSize,v);return a.rayBoxTest(b,c,B,v)},f)};b.prototype.forEachInBoundingBox=function(a,b,c){this._forEachTest(function(c){for(var f=2*c.halfSize,l=0;3>l;l++)if(c.center[l]+f<a[l]||c.center[l]-f>b[l])return!1;return!0},c)};b.prototype.forEachNode=
function(a){this._forEachNode(this._root,function(b){return a(b.node,b.center,2*b.halfSize)})};b.prototype._forEachTest=function(a,b){this._outsiders.forEach(b);this._forEachNode(this._root,function(c){return a(c)?(c=c.node,c.terminals.forEach(b),null!==c.residents&&c.residents.forEach(b),!0):!1})};b.prototype._forEachNode=function(a,b){a=f.acquire().init(a);for(var c=[a];0!==c.length;){a=c.pop();if(b(a)&&!a.isLeaf())for(var l=0;l<a.node.children.length;l++)a.node.children[l]&&c.push(f.acquire().init(a).advance(l));
f.release(a)}};b.prototype._objectOrObjectsArray=function(a){Array.isArray(a)||(l[0]=a,a=l);return a};b.prototype._remove=function(b,c,f){w.length=0;f.advanceTo(c,function(a,b){w.push(a.node,b)})?(b=null!=a.arrayRemove(f.node.terminals,b),f=0===f.node.terminals.length):(b=null!=a.arrayRemove(f.node.residents,b),f=0===f.node.residents.length);if(f)for(f=w.length-2;0<=f&&this._purge(w[f],w[f+1]);f-=2);return b};b.prototype._nodeIsEmpty=function(a){if(0!==a.terminals.length)return!1;if(null!==a.residents)return 0===
a.residents.length;for(var b=0;b<a.children.length;b++)if(a.children[b])return!1;return!0};b.prototype._purge=function(a,b){0<=b&&(a.children[b]=null);return this._nodeIsEmpty(a)?(null===a.residents&&(a.residents=[]),!0):!1};b.prototype._add=function(a,b){b.advanceTo(this._boundingSphereFromObject(a,D))?b.node.terminals.push(a):(b.node.residents.push(a),b.node.residents.length>this._maximumObjectsPerNode&&b.depth<this._maximumDepth&&this._split(b))};b.prototype._split=function(a){var b=a.node.residents;
a.node.residents=null;for(var c=0;c<b.length;c++){var l=f.acquire().init(a);this._add(b[c],l);f.release(l)}};b.prototype._grow=function(a){if(0!==a.length&&this._autoResize&&(a=this._boundingSphereFromObjects(a,this._boundingSphereFromObject,F),!isNaN(a.radius)&&0!==a.radius&&!this._fitsInsideTree(a)))if(this._nodeIsEmpty(this._root.node))n.set(a.center,this._root.center),this._root.halfSize=1.25*a.radius;else{var b=f.acquire();this._rootBoundsForRootAsSubNode(a,b);this._placingRootViolatesMaxDepth(b)?
this._rebuildTree(a,b):this._growRootAsSubNode(b);f.release(b)}};b.prototype._rebuildTree=function(a,b){var c=this;n.set(b.center,G.center);G.radius=b.halfSize;a=this._boundingSphereFromObjects([a,G],function(a){return a},p);b=f.acquire().init(this._root);this._root.initFrom(null,a.center,1.25*a.radius);this._forEachNode(b,function(a){c.add(a.node.terminals);null!==a.node.residents&&c.add(a.node.residents);return!0});f.release(b)};b.prototype._placingRootViolatesMaxDepth=function(a){var b=0;this._forEachNode(this._root,
function(a){b=Math.max(b,a.depth);return!0});return b+Math.log(a.halfSize/this._root.halfSize)*Math.LOG2E>this._maximumDepth};b.prototype._rootBoundsForRootAsSubNode=function(a,b){var c=a.radius,f=a.center;a=-Infinity;for(var l=this._root.center,k=this._root.halfSize,n=0;3>n;n++){var p=Math.max(0,Math.ceil((l[n]-k-(f[n]-c))/(2*k))),q=Math.max(0,Math.ceil((f[n]+c-(l[n]+k))/(2*k)))+1;a=Math.max(a,Math.pow(2,Math.ceil(Math.log(p+q)*Math.LOG2E)));z[n].min=p;z[n].max=q}for(n=0;3>n;n++)p=z[n].min,q=z[n].max,
c=(a-(p+q))/2,p+=Math.ceil(c),q+=Math.floor(c),y[n]=l[n]-k-p*k*2+(q+p)*k;return b.initFrom(null,y,a*k,0)};b.prototype._growRootAsSubNode=function(a){var b=this._root.node;n.set(this._root.center,F.center);F.radius=this._root.halfSize;this._root.init(a);a.advanceTo(F,null,!0);a.node.children=b.children;a.node.residents=b.residents;a.node.terminals=b.terminals};b.prototype._shrink=function(){if(this._autoResize)for(;;){var a=this._findShrinkIndex();if(-1===a)break;this._root.advance(a);this._root.depth=
0}};b.prototype._findShrinkIndex=function(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;for(var a=null,b=this._root.node.children,c=0,f=0;f<b.length&&null==a;)c=f++,a=b[c];for(;f<b.length;)if(b[f++])return-1;return c};b.prototype._fitsInsideTree=function(a){var b=this._root.center,c=this._root.halfSize,f=a.center;return a.radius<=c&&f[0]>=b[0]-c&&f[0]<=b[0]+c&&f[1]>=b[1]-c&&f[1]<=b[1]+c&&f[2]>=b[2]-c&&f[2]<=b[2]+c};b.prototype._boundingSphereFromObject=function(a,b){n.set(a.getCenter(),
b.center);b.radius=a.getBSRadius();return b};b.prototype._boundingSphereFromObjects=function(a,b,c){if(1===a.length){var f=b(a[0],F);n.set(f.center,c.center);c.radius=f.radius}else{B[0]=Infinity;B[1]=Infinity;B[2]=Infinity;v[0]=-Infinity;v[1]=-Infinity;v[2]=-Infinity;for(var l=0;l<a.length;l++){var f=b(a[l],F),k=B,p=f.center,q=f.radius;k[0]=Math.min(k[0],p[0]-q);k[1]=Math.min(k[1],p[1]-q);k[2]=Math.min(k[2],p[2]-q);k=v;p=f.center;f=f.radius;k[0]=Math.max(k[0],p[0]+f);k[1]=Math.max(k[1],p[1]+f);k[2]=
Math.max(k[2],p[2]+f)}n.scale(n.add(B,v,c.center),.5);c.radius=Math.max(v[0]-B[0],v[1]-B[1],v[2]-B[2])/2}return c};return b}();var f=function(){function a(a,b,c,f){void 0===c&&(c=0);void 0===f&&(f=0);this.center=n.create();this.initFrom(a,b,c,0)}a.prototype.init=function(a){return this.initFrom(a.node,a.center,a.halfSize,a.depth)};a.prototype.initFrom=function(b,c,f,l){void 0===b&&(b=null);void 0===f&&(f=this.halfSize);void 0===l&&(l=this.depth);this.node=b||a.createEmptyNode();c&&n.set(c,this.center);
this.halfSize=f;this.depth=l;return this};a.prototype.advance=function(b){var c=this.node.children[b];c||(c=a.createEmptyNode(),this.node.children[b]=c);this.node=c;this.halfSize/=2;this.depth++;b=q[b];this.center[0]+=b[0]*this.halfSize;this.center[1]+=b[1]*this.halfSize;this.center[2]+=b[2]*this.halfSize;return this};a.prototype.advanceTo=function(a,b,c){for(void 0===c&&(c=!1);;){if(this.isTerminalFor(a))return b&&b(this,-1),!0;if(this.isLeaf()&&!c)return b&&b(this,-1),!1;this.isLeaf()&&(this.node.residents=
null);var f=this._childIndex(a);b&&b(this,f);this.advance(f)}};a.prototype.isLeaf=function(){return null!=this.node.residents};a.prototype.isTerminalFor=function(a){return a.radius>this.halfSize/2};a.prototype._childIndex=function(a){a=a.center;for(var b=this.center,c=0,f=0;3>f;f++)b[f]<a[f]&&(c|=1<<f);return c};a.createEmptyNode=function(){return{children:[null,null,null,null,null,null,null,null],terminals:[],residents:[]}};a.acquire=function(){if(0===this._pool.length)return new a;var b=this._pool[this._pool.length-
1];this._pool.length--;return b};a.release=function(a){this._pool.push(a)};a._pool=[];return a}(),q=[[-1,-1,-1],[1,-1,-1],[-1,1,-1],[1,1,-1],[-1,-1,1],[1,-1,1],[-1,1,1],[1,1,1]],l=[null],y=n.create(),B=n.create(),v=n.create(),w=[],D={center:n.create(),radius:0},F={center:n.create(),radius:0},G={center:n.create(),radius:0},p={center:n.create(),radius:0},z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}];return x})},"esri/views/3d/webgl-engine/lib/FloatingBoxLocalOriginFactory":function(){define(["require",
"exports","./gl-matrix"],function(x,r,k){var a=k.vec3d;x=function(){function c(a,b){this._origins=[];this._boxSize=a;this._maxNumOrigins=b}c.prototype.getOrigin=function(k){for(var n=this._origins.length,f,q=!1,l=Number.MAX_VALUE,t=0;t<n;t++){var r=this._origins[t];a.subtract(k,r.vec3,b);b[0]=Math.abs(b[0]);b[1]=Math.abs(b[1]);b[2]=Math.abs(b[2]);var v=b[0]+b[1]+b[2];v<l&&(f=r,l=v,q=b[0]<this._boxSize&&b[1]<this._boxSize&&b[2]<this._boxSize)}q||f&&null!=this._maxNumOrigins&&!(this._origins.length<
this._maxNumOrigins)||(n=c.OFFSET,f={vec3:[k[0]+n,k[1]+n,k[2]+n],id:c.ORIGIN_PREFIX+this._origins.length},this._origins.push(f));return f};c.OFFSET=1.11;c.ORIGIN_PREFIX="fb_";return c}();var b=a.create();return x})},"esri/symbols/support/unitConversionUtils":function(){define(["require","exports","../../renderers/support/utils"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.supportsUnit=function(a){return null!=k.meterIn[a]};r.getMetersPerUnit=function(a){return 1/(k.meterIn[a]||
1)}})},"esri/views/3d/layers/graphics/featureExpressionInfoUtils":function(){define(["require","exports","../../../../support/arcadeUtils"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.createContext=function(a,b,c){var t=null;a=a&&a.expression;"string"===typeof a&&(t="0"===a?0:null,null!=t?t={cachedResult:t}:(t=k.createSyntaxTree(a),k.dependsOnView(t)?(null!=c&&c.error("Expressions containing '$view' are not supported on ElevationInfo"),t={cachedResult:0}):t={arcade:{func:k.createFunction(t),
context:k.createExecContext(null,{sr:b})}}));return t};r.createFeature=function(a){return k.createFeature(a)};r.setContextFeature=function(a,b){null!=a&&null==a.cachedResult&&k.updateExecContext(a.arcade.context,b)};r.execute=function(a){if(null!=a){if(null!=a.cachedResult)return a.cachedResult;var b=a.arcade,b=k.executeFunction(b.func,b.context);"number"!==typeof b&&(b=a.cachedResult=0);return b}return 0};r.extractExpressionInfo=function(a,b){void 0===b&&(b=!1);var c=(a=a&&a.featureExpressionInfo)&&
a.expression;b||"0"===c||(a=null);return a};r.zeroContext={cachedResult:0}})},"esri/views/3d/layers/graphics/Graphics3DGraphic":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ../../../../core/asyncUtils ../../../../core/ObjectPool ../../support/aaBoundingBox ../../support/aaBoundingRect ./featureExpressionInfoUtils".split(" "),function(x,r,k,a,b,c,t,n,f){var q=new c(Array,function(a){return t.set(a,t.ZERO)},null,10,5),l=n.create();
return function(){function c(a,b,c){this.addedToSpatialIndex=!1;this._labelGraphics=[];this._auxiliaryGraphics=[];for(var l=Array(2),k=0;k<l.length;k++)l[k]=Array(3);this._visibilityFlags=l;this._featureExpressionFeature=null;this.graphics3DSymbol=b;this.graphic=a;this._graphics=c;this._featureExpressionFeature=f.createFeature(a)}c.prototype.initialize=function(a,b){var c=this;this._layer=a;this._stage=b;this.forEachSymbolLayerGraphic(function(f){f.initialize(a,b);f.setVisibility(c.isVisible())})};
c.prototype.destroy=function(){this.forEachRenderedGraphic(function(a){return a.destroy()});this._graphics.length=0;this._labelGraphics.length=0;this._auxiliaryGraphics.length=0};c.prototype.clearLabelGraphics=function(){this.forEachLabelGraphic(function(a){return a.destroy()});this._labelGraphics.length=0};c.prototype.addLabelGraphic=function(a,b,c){this._labelGraphics.push(a);a.initialize(b,c);a.setVisibility(this.isVisible(1))};c.prototype.addAuxiliaryGraphic=function(a){this._auxiliaryGraphics.push(a);
this._layer&&(a.initialize(this._layer,this._stage),a.setVisibility(this.isVisible()))};c.prototype.isDraped=function(){var a=!1;this.forEachSymbolLayerGraphic(function(b){b.isDraped()&&(a=!0)});return a};c.prototype.setDrawOrder=function(a,b,c){var f=this;c[this.graphics3DSymbol.symbol.id]=!0;this.forEachSymbolLayerGraphic(function(l,k){l.setDrawOrder(a+(1-(1+k)/f._graphics.length),b,c)})};c.prototype.areVisibilityFlagsSet=function(a,b,c){void 0===c&&(c=0);c=this._visibilityFlags[c];if(null!=a)return c[a];
a=!0;for(var f=0;f<c.length;f++)if(f!==b){var l=c[f];a=a&&(null==l||!0===l)}return a};c.prototype.isVisible=function(a){void 0===a&&(a=0);for(var b=!0,c=0;c<=a;c++)for(var f=this._visibilityFlags[c],l=0;l<f.length;l++)var k=f[l],b=b&&(null==k||!0===k);return b};c.prototype.setVisibilityFlag=function(a,b,c){void 0===c&&(c=0);var f=this.isVisible(c);this._visibilityFlags[c][a]=b;var l=this.isVisible(c);if(f!==l){if(1===c)this.forEachLabelGraphic(function(a){return a.setVisibility(l)});else{this.forEachSymbolLayerGraphic(function(a){return a.setVisibility(l)});
var k=this.isVisible(1);this.forEachLabelGraphic(function(a){return a.setVisibility(k)})}return!0}return!1};c.prototype.getBSRadius=function(){var a=0;this.forEachSymbolLayerGraphic(function(b){a=Math.max(a,b.getBSRadius())});return a};c.prototype.getCenterObjectSpace=function(){return this._graphics[0].getCenterObjectSpace()};c.prototype.getProjectedBoundingBox=function(c,f,r,y){return a(this,void 0,void 0,function(){var v=this;return k(this,function(w){switch(w.label){case 0:return y||(y={boundingBox:null,
requiresDrapedElevation:!1,screenSpaceObjects:[]}),y.boundingBox?t.set(y.boundingBox,t.NEGATIVE_INFINITY):y.boundingBox=t.create(t.NEGATIVE_INFINITY),y.requiresDrapedElevation=!1,[4,b.forEach(this._graphics,function(b){return a(v,void 0,void 0,function(){var a,l,n;return k(this,function(k){switch(k.label){case 0:if(!b)return[2];a=b.isDraped()?f:c;l=q.acquire();return[4,b.getProjectedBoundingBox(a,r,l,y.screenSpaceObjects)];case 1:return n=k.sent(),isFinite(n[2])&&isFinite(n[5])||(y.requiresDrapedElevation=
!0),n&&t.expand(y.boundingBox,l),q.release(l),[2]}})})})];case 1:return w.sent(),t.allFinite(y.boundingBox)||n.allFinite(t.toRect(y.boundingBox,l))?[2,y]:[2,null]}})})};c.prototype.needsElevationUpdates=function(){for(var a=0,b=this._graphics;a<b.length;a++){var c=b[a];if(c&&c.needsElevationUpdates)return!0}a=0;for(b=this._labelGraphics;a<b.length;a++)if((c=b[a])&&c.needsElevationUpdates)return!0;return!1};c.prototype.alignWithElevation=function(a,b){var c=this;this.forEachRenderedGraphic(function(f){f.alignWithElevation(a,
b,c._featureExpressionFeature)})};c.prototype.addHighlight=function(a,b){this.forEachSymbolLayerGraphic(function(c){return c.addHighlight(a,b)})};c.prototype.removeHighlight=function(a){this.forEachSymbolLayerGraphic(function(b){return b.removeHighlight(a)})};c.prototype.forEachGraphicList=function(a,b){a.forEach(function(a,c){return a&&b(a,c)})};c.prototype.forEachSymbolLayerGraphic=function(a){this.forEachGraphicList(this._graphics,a);this.forEachGraphicList(this._auxiliaryGraphics,a)};c.prototype.forEachLabelGraphic=
function(a){this.forEachGraphicList(this._labelGraphics,a)};c.prototype.forEachRenderedGraphic=function(a){this.forEachSymbolLayerGraphic(a);this.forEachLabelGraphic(a)};return c}()})},"esri/core/asyncUtils":function(){define(["require","exports","./tsSupport/generatorHelper","./tsSupport/awaiterHelper","./promiseUtils"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});r.forEach=function(c,t,n){return a(this,void 0,void 0,function(){return k(this,function(a){switch(a.label){case 0:return[4,
b.eachAlways(c.map(function(a,b){return t.apply(n,[a,b])}))];case 1:return a.sent(),[2]}})})};r.map=function(c,t,n){return a(this,void 0,void 0,function(){var a;return k(this,function(f){switch(f.label){case 0:return[4,b.eachAlways(c.map(function(a,b){return t.apply(n,[a,b])}))];case 1:return a=f.sent(),[2,a.map(function(a){return a.value})]}})})}})},"esri/views/3d/layers/graphics/Graphics3DWebStyleSymbol":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../support/PromiseLightweight"],
function(x,r,k,a){return function(a){function b(b,c){var f=a.call(this)||this;f.symbol=null;f.graphics3DSymbol=null;f.symbol=b;b.fetchSymbol().then(function(a){if(f.isRejected())throw Error();f.graphics3DSymbol=c(a)}).then(function(){if(f.isRejected())throw Error();f.graphics3DSymbol.then(function(){f.isRejected()||f.resolve()},function(a){f.isRejected()||f.reject(a)})}).otherwise(function(a){f.isRejected()||f.reject(a)});return f}k(b,a);b.prototype.createGraphics3DGraphic=function(a,b){return this.graphics3DSymbol.createGraphics3DGraphic(a,
b,this)};b.prototype.layerPropertyChanged=function(a,b){return this.graphics3DSymbol.layerPropertyChanged(a,b)};b.prototype.applyRendererDiff=function(a,b,c){return this.graphics3DSymbol.applyRendererDiff(a,b,c)};b.prototype.getFastUpdateStatus=function(){return this.graphics3DSymbol?this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}};b.prototype.setDrawOrder=function(a,b){return this.graphics3DSymbol.setDrawOrder(a,b)};b.prototype.destroy=function(){this.isFulfilled()||this.reject();
this.graphics3DSymbol&&this.graphics3DSymbol.destroy()};return b}(a.Promise)})},"esri/views/3d/layers/graphics/Graphics3DSymbolFactory":function(){define(["require","exports","./Graphics3DSymbol","./Graphics3DPointSymbol"],function(x,r,k,a){Object.defineProperty(r,"__esModule",{value:!0});r.make=function(b,c,t){var n;switch(b.type){case "point-3d":n=a;break;default:n=k}return new n(b,c,t)}})},"esri/views/3d/layers/graphics/Graphics3DSymbol":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../support/PromiseLightweight ./Graphics3DGraphic ./Graphics3DSymbolLayerFactory".split(" "),
function(x,r,k,a,b,c){return function(a){function n(b,k,l){var f=a.call(this)||this;f.symbol=b;b=b.symbolLayers;l&&(b=l.concat(b));l=b.length;f.childGraphics3DSymbols=Array(b.length);f.childGraphics3DSymbolPromises=Array(b.length);for(var n=k.layerOrder,q=0,t=0,r=!1,x=function(a,b){b&&(this.childGraphics3DSymbols[a]=b,t++);q--;!this.isRejected()&&r&&1>q&&(0<t?this.resolve():this.reject())},G=0;G<l;G++){var p=b.getItemAt(G);!1!==p.enabled&&(k.layerOrder=n+(1-(1+G)/l),k.layerOrderDelta=1/l,p=c.make(f.symbol,
p,k,p._ignoreDrivers))&&(q++,f.childGraphics3DSymbolPromises[G]=p,p.then(x.bind(f,G,p),x.bind(f,G,null)))}k.layerOrder=n;r=!0;!f.isRejected()&&1>q&&f.resolve();return f}k(n,a);n.prototype.createGraphics3DGraphic=function(a,c,l){for(var f=Array(this.childGraphics3DSymbols.length),k=0;k<this.childGraphics3DSymbols.length;k++){var n=this.childGraphics3DSymbols[k];n&&(f[k]=n.createGraphics3DGraphic(a,c))}return new b(a,l||this,f)};n.prototype.layerPropertyChanged=function(a,b){for(var c=this.childGraphics3DSymbols.length,
f=function(c){var f=k.childGraphics3DSymbols[c],l=function(a){return a._graphics[c]};if(f&&!f.layerPropertyChanged(a,b,l))return{value:!1}},k=this,n=0;n<c;n++){var q=f(n);if("object"===typeof q)return q.value}return!0};n.prototype.applyRendererDiff=function(a,b,c){return this.isResolved()?this.childGraphics3DSymbols.reduce(function(f,l,k){return f&&(!l||l.applyRendererDiff(a,b,c,k))},!0):!1};n.prototype.getFastUpdateStatus=function(){var a=0,b=0,c=0;this.childGraphics3DSymbolPromises.forEach(function(f){f&&
!f.isFulfilled()?a++:f&&f.isFastUpdatesEnabled()?c++:f&&b++});return{loading:a,slow:b,fast:c}};n.prototype.setDrawOrder=function(a,b){for(var c=this.childGraphics3DSymbols.length,f=1/c,k=0;k<c;k++){var n=this.childGraphics3DSymbols[k];n&&n.setDrawOrder(a+(1-(1+k)/c),f,b)}};n.prototype.destroy=function(){this.isFulfilled()||this.reject();for(var a=0;a<this.childGraphics3DSymbolPromises.length;a++)this.childGraphics3DSymbolPromises[a]&&this.childGraphics3DSymbolPromises[a].destroy()};return n}(a.Promise)})},
"esri/views/3d/layers/graphics/Graphics3DSymbolLayerFactory":function(){define("require exports ../../../../core/Logger ./Graphics3DIconSymbolLayer ./Graphics3DObjectSymbolLayer ./Graphics3DLineSymbolLayer ./Graphics3DPathSymbolLayer ./Graphics3DFillSymbolLayer ./Graphics3DExtrudeSymbolLayer ./Graphics3DTextSymbolLayer".split(" "),function(x,r,k,a,b,c,t,n,f,q){Object.defineProperty(r,"__esModule",{value:!0});var l=k.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayerFactory");r.make=function(a,
b,c,f){var k=y[b.type];return k?new k(a,b,c,f):(l.error("GraphicsLayerFactory#make","unknown symbol type "+b.type),null)};var y={icon:a,object:b,line:c,path:t,fill:n,extrude:f,text:q}})},"esri/views/3d/layers/graphics/Graphics3DIconSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang dojo/when dojo/errors/CancelError ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DDrapedGraphicLayer ./ElevationAligners ./Graphics3DSymbolCommonCode ./SignedDistanceFunctions ../support/FastSymbolUpdates ./graphicUtils ../../../../core/screenUtils ../../../../core/sniff ../../../../core/Error ../../../../symbols/support/symbolUtils ../../../../Color ../../../../geometry/Polygon ../../support/projectionUtils ../../lib/glMatrix ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/lib/Texture ../../webgl-engine/materials/HUDMaterial ../../../../core/urlUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N){function R(a){return"cross"===a||"x"===a}function S(a){var b;"primitive:"===a.substring(0,10)&&(a=a.substring(10));switch(a){case m.PRIM_CIRCLE:b=y.computeSignedDistancefieldCicle(128,64);break;case m.PRIM_SQUARE:b=y.computeSignedDistancefieldSquare(128,64,!1);break;case m.PRIM_KITE:b=y.computeSignedDistancefieldSquare(128,64,!0);break;case m.PRIM_CROSS:b=y.computeSignedDistancefieldCrossAndX(128,64,!1);break;case m.PRIM_X:b=y.computeSignedDistancefieldCrossAndX(128,
64,!0)}return new P(b,"sdf_"+a,{mipmap:!1,wrapClamp:!0,width:128,height:128,components:4})}var T=J.vec3d;x=J.vec4d;var V=J.mat4d.identity(),h=[0,0,1],ca=[0,0,0,0],Q=[0,0,0],e=[1,1,1],d="center bottom top left right bottom-left bottom-right top-left top-right".split(" "),g=[.25,.25,.75,.75],m={PRIM_CIRCLE:"circle",PRIM_SQUARE:"square",PRIM_CROSS:"cross",PRIM_X:"x",PRIM_KITE:"kite"},u=[64,64];t=function(m){function t(){var a=null!==m&&m.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!0,
supportsOnTheGround:!0};return a}k(t,m);t.prototype._prepareResources=function(){var a=this.symbol,b=Math.round(null!=a.size?w.pt2px(a.size):16);this._size=null;this._symbolTextureRatio=1;this._primitive=null;var d=this._getStageIdHint();if(!this._isPropertyDriven("size")){var e=v.validateSymbolLayerSize(b);if(e){this._logWarning(e);this.reject();return}}this._isPropertyDriven("size")&&64>b&&(b=64);var c=a.resource||{primitive:"circle",href:void 0},e={anchorPos:this._getAnchorPos(a)},f=this.symbolContainer;
if(this._hasVisibleVerticalOffset(f)){var f=f.verticalOffset,h=f.minWorldLength,l=f.maxWorldLength;e.verticalOffset={screenLength:w.pt2px(f.screenLength),minWorldLength:h||0,maxWorldLength:null!=l?l:Infinity}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);c.href?(this._outlineSize=this._getOutlineSize(a,null),e.color=this._getFillColor(a,null),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize,
e.textureIsSignedDistanceField=!1,this._prepareImageResources(b,e,d)):(c=c.primitive||"circle",f="primitive:"+c,this._primitive=c,this._outlineSize=this._getOutlineSize(a,c),e.color=this._getFillColor(a,c),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize,R(c)&&0===e.outlineSize?this.reject():(this.texture=this._context.sharedResources.textures.acquire(f,S),this._textureURI=f,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=g,e.textureId=this.texture.getId(),this._size=
[b,b],this._symbolTextureRatio=2,this._createMaterialsAndAddToStage(e,this._context.stage,d),this.resolve()))};t.prototype._getOutlineSize=function(a,b){var d=0,d=a.outline&&null!=a.outline.size?w.pt2px(a.outline.size):R(b)?1.5:0;return Math.max(d,0)};t.prototype._getOutlineColor=function(a){var b=this._getLayerOpacity();if(a.outline&&null!=a.outline.color){var d=p.toUnitRGB(a.outline.color);return[d[0],d[1],d[2],a.outline.color.a*b]}return[0,0,0,b]};t.prototype._getFillColor=function(a,b){return R(b)?
ca:this._getMaterialOpacityAndColor()};t.prototype._getAnchorPos=function(a){return-1<d.indexOf(a.anchor)?a.anchor:"center"};t.prototype._prepareImageResources=function(a,d,e){var g=this,f=G.getIconHref(this.symbolContainer,this.symbol);!D("esri-canvas-svg-support")&&N.isSVG(f)?(this._logWarning("IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)"),this.reject(new F("SVG Not Supported","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)"))):(b(this._context.sharedResources.textures.acquire(f,
null,a),function(b){if(!g.isRejected()){var c=b.params,f=c.width/c.height;g._size=a?1<f?[a,Math.round(a/f)]:[Math.round(a*f),a]:[c.width,c.height];d.textureId=b.getId();g._createMaterialsAndAddToStage(d,g._context.stage,e);g.resolve()}},function(a){a instanceof c?g.reject():(a="IconSymbol3DLayer failed to load (Request for icon resource failed: "+f+")",g._logWarning(a),g.reject(new F("Request Failed",a)))}),this._textureURI=f)};t.prototype._createMaterialsAndAddToStage=function(b,d,e){this._fastUpdates=
B.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled&&a.mixin(b,this._fastUpdates.materialParameters);var c=a.mixin({},b);c.verticalOffset=null;c.screenSizePerspective=null;c.occlusionTest=!1;c.shaderPolygonOffset=0;this._drapedMaterial=new U(c,e+"_iconDraped");d.add(I.ModelContentType.MATERIAL,this._drapedMaterial);b.occlusionTest=!0;this._material=new U(b,e+"_icon");d.add(I.ModelContentType.MATERIAL,
this._material)};t.prototype.destroy=function(){m.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(I.ModelContentType.MATERIAL,this._material.getId()),this._material=null);this._drapedMaterial&&(this._context.stage.remove(I.ModelContentType.MATERIAL,this._drapedMaterial.getId()),this._drapedMaterial=null);this._textureURI&&(this._context.sharedResources.textures.release(this._textureURI),this._textureURI=null)};t.prototype._getGeometry=function(a){a=
this._validateGeometry(a.geometry);if("extent"===a.type)return l.placePointOnPolygon(z.fromExtent(a));if("polyline"===a.type)return l.placePointOnPolyline(a);if("polygon"===a.type)return l.placePointOnPolygon(a);if("point"===a.type)return a;this._logWarning("unsupported geometry type for icon symbol: "+a.type);return null};t.prototype._getScaleFactor=function(a){if(this._isPropertyDriven("size")&&a.size){for(var b=0;3>b;b++){var d=a.size[b];d&&"symbolValue"!==d&&"proportional"!==d&&(a.size[b]=w.pt2px(d))}b=
this._size[0]>this._size[1]?this._size[0]:this._size[1];if("symbolValue"!==a.size[0]){if(isFinite(+a.size[0]))return+a.size[0]/b;if(isFinite(+a.size[2]))return+a.size[2]/b}}return 1};t.prototype.createGraphics3DGraphic=function(a,b){var d=this._getGeometry(a);if(null===d)return null;var e="graphic"+a.uid,c=this._getVertexOpacityAndColor(b),g=1;this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size||(g=this._getScaleFactor(b));g*=this._symbolTextureRatio;b=[this._size[0]*g,this._size[1]*
g];g=this.getGraphicElevationContext(a);return"on-the-ground"===g.mode?this._createAsOverlay(a,d,c,b,g,e,a.uid):this._createAs3DShape(a,d,c,b,g,e,a.uid)};t.prototype.layerPropertyChanged=function(a,b,d){if("opacity"===a)return b=this._getFillColor(this.symbol,this._primitive),this._drapedMaterial.setParameterValues({color:b}),this._material.setParameterValues({color:b}),b=this._getOutlineColor(this.symbol),this._drapedMaterial.setParameterValues({outlineColor:b}),this._material.setParameterValues({outlineColor:b}),
!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var e=this._elevationContext.mode;if("on-the-ground"===a&&"on-the-ground"===e)return!0;if(a!==e&&("on-the-ground"===a||"on-the-ground"===e))return!1;a=l.needsElevationUpdates2D(e)||"absolute-height"===e;for(var c in b){var g=b[c];(e=d(g))&&!e.isDraped()&&(g=this.getGraphicElevationContext(g.graphic),e.needsElevationUpdates=a,e.elevationContext.set(g))}return!0}return!1};t.prototype.applyRendererDiff=function(a,
b,d,e){for(var c in a.diff)switch(c){case "visualVariables":if(B.updateFastSymbolUpdatesState(this._fastUpdates,b,this._fastVisualVariableConvertOptions()))this._material.setParameterValues(this._fastUpdates.materialParameters),this._drapedMaterial.setParameterValues(this._fastUpdates.materialParameters);else return!1;break;default:return!1}return!0};t.prototype.setDrawOrder=function(a,b,d){this._drapedMaterial&&(this._drapedMaterial.setRenderPriority(a),d[this._drapedMaterial.getId()]=!0)};t.prototype._defaultElevationInfoNoZ=
function(){return C};t.prototype._createAs3DShape=function(a,b,d,e,c,g,f){var m=this,k=this._getFastUpdateAttrValues(a);a=k?function(a){return B.evaluateModelTransform(m._fastUpdates.materialParameters,k,a)}:null;d=L.createPointGeometry(h,null,d,e,M,null,k);d=[new K(d,g)];g=l.createStageObjectForPoint.call(this,b,d,[[this._material]],null,null,c,g,this._context.layer.uid,f,!0,a);if(null===g)return null;var p=new n(this,g.object,d,null,null,q.perObjectElevationAligner,c);p.alignedTerrainElevation=
g.terrainElevation;p.needsElevationUpdates=l.needsElevationUpdates2D(c.mode)||"absolute-height"===c.mode;p.getScreenSize=this._createScreenSizeGetter(e,a);p.calculateRelativeScreenBounds=function(a){return m._material.calculateRelativeScreenBounds(p.getScreenSize(),1,a)};l.extendPointGraphicElevationContext(p,b,this._context.elevationProvider);return p};t.prototype._createAsOverlay=function(a,b,d,e,c,g,m){var k=this;this._drapedMaterial.setRenderPriority(this._symbolLayerOrder);m=T.create();A.pointToVector(b,
m,this._context.overlaySR);m[2]=this._getDrapedZ();if((b=this._context.clippingExtent)&&!l.pointInBox2D(m,b))return null;var n=this._getFastUpdateAttrValues(a);a=n?function(a){return B.evaluateModelTransform(k._fastUpdates.materialParameters,n,a)}:null;d=L.createPointGeometry(h,m,d,e,null,null,n);b=new O(d);b.material=this._drapedMaterial;b.center=m;b.bsRadius=0;b.transformation=V;b.name=g;b.uniqueName=g+"#"+d.id;var p=new f(this,[b],null,null,null,c);p.getScreenSize=this._createScreenSizeGetter(e,
a);p.calculateRelativeScreenBounds=function(a){return k._drapedMaterial.calculateRelativeScreenBounds(p.getScreenSize(),1,a)};return p};t.prototype._createScreenSizeGetter=function(a,b){var d=this._outlineSize+2;if(this._fastUpdates.enabled){var e=a[0]/this._symbolTextureRatio,c=a[1]/this._symbolTextureRatio;return function(a){void 0===a&&(a=Array(2));var g=b(V);a[0]=g[0]*e+d;a[1]=g[5]*c+d;return a}}var g=a[0]/this._symbolTextureRatio+d,f=a[1]/this._symbolTextureRatio+d;return function(a){void 0===
a&&(a=Array(2));a[0]=g;a[1]=f;return a}};t.prototype._supportsShaderVisualVariables=function(){return!0};t.prototype._fastVisualVariableConvertOptions=function(){var a=this._size[0]>this._size[1]?this._size[0]:this._size[1],b=[a,a,a],d=w.px2pt(1),a=a*d;return{modelSize:b,symbolSize:[a,a,a],unitInMeters:d,transformation:{anchor:Q,scale:e,rotation:Q}}};t.prototype._hasVisibleVerticalOffset=function(a){return this.symbolContainer&&"point-3d"===this.symbolContainer.type&&this.symbolContainer.hasVisibleVerticalOffset()};
t.PRIMITIVE_SIZE=u;t.VALID_ANCHOR_STRINGS=d;return t}(t);var C={mode:"relative-to-ground",offset:0},M=x.createFrom(0,0,0,1);return t})},"esri/views/3d/layers/graphics/Graphics3DSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../support/PromiseLightweight ./featureExpressionInfoUtils ./ElevationContext ./graphicUtils ./Graphics3DSymbolCommonCode ./constants ../../../../core/Logger ../../../../Color ../../../../core/Scheduler".split(" "),function(x,r,k,a,
b,c,t,n,f,q,l,y){function B(a,b){a=null!=a?b.attributes[a]:0;null!=a&&isFinite(a)||(a=0);return a}var v=new c,w=q.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer"),D={mode:"on-the-ground",offset:0,unit:"meters"},F={mode:"absolute-height",offset:0,unit:"meters"};return function(a){function p(b,f,l,k){var n=a.call(this)||this;n._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};n.symbolContainer=b;n.symbol=f;n._context=l;n._symbolLayerOrder=l.layerOrder;n._symbolLayerOrderDelta=
l.layerOrderDelta;n._elevationContext=new c;n._material=null;n._geometryCreationWarningHandle=null;n._updateDrivenProperties(k);n._updateElevationContext();n._prepareResources();return n}k(p,a);p.prototype._logWarning=function(a){w.warn(a)};p.prototype._logGeometryCreationWarnings=function(a,b,c,f){var l=this;if(null==this._geometryCreationWarningHandle){var k=a.geometryData&&a.geometryData.polygons;f+=" geometry failed to be created";var n=null;a.projectionSuccess?!b.length||1===b.length&&!b[0].length?
n=f+" (no "+c+" were defined)":Array.isArray(b)&&Array.isArray(b[0])?b.some(function(a){return 1===a.length})?n=f+" ("+c+" should contain at least 2 vertices)":k&&0===k.length&&"rings"===c&&(n=f+" (filled "+c+" should use clockwise winding - try reversing the order of vertices)"):n=f+" ("+c+" should be defined as a 2D array)":n=f+" (failed to project geometry to view spatial reference)";n&&(this._geometryCreationWarningHandle=y.schedule(function(){return l._onNextTick()}),this._logWarning(n))}};p.prototype._onNextTick=
function(){this._geometryCreationWarningHandle=null};p.prototype._validateGeometry=function(a){switch(a.type){case "point":if(null==a.x||null==a.y){this._logWarning("point coordinate is null - setting to default value");var b=a.clone();b.x=a.x||0;b.y=a.y||0;return b}}return a};p.prototype._prepareResources=function(a){throw Error("This is an abstract base class");};p.prototype._defaultElevationInfoNoZ=function(){return D};p.prototype._defaultElevationInfoZ=function(){return F};p.prototype._updateElevationContext=
function(){this._elevationContext.setDefaults();var a=this._context.layer.elevationInfo;a&&this._elevationContext.mixinApi(a);(a=this.symbol&&this.symbol.elevationInfo)&&this._elevationContext.mixinApi(a);this._elevationContext.featureExpressionInfoContext=this._context.featureExpressionInfoContext};p.prototype.getGraphicElevationContext=function(a){var c=a.geometry.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ();v.setUnit(null!=this._elevationContext.unit?this._elevationContext.unit:
c.unit);v.mode=this._elevationContext.mode||c.mode;v.setOffsetMeters(null!=this._elevationContext.meterUnitOffset?this._elevationContext.meterUnitOffset:c.offset);v.featureExpressionInfoContext=this._elevationContext.featureExpressionInfoContext;v.hasOffsetAdjustment=!1;this._elevationOptions.supportsOnTheGround||"on-the-ground"!==v.mode||(v.mode="relative-to-ground",v.setOffsetMeters(0),v.featureExpressionInfoContext=b.zeroContext);c=b.createFeature(a);b.setContextFeature(v.featureExpressionInfoContext,
c);n.needsOffsetAdjustment(v,this._elevationOptions,a.geometry,this.symbolContainer)&&(v.setOffsetRenderUnits(f.defaultIconElevationOffset),v.hasOffsetAdjustment=!0);return v};p.prototype._getDrapedZ=function(){return-2};p.prototype._updateDrivenProperties=function(a){var b={color:!1,opacity:!1,size:!1};!a&&(a=this._context.renderer)&&(b.color=!!a.colorInfo,b.size=!!a.sizeInfo,a.visualVariables&&a.visualVariables.forEach(function(a){switch(a.type){case "color":b.color=!0;if(a.colors)for(var c=0;c<
a.colors.length;c++){var f=a.colors[c];f&&(Array.isArray(f)&&3<f.length&&255!==f[3]||void 0!==f.a&&255!==f.a)&&(b.opacity=!0)}if(a.stops)for(c=0;c<a.stops.length;c++)(f=a.stops[c].color)&&(Array.isArray(f)&&3<f.length&&255!==f[3]||void 0!==f.a&&255!==f.a)&&(b.opacity=!0);break;case "opacity":b.opacity=!0;break;case "size":b.size=!0}}));this._drivenProperties=b};p.prototype._isPropertyDriven=function(a){return this._drivenProperties[a]};p.prototype._getLayerOpacity=function(){if(this._context.layerView&&
"fullOpacity"in this._context.layerView)return this._context.layerView.fullOpacity;var a=this._context.layer.opacity;return null==a?1:a};p.prototype._getMaterialOpacity=function(){var a;a=1*this._getLayerOpacity();var b=this.symbol&&this.symbol.material;b&&!this._isPropertyDriven("opacity")&&b.color&&(a*=b.color.a);return a};p.prototype._getMaterialOpacityAndColor=function(){var a=this.symbol&&this.symbol.material,b=this._getMaterialOpacity(),a=!this._isPropertyDriven("color")&&a&&a.color?l.toUnitRGB(a.color):
null;return t.mixinColorAndOpacity(a,b)};p.prototype._getVertexOpacityAndColor=function(a,b,c){var f=this._isPropertyDriven("color")?a.color:null;a=this._isPropertyDriven("opacity")?a.opacity:null;f=t.mixinColorAndOpacity(f,a);c&&(f[0]*=c,f[1]*=c,f[2]*=c,f[3]*=c);return b?new b(f):f};p.prototype._getStageIdHint=function(){return this._context.layer.id+"_symbol"};p.prototype.isFastUpdatesEnabled=function(){return this._fastUpdates&&this._fastUpdates.enabled};p.prototype.setDrawOrder=function(a,b,c){this._material&&
(this._material.setRenderPriority(a),c[this._material.getId()]=!0)};p.prototype.createGraphics3DGraphic=function(a,b){for(var c=2;c<arguments.length;c++);throw Error("This is an abstract base class");};p.prototype.destroy=function(){this._geometryCreationWarningHandle&&(this._geometryCreationWarningHandle.remove(),this._geometryCreationWarningHandle=null)};p.prototype.layerPropertyChanged=function(a,b,c){return!1};p.prototype.applyRendererDiff=function(a,b,c,f){return!1};p.prototype._getFastUpdateAttrValues=
function(a){if(!this._fastUpdates.enabled)return null;var b=this._fastUpdates.visualVariables,c=b.size?B(b.size.field,a):0;a=b.color?B(b.color.field,a):0;return[c,a,0,0]};return p}(a.Promise)})},"esri/views/3d/layers/graphics/ElevationContext":function(){define(["require","exports","../../../../symbols/support/unitConversionUtils","./featureExpressionInfoUtils"],function(x,r,k,a){return function(){function b(a){a?this.set(a):this.setDefaults()}Object.defineProperty(b.prototype,"meterUnitOffset",{get:function(){return this._meterUnitOffset},
enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"unit",{get:function(){return this._unit},enumerable:!0,configurable:!0});b.prototype.setUnit=function(a){this._unit=a;this._metersPerElevationInfoUnit=k.getMetersPerUnit(a)};b.prototype.setDefaults=function(){this.mode=null;this._renderUnitOffset=this._meterUnitOffset=0;this.featureExpressionInfoContext=null;this.hasOffsetAdjustment=!1;this.setUnit("meters")};b.prototype.set=function(a){this.mode=a.mode;this._meterUnitOffset=a._meterUnitOffset||
0;this._renderUnitOffset=a._renderUnitOffset||0;this.featureExpressionInfoContext=a.featureExpressionInfoContext;this.hasOffsetAdjustment=a.hasOffsetAdjustment;this.setUnit(a.unit)};b.prototype.setOffsetMeters=function(a){this._meterUnitOffset=a;this._renderUnitOffset=0};b.prototype.setOffsetElevationInfoUnits=function(a){this._meterUnitOffset=a*this._metersPerElevationInfoUnit;this._renderUnitOffset=0};b.prototype.setOffsetRenderUnits=function(a){this._meterUnitOffset=0;this._renderUnitOffset=a};
b.prototype.addOffsetRenderUnits=function(a){this._renderUnitOffset+=a};b.prototype.mixinApi=function(a){null!=a.mode&&(this.mode=a.mode);null!=a.unit&&this.setUnit(a.unit);null!=a.offset&&this.setOffsetElevationInfoUnits(a.offset)};b.prototype.calculateOffsetRenderUnits=function(b){var c=this._meterUnitOffset,k=this.featureExpressionInfoContext;null!=k&&(c+=a.execute(k)*this._metersPerElevationInfoUnit);return c/b.unitInMeters+this._renderUnitOffset};return b}()})},"esri/views/3d/layers/graphics/Graphics3DSymbolCommonCode":function(){define("require exports ../../../../geometry/Point ../../../../symbols/callouts/calloutUtils ../../../../geometry/support/coordsUtils ./graphicUtils ../../support/projectionUtils ../../lib/glMatrix ../../webgl-engine/lib/Object3D".split(" "),
function(x,r,k,a,b,c,t,n,f){function q(a,b,c,f,l){var k=0,n=b.z||0,p=0,p=c.mode;f=c.calculateOffsetRenderUnits(f);c=c.featureExpressionInfoContext;"on-the-ground"===p?(k=p=a.getElevation(b,"ground")||0,l&&(l.verticalDistanceToGround=0,l.terrainElevation=p)):"relative-to-ground"===p?(p=a.getElevation(b,"ground")||0,k=f,null==c&&(k+=n),l&&(l.verticalDistanceToGround=k,l.terrainElevation=p),k+=p):"relative-to-scene"===p?(p=a.getElevation(b,"scene")||0,k=f,l&&(l.verticalDistanceToGround=k,l.terrainElevation=
p),k+=p):"absolute-height"===p&&(k=f,null==c&&(k+=n),l&&(p=a.getElevation(b,"ground")||0,l.verticalDistanceToGround=k-p,l.terrainElevation=p));return k}function l(a){for(var b=0,c=a.length-1,f=0;f<c;f++)b+=a[f][0]*a[f+1][1]-a[f+1][0]*a[f][1];return 0<=b}function y(a,b,c,f,l,k){f*=3;for(var n=0;n<l;++n){var p=a[b++];c[f++]=p[0];c[f++]=p[1];c[f++]=k?p[2]:0}return f/3}function B(a,b){for(var c=a.length,f=Array(c),k=Array(c),n=Array(c),p=0,q=0,t=0,r=0,v=0;v<c;++v)r+=a[v].length;for(var r=new Float64Array(3*
r),h=0,w=c-1;0<=w;w--){var A=a[w];if(l(A))f[p++]=A;else{for(var e=A.length,v=0;v<p;++v)e+=f[v].length;v={index:h,pathLengths:Array(p+1),count:e,holeIndices:Array(p)};v.pathLengths[0]=A.length;0<A.length&&(n[t++]={index:h,count:A.length});h=y(A,0,r,h,A.length,b);for(A=0;A<p;++A)e=f[A],v.holeIndices[A]=h,v.pathLengths[A+1]=e.length,0<e.length&&(n[t++]={index:h,count:e.length}),h=y(e,0,r,h,e.length,b);p=0;0<v.count&&(k[q++]=v)}}for(A=0;A<p;++A)e=f[A],0<e.length&&(n[t++]={index:h,count:e.length}),h=y(e,
0,r,h,e.length,b);q<c&&(k.length=q);t<c&&(n.length=t);return{vertexData:r,polygons:k,outlines:n}}function v(a,b,c,f,l){b*=3;f*=3;for(var k=0;k<l;++k)c[f++]=a[b++],c[f++]=a[b++],c[f++]=a[b++]}function w(a,b,c,f,l,k,n){return t.bufferToBuffer(a,c,b,f,k,l,n)}function D(a,b,c){t.pointToVector(a,b,c)}function F(a,b){return!(a[0]>b[3]||a[0]<b[0]||a[1]>b[4]||a[1]<b[1])}function G(a,b){return!(b[0]>a[3]||b[3]<a[0]||b[1]>a[4]||b[4]<a[1])}Object.defineProperty(r,"__esModule",{value:!0});x=n.mat4d;var p=n.vec3d.create(),
z=x.identity(),A=new k({x:0,y:0,z:0,spatialReference:null});r.createStageObjectForPoint=function(a,b,l,k,n,r,v,A,w,y,B){var h=b?b.length:0,x=this._context.clippingExtent;D(a,p,this._context.elevationProvider.spatialReference);if(x&&!F(p,x))return null;D(a,p,this._context.renderSpatialReference);x=this._context.localOriginFactory.getOrigin(p);v=new f({castShadow:!1,metadata:{layerUid:A,graphicId:w,usesVerticalDistanceToGround:!!y},idHint:v});for(A=0;A<h;A++)v.addGeometry(b[A],l[A],k?k[A]:z,n,x,B);
b=this._context.renderSpatialReference;k=this._context.elevationProvider;n=this._context.renderCoordsHelper;l=0;var I;v.metadata.usesVerticalDistanceToGround?(l=q(k,a,r,n,J),c.updateVertexAttributeAuxpos1w(v,J.verticalDistanceToGround),I=J.terrainElevation):(B="absolute-height"!==r.mode,l=q(k,a,r,n,B?J:null),B&&(I=J.terrainElevation));r=v.getObjectTransformation();p[0]=a.x;p[1]=a.y;p[2]=l;t.computeLinearTransformation(a.spatialReference,p,r,b)?v.setObjectTransformation(r):console.warn("Could not locate symbol object properly, it might be misplaced");
return{object:v,terrainElevation:I}};r.extendPointGraphicElevationContext=function(a,b,c){a=a.elevationContext;c=c.spatialReference;D(b,p,c);a.centerPointInElevationSR=new k({x:p[0],y:p[1],z:b.hasZ?p[2]:0,spatialReference:c})};r.placePointOnPolyline=function(a){var c=a.paths[0];if(!c||0===c.length)return null;c=b.getPointOnPath(c,b.getPathLength(c)/2);return new k({x:c[0],y:c[1],z:c[2],spatialReference:a.spatialReference})};r.placePointOnPolygon=function(a){return c.computeCentroid(a)};r.computeElevation=
q;r.getSingleSizeDriver=function(a,b){void 0===b&&(b=0);return isFinite(a[b])?a[b]:null};r.isCounterClockwise=l;r.copyPointData=y;r.copyPathData=B;r.copyVertices=v;r.chooseOrigin=function(a,b,c,f){b=Math.floor(b+(c-1)/2);f[0]=a[3*b+0];f[1]=a[3*b+1];f[2]=a[3*b+2]};r.subtractCoordinates=function(a,b,c,f){b*=3;for(var l=0;l<c;++l)a[b++]-=f[0],a[b++]-=f[1],a[b++]-=f[2]};r.setZ=function(a,b,c,f){b*=3;for(var l=0;l<c;++l)a[b+2]=f,b+=3};r.offsetZ=function(a,b,c,f){b*=3;for(var l=0;l<c;++l)a[b+2]+=f,b+=3};
r.scaleZ=function(a,b,c,f){b*=3;for(var l=0;l<c;++l)a[b+2]*=f,b+=3};r.flatArrayToArrayOfArrays=function(a,b,c){var f=[];b*=3;for(var l=0;l<c;++l)f.push([a[b++],a[b++],a[b++]]);return f};r.reproject=w;r.reprojectPoint=D;r.getGeometryVertexData3D=function(a,b,c,f,l,k,n){var p=l.spatialReference;a=B(a,b);b=a.vertexData;var q=b.length/3,t=new Float64Array(b.length),r=!0;c.equals(p)?v(b,0,t,0,b.length):r=w(b,0,c,t,0,p,q);var h=c=0,y=n.mode,z=0,e=0,d=0;k=n.calculateOffsetRenderUnits(k);n=n.featureExpressionInfoContext;
A.spatialReference=l.spatialReference;c*=3;for(var h=3*h,g=0;g<q;++g)A.x=t[c+0],A.y=t[c+1],A.z=t[c+2],"on-the-ground"===y?(e=z=l.getElevation(A)||0,d+=z):"relative-to-ground"===y?(z=l.getElevation(A)||0,e=z+k,null==n&&(e+=A.z),d+=z):"relative-to-scene"===y?(z=l.getElevation(A,"scene")||0,e=z+k,d+=z):"absolute-height"===y&&(e=k,null==n&&(e+=A.z)),b[h+0]=t[c+0],b[h+1]=t[c+1],b[h+2]=e,c+=3,h+=3;l=d/q;p.equals(f)||w(b,0,p,b,0,f,q);return{geometryData:a,vertexData:b,eleVertexData:t,terrainElevation:l,
projectionSuccess:r}};r.getGeometryVertexDataDraped=function(a,b,c){a=B(a,!1);var f=a.vertexData,l=f.length/3,k=!0;b.equals(c)||(k=t.bufferToBuffer(f,b,0,f,c,0,l));return{geometryData:a,vertexData:f,projectionSuccess:k}};r.computeBoundingBox=function(a,b,c,f){f[0]=Number.MAX_VALUE;f[1]=Number.MAX_VALUE;f[2]=Number.MAX_VALUE;f[3]=-Number.MAX_VALUE;f[4]=-Number.MAX_VALUE;f[5]=-Number.MAX_VALUE;b*=3;for(var l=0;l<c;++l){var k=a[b++],n=a[b++],p=a[b++];k<f[0]&&(f[0]=k);n<f[1]&&(f[1]=n);p<f[2]&&(f[2]=p);
k>f[3]&&(f[3]=k);n>f[4]&&(f[4]=n);p>f[5]&&(f[5]=p)}return f};r.pointInBox2D=F;r.boxesIntersect2D=G;r.boundingBoxClipped=function(a,b){return b?!G(a,b):!1};r.needsElevationUpdates2D=function(a){return"relative-to-ground"===a||"relative-to-scene"===a};r.needsElevationUpdates3D=function(a){return"absolute-height"!==a};r.needsOffsetAdjustment=function(b,c,f,l){if(!1===c.needsOffsetAdjustment||!1===c.supportsOffsetAdjustment||"on-the-ground"===b.mode)return!1;if(0===b.meterUnitOffset){if(!0===c.needsOffsetAdjustment)return!0;
if(a.isCalloutSupport(l)&&l.hasVisibleVerticalOffset())return!1;if("relative-to-ground"===b.mode&&(!f.hasZ||b.featureExpressionInfoContext)||"relative-to-scene"===b.mode)return!0}return!1};var J={verticalDistanceToGround:0,terrainElevation:0}})},"esri/views/3d/layers/graphics/constants":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.defaultIconElevationOffset=1})},"esri/views/3d/layers/graphics/Graphics3DGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./Graphics3DGraphicElevationContext ./featureExpressionInfoUtils ../../webgl-engine/Stage ../../lib/glMatrix ../../support/aaBoundingBox".split(" "),
function(x,r,k,a,b,c,t,n,f,q){x=f.vec3d;var l=f.mat4d,y=[0,0,0];f=function(){function f(a,b,l,k,n,q,t,r){this._addedToStage=!1;this.alignedTerrainElevation=0;this.needsElevationUpdates=!1;this.graphics3DSymbolLayer=a;this.uniqueMaterials=k;this.uniqueGeometries=l;this.uniqueTextures=n;this.stageObject=b;this.elevationAligner=q;this.elevationContext=new c(t);this.stageLayer=this.stage=null;this._visible=!1;this.visibilityMode=null!=r?r:f.VisibilityModes.HIDE_FACERANGE}f.prototype.initialize=function(a,
b){this.stageLayer=a;this.stage=b;if(this.uniqueMaterials)for(a=0;a<this.uniqueMaterials.length;a++)b.add(n.ModelContentType.MATERIAL,this.uniqueMaterials[a]);if(this.uniqueGeometries)for(a=0;a<this.uniqueGeometries.length;a++)b.add(n.ModelContentType.GEOMETRY,this.uniqueGeometries[a]);if(this.uniqueTextures)for(a=0;a<this.uniqueTextures.length;a++)b.add(n.ModelContentType.TEXTURE,this.uniqueTextures[a]);b.add(n.ModelContentType.OBJECT,this.stageObject)};f.prototype.isDraped=function(){return!1};
f.prototype.setVisibility=function(a){if(null!=this.stage)return this._visible!==a?((this._visible=a)?this._addedToStage?this.stageObject.unhideAllComponents():(this.stageLayer.addObject(this.stageObject),this._addedToStage=!0):this.visibilityMode===f.VisibilityModes.HIDE_FACERANGE?this.stageObject.hideAllComponents():(this.stageLayer.removeObject(this.stageObject),this._addedToStage=!1),!0):!1};f.prototype.destroy=function(){var a=this.stage;if(this.stageLayer){if(this.uniqueMaterials)for(var b=
0;b<this.uniqueMaterials.length;b++)a.remove(n.ModelContentType.MATERIAL,this.uniqueMaterials[b].getId());if(this.uniqueGeometries)for(b=0;b<this.uniqueGeometries.length;b++)a.remove(n.ModelContentType.GEOMETRY,this.uniqueGeometries[b].getId());if(this.uniqueTextures)for(b=0;b<this.uniqueTextures.length;b++)a.remove(n.ModelContentType.TEXTURE,this.uniqueTextures[b].getId())}a.remove(n.ModelContentType.OBJECT,this.stageObject.getId());this._addedToStage&&(this.stageLayer.removeObject(this.stageObject),
this._addedToStage=!1);this._visible=!1;this.stage=this.stageLayer=null};f.prototype.alignWithElevation=function(a,b,c){this.elevationAligner&&(t.setContextFeature(this.elevationContext.featureExpressionInfoContext,c),a=this.elevationAligner(this.stageObject,this.elevationContext,a,b),null!=a&&(this.alignedTerrainElevation=a))};f.prototype.setDrawOrder=function(a,b,c){};f.prototype.getBSRadius=function(){return this.stageObject.getBSRadius()};f.prototype.getCenterObjectSpace=function(){return this.stageObject.getCenter(!0)};
f.prototype.getBoundingBoxObjectSpace=function(a){var b=this.stageObject;a||(a=q.create());q.setMin(a,b.getBBMin(!0));q.setMax(a,b.getBBMax(!0));return a};f.prototype.getProjectedBoundingBox=function(c,f,k,n){return b(this,void 0,void 0,function(){var b,p,t,r,z,D,x,F;return a(this,function(a){switch(a.label){case 0:b=this.getBoundingBoxObjectSpace(k);p=w;t=q.isPoint(b)?1:p.length;for(r=0;r<t;r++)z=p[r],v[0]=b[z[0]],v[1]=b[z[1]],v[2]=b[z[2]],l.multiplyVec3(this.stageObject.objectTransformation,v),
B[3*r+0]=v[0],B[3*r+1]=v[1],B[3*r+2]=v[2];if(!c(B,0,t))return[3,6];q.set(b,q.NEGATIVE_INFINITY);D=null;this.calculateRelativeScreenBounds&&(D=this.calculateRelativeScreenBounds());for(r=0;r<3*t;r+=3){for(x=0;3>x;x++)b[x]=Math.min(b[x],B[r+x]),b[x+3]=Math.max(b[x+3],B[r+x]);D&&n.push({location:B.slice(r,r+3),screenSpaceBoundingRect:D})}if(!f)return[3,5];q.center(b,y);if("absolute-height"===this.elevationContext.mode)return[3,5];F=void 0;a.label=1;case 1:return a.trys.push([1,3,,4]),[4,f.queryElevation(y[0],
y[1])];case 2:return F=a.sent(),[3,4];case 3:return a.sent(),F=null,[3,4];case 4:null!=F&&q.offset(b,0,0,-this.alignedTerrainElevation+F),a.label=5;case 5:return[2,b];case 6:return[2,null]}})})};f.prototype.addHighlight=function(a,b){b=this.stageObject.highlightAllComponents(b);a.addObject(this.stageObject,b)};f.prototype.removeHighlight=function(a){a.removeObject(this.stageObject)};f.VisibilityModes={REMOVE_OBJECT:0,HIDE_FACERANGE:1};return f}();var B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0],v=x.create(),w=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];return f})},"esri/views/3d/layers/graphics/Graphics3DGraphicElevationContext":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./ElevationContext"],function(x,r,k,a){return function(a){function b(b){b=a.call(this,b)||this;b.centerPointInElevationSR=null;return b}k(b,a);return b}(a)})},"esri/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./ElevationContext ../../support/aaBoundingBox ../../support/aaBoundingRect ../../webgl-engine/Stage".split(" "),
function(x,r,k,a,b,c,t,n,f){x=function(){function k(a,b,f,l,k,n){this.needsElevationUpdates=!1;this.graphics3DSymbolLayer=a;this.renderGeometries=b;this.uniqueMaterials=f;this.uniqueTextures=l;this.boundingBox=k;this.elevationContext=new c(n);this.stage=null;this._visible=!1}k.prototype.initialize=function(a,b){this.stage=b;if(this.uniqueMaterials)for(a=0;a<this.uniqueMaterials.length;a++)b.add(f.ModelContentType.MATERIAL,this.uniqueMaterials[a]);if(this.uniqueTextures)for(a=0;a<this.uniqueTextures.length;a++)b.add(f.ModelContentType.TEXTURE,
this.uniqueTextures[a])};k.prototype.isDraped=function(){return!0};k.prototype.setVisibility=function(a){if(null!=this.stage)return this._visible!==a?((this._visible=a)?this.stage.getTextureGraphicsRenderer().addRenderGeometries(this.renderGeometries):this.stage.getTextureGraphicsRenderer().removeRenderGeometries(this.renderGeometries),!0):!1};k.prototype.destroy=function(){if(this.stage){var a=this.stage;this._visible&&a.getTextureGraphicsRenderer().removeRenderGeometries(this.renderGeometries);
this._visible=!1;if(this.uniqueMaterials)for(var b=0;b<this.uniqueMaterials.length;b++)a.remove(f.ModelContentType.MATERIAL,this.uniqueMaterials[b].getId());if(this.uniqueTextures)for(b=0;b<this.uniqueTextures.length;b++)a.remove(f.ModelContentType.TEXTURE,this.uniqueTextures[b].getId());this.stage=null}};k.prototype.alignWithElevation=function(a,b,c){};k.prototype.setDrawOrder=function(a,b,c){var f=this;this.uniqueMaterials&&this.uniqueMaterials.forEach(function(c){c.setRenderPriority(a);f._visible&&
(b[c.getId()]=!0)})};k.prototype.getBSRadius=function(){return this.renderGeometries.reduce(function(a,b){return Math.max(a,b.bsRadius)},0)};k.prototype.getCenterObjectSpace=function(){return[0,0,0]};k.prototype.addHighlight=function(a,b){var c=this.stage.getTextureGraphicsRenderer();this.renderGeometries.forEach(function(f){var l=c.addRenderGeometryHighlight(f,b);a.addRenderGeometry(f,c,l)})};k.prototype.removeHighlight=function(a){this.renderGeometries.forEach(function(b){a.removeRenderGeometry(b)})};
k.prototype.getProjectedBoundingBox=function(c,f,l,k){return b(this,void 0,void 0,function(){var b,n,r;return a(this,function(a){switch(a.label){case 0:t.set(l,t.NEGATIVE_INFINITY);for(b=0;b<this.renderGeometries.length;b++)n=this.renderGeometries[b],this._getRenderGeometryProjectedBoundingRect(n,q,c,k),t.expand(l,q);if(!f)return[3,5];t.center(l,y);r=void 0;a.label=1;case 1:return a.trys.push([1,3,,4]),[4,f.queryElevation(y[0],y[1])];case 2:return r=a.sent(),[3,4];case 3:return a.sent(),r=null,[3,
4];case 4:null!=r&&(l[2]=Math.min(l[2],r),l[5]=Math.max(l[5],r)),a.label=5;case 5:return[2,l]}})})};k.prototype._getRenderGeometryProjectedBoundingRect=function(a,b,c,f){if(this.boundingBox)t.set(l,this.boundingBox);else{var k=a.center;a=a.bsRadius;l[0]=k[0]-a;l[1]=k[1]-a;l[2]=k[2]-a;l[3]=k[0]+a;l[4]=k[1]+a;l[5]=k[2]+a}c(l,0,2);this.calculateRelativeScreenBounds&&f.push({location:t.center(l),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()});return t.toRect(l,b)};return k}();var q=n.create(),
l=[0,0,0,0,0,0],y=[0,0,0];return x})},"esri/views/3d/layers/graphics/ElevationAligners":function(){define("require exports ../../../../geometry/Point ../../lib/glMatrix ../../support/projectionUtils ../../support/debugFlags ../../webgl-engine/lib/Util ./Graphics3DSymbolCommonCode ./graphicUtils".split(" "),function(x,r,k,a,b,c,t,n,f){Object.defineProperty(r,"__esModule",{value:!0});var q=t.VertexAttrConstants;x=a.vec3d;var l=new k,y=x.create(),B=x.create(),v=x.create(),w={verticalDistanceToGround:0,
terrainElevation:0};r.perVertexElevationAligner=function(a,b,f,k){l.spatialReference=f.spatialReference;for(var p=a.getGeometryRecords(),t=p.length,D="absolute-height"!==b.mode,x=0,F=0;F<t;F++){var G=p[F].geometry,O=p[F].getShaderTransformation(),P=G.getData();B[0]=O[12];B[1]=O[13];B[2]=O[14];G.invalidateBoundingInfo();for(var O=P.getVertexAttr(),P=O[q.POSITION],G=P.data,O=O.mapPos.data,P=P.size,U=G.length/P,N=0,R=0,S=!1,T=0,V=0;V<U;V++){l.x=O[R++];l.y=O[R++];l.z=O[R++];v[0]=G[N];v[1]=G[N+1];v[2]=
G[N+2];var h=n.computeElevation(f,l,b,k,D?w:null);D&&(T+=w.terrainElevation);y[0]=G[N]+B[0];y[1]=G[N+1]+B[1];y[2]=G[N+2]+B[2];k.setAltitude(h,y);G[N]=y[0]-B[0];G[N+1]=y[1]-B[1];G[N+2]=y[2]-B[2];if(c.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS)S=!0;else if(h=r.updateThresholdInMeters/k.unitInMeters,Math.abs(v[0]-G[N])>=h||Math.abs(v[1]-G[N+1])>=h||Math.abs(v[2]-G[N+2])>=h)S=!0;N+=P}x+=T/U;S&&a.geometryVertexAttrsUpdated(F)}return x/t};r.perObjectElevationAligner=function(a,l,k,p,q){var t=l.centerPointInElevationSR,
v=0;q=0;if(a.metadata.usesVerticalDistanceToGround)v=n.computeElevation(k,t,l,p,w),f.updateVertexAttributeAuxpos1w(a,w.verticalDistanceToGround),q=w.terrainElevation;else{var z="absolute-height"!==l.mode,v=n.computeElevation(k,t,l,p,z?w:null);z&&(q=w.terrainElevation)}l=a.getObjectTransformation();k=[l[12],l[13],l[14]];c.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES?(y[0]=t.x,y[1]=t.y,y[2]=v,b.computeLinearTransformation(t.spatialReference,y,l,p.spatialReference)&&a.setObjectTransformation(l)):p.setAltitudeOfTransformation(v,
l);p=r.updateThresholdInMeters/p.unitInMeters;(Math.abs(l[12]-k[0])>=p||Math.abs(l[13]-k[1])>=p||Math.abs(l[14]-k[2])>=p)&&a.setObjectTransformation(l);return q};r.updateThresholdInMeters=.01;r.iterativeUpdatesEnabled=!0})},"esri/views/3d/layers/graphics/SignedDistanceFunctions":function(){define(["require","exports","../../support/mathUtils"],function(x,r,k){function a(a){return a-Math.floor(a)}function b(b,n,l){b=k.clamp(b,0,.9999991);var f=a(b*c[0]),q=a(b*c[1]),r=a(b*c[2]);b=a(b*c[3]);n[l+0]=256*
(f-f*t[0]);n[l+1]=256*(q-f*t[1]);n[l+2]=256*(r-q*t[2]);n[l+3]=256*(b-r*t[3])}Object.defineProperty(r,"__esModule",{value:!0});var c=[16777216,65536,256,1],t=[0,1/256,1/256,1/256],n=[1/16777216,1/65536,1/256,1];r.packFloat=b;r.unpackFloat=function(a,b){var c=a[b+1]/256,f=a[b+2]/256,k=a[b+3]/256;a=0+a[b+0]/256*n[0];a+=c*n[1];a+=f*n[2];return a+=k*n[3]};r.computeSignedDistancefieldCicle=function(a,c){var f=new Uint8Array(4*a*a),k=a/2-.5;c/=2;for(var n=0;n<a;n++)for(var q=0;q<a;q++){var t=q+a*n,r=q-k,
x=n-k,r=Math.sqrt(r*r+x*x)-c,r=r/a+.5;b(r,f,4*t)}return f};r.computeSignedDistancefieldSquare=function(a,c,l){l&&(c/=Math.SQRT2);for(var f=new Uint8Array(4*a*a),k=0;k<a;k++)for(var n=0;n<a;n++){var q=n-.5*(a-.5),t=k-.5*(a-.5),r=k*a+n;if(l)var x=(q+t)/Math.SQRT2,t=(t-q)/Math.SQRT2,q=x;q=Math.max(Math.abs(q),Math.abs(t))-.5*c;q=q/a+.5;b(q,f,4*r)}return f};r.computeSignedDistancefieldCrossAndX=function(a,c,l){l&&(c*=Math.SQRT2);c*=.5;for(var f=new Uint8Array(4*a*a),k=0;k<a;k++)for(var n=0;n<a;n++){var q=
n-.5*a+0,t=k-.5*a+0,r=k*a+n;if(l)var x=(q+t)/Math.SQRT2,t=(t-q)/Math.SQRT2,q=x;q=Math.abs(q);t=Math.abs(t);x=void 0;x=q>t?q>c?Math.sqrt((q-c)*(q-c)+t*t):t:t>c?Math.sqrt(q*q+(t-c)*(t-c)):q;x=x/a+.5;b(x,f,4*r)}return f}})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define(["require","exports","../../../../renderers/support/utils","../../lib/glMatrix","../graphics/graphicUtils"],function(x,r,k,a,b){function c(a){return null!==a&&void 0!==a}function t(a){return"number"===typeof a}function n(a,
b){a&&a.push(b)}function f(a,b,f,l,p){var r=a.minSize,v=a.maxSize;if(a.expression)return n(p,"Could not convert size info: expression not supported"),!1;if(a.useSymbolValue)return a=l.symbolSize[f],b.minSize[f]=a,b.maxSize[f]=a,b.offset[f]=b.minSize[f],b.factor[f]=0,b.type[f]=1,!0;if(c(a.field)){if(c(a.stops)){if(2===a.stops.length&&t(a.stops[0].size)&&t(a.stops[1].size))return q(a.stops[0].size,a.stops[1].size,a.stops[0].value,a.stops[1].value,b,f),b.type[f]=1,!0;n(p,"Could not convert size info: stops only supported with 2 elements");
return!1}if(t(r)&&t(v)&&c(a.minDataValue)&&c(a.maxDataValue))return q(r,v,a.minDataValue,a.maxDataValue,b,f),b.type[f]=1,!0;if(null!=k.meterIn[a.valueUnit])return b.minSize[f]=-Infinity,b.maxSize[f]=Infinity,b.offset[f]=0,b.factor[f]=1/k.meterIn[a.valueUnit],b.type[f]=1,!0;"unknown"===a.valueUnit?n(p,"Could not convert size info: proportional size not supported"):n(p,"Could not convert size info: scale-dependent size not supported");return!1}if(!c(a.field)){if(a.stops&&a.stops[0]&&t(a.stops[0].size))return b.minSize[f]=
a.stops[0].size,b.maxSize[f]=a.stops[0].size,b.offset[f]=b.minSize[f],b.factor[f]=0,b.type[f]=1,!0;if(t(r))return b.minSize[f]=r,b.maxSize[f]=r,b.offset[f]=r,b.factor[f]=0,b.type[f]=1,!0}n(p,"Could not convert size info: unsupported variant of sizeInfo");return!1}function q(a,b,c,f,l,k){f=0<Math.abs(f-c)?(b-a)/(f-c):0;l.minSize[k]=0<f?a:b;l.maxSize[k]=0<f?b:a;l.offset[k]=a-c*f;l.factor[k]=f}function l(a,b,c,l){if(a.normalizationField||a.valueRepresentation)return n(l,"Could not convert size info: unsupported property"),
null;var k=a.field;if(null!=k&&"string"!==typeof k)return n(l,"Could not convert size info: field is not a string"),null;if(!b.size)b.size={field:a.field,minSize:[0,0,0],maxSize:[0,0,0],offset:[0,0,0],factor:[0,0,0],type:[0,0,0]};else if(a.field)if(!b.size.field)b.size.field=a.field;else if(a.field!==b.size.field)return n(l,"Could not convert size info: multiple fields in use"),null;switch(a.axis){case "width":return(k=f(a,b.size,0,c,l))?b:null;case "height":return(k=f(a,b.size,2,c,l))?b:null;case "depth":return(k=
f(a,b.size,1,c,l))?b:null;case "width-and-depth":return(k=f(a,b.size,0,c,l))&&f(a,b.size,1,c,l),k?b:null;case null:case void 0:case "all":return(k=(k=(k=f(a,b.size,0,c,l))&&f(a,b.size,1,c,l))&&f(a,b.size,2,c,l))?b:null;default:return n(l,'Could not convert size info: unknown axis "'+a.axis+'""'),null}}function y(a,b,c){for(var f=0;3>f;++f){var l=b.unitInMeters;1===a.type[f]&&(l*=b.modelSize[f],a.type[f]=2);a.minSize[f]/=l;a.maxSize[f]/=l;a.offset[f]/=l;a.factor[f]/=l}if(0!==a.type[0])b=0;else if(0!==
a.type[1])b=1;else if(0!==a.type[2])b=2;else return n(c,"No size axis contains a valid size or scale"),!1;for(f=0;3>f;++f)0===a.type[f]&&(a.minSize[f]=a.minSize[b],a.maxSize[f]=a.maxSize[b],a.offset[f]=a.offset[b],a.factor[f]=a.factor[b],a.type[f]=a.type[b]);return!0}function B(a,b,c){a[4*b+0]=c.r/255;a[4*b+1]=c.g/255;a[4*b+2]=c.b/255;a[4*b+3]=c.a}function v(a,b,f){if(a.normalizationField)return n(f,"Could not convert color info: unsupported property"),null;if("string"===typeof a.field)if(a.stops){if(8<
a.stops.length)return n(f,"Could not convert color info: too many color stops"),null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};a=a.stops;for(f=0;8>f;++f){var l=a[Math.min(f,a.length-1)];b.color.values[f]=l.value;B(b.color.colors,f,l.color)}}else if(a.colors){if(!c(a.minDataValue)||!c(a.maxDataValue))return n(f,"Could not convert color info: missing data values"),null;if(2!==a.colors.length)return n(f,"Could not convert color info: invalid colors array"),
null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};b.color.values[0]=a.minDataValue;B(b.color.colors,0,a.colors[0]);b.color.values[1]=a.maxDataValue;B(b.color.colors,1,a.colors[1]);for(f=2;8>f;++f)b.color.values[f]=a.maxDataValue,B(b.color.colors,f,a.colors[1])}else return n(f,"Could not convert color info: missing stops or colors"),null;else if(a.stops&&0<=a.stops.length||a.colors&&0<=a.colors.length)for(a=a.stops&&0<=a.stops.length?
a.stops[0].color:a.colors[0],b.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},f=0;8>f;f++)b.color.values[f]=Infinity,B(b.color.colors,f,a);else return n(f,"Could not convert color info: no field and no colors/stops"),null;return b}function w(a,b,c,f){a=2===c&&"arithmetic"===a.rotationType;b.offset[c]=a?90:0;b.factor[c]=a?-1:1;b.type[c]=1}function D(a,b,c){if("string"!==typeof a.field)return n(c,"Could not convert rotation info: field is not a string"),
null;if(!b.rotation)b.rotation={field:a.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(a.field)if(!b.rotation.field)b.rotation.field=a.field;else if(a.field!==b.rotation.field)return n(c,"Could not convert rotation info: multiple fields in use"),null;switch(a.axis){case "tilt":return w(a,b.rotation,0,c),b;case "roll":return w(a,b.rotation,1,c),b;case null:case void 0:case "heading":return w(a,b.rotation,2,c),b;default:return n(c,'Could not convert rotation info: unknown axis "'+a.axis+
'""'),null}}function F(a,b,c){if(!a)return null;var f=!b.supportedTypes||!!b.supportedTypes.size,k=!b.supportedTypes||!!b.supportedTypes.color,p=!b.supportedTypes||!!b.supportedTypes.rotation;return(a=a.reduce(function(a,q){if(!a)return a;if(q.valueExpression)return n(c,"Could not convert visual variables: arcade expressions not supported"),null;switch(q.type){case "size":return f?l(q,a,b,c):a;case "color":return k?v(q,a,c):a;case "rotation":return p?D(q,a,c):a;default:return n(c,"Could not convert visual variables: unsupported type "+
q.type),null}},{size:null,color:null,rotation:null}))&&a.size&&!y(a.size,b,c)?null:a}function G(a,b,c){if(!!a!==!!b||a&&a.field!==b.field)return!1;if(a&&"rotation"===c)for(c=0;3>c;c++)if(a.type[c]!==b.type[c]||a.offset[c]!==b.offset[c]||a.factor[c]!==b.factor[c])return!1;return!0}function p(a,b){var c={vvSizeEnabled:!1,vvSizeMinSize:null,vvSizeMaxSize:null,vvSizeOffset:null,vvSizeFactor:null,vvSizeValue:null,vvColorEnabled:!1,vvColorValues:null,vvColorColors:null,vvSymbolAnchor:null,vvSymbolRotation:null},
f=a&&null!=a.size;a&&a.size?(c.vvSizeEnabled=!0,c.vvSizeMinSize=a.size.minSize,c.vvSizeMaxSize=a.size.maxSize,c.vvSizeOffset=a.size.offset,c.vvSizeFactor=a.size.factor):a&&f&&(c.vvSizeValue=b.transformation.scale);a&&f&&(c.vvSymbolAnchor=b.transformation.anchor,c.vvSymbolRotation=b.transformation.rotation);a&&a.color&&(c.vvColorEnabled=!0,c.vvColorValues=a.color.values,c.vvColorColors=a.color.colors);return c}Object.defineProperty(r,"__esModule",{value:!0});r.convertVisualVariables=F;r.initFastSymbolUpdatesState=
function(a,b,c){return b&&a&&!a.disableFastUpdates?(a=F(a.visualVariables,c))?{enabled:!0,visualVariables:a,materialParameters:p(a,c),customTransformation:a&&null!=a.size}:{enabled:!1}:{enabled:!1}};r.updateFastSymbolUpdatesState=function(a,b,c){if(!b||!a.enabled)return!1;var f=a.visualVariables;b=F(b.visualVariables,c);if(!(b&&G(f.size,b.size,"size")&&G(f.color,b.color,"color")&&G(f.rotation,b.rotation,"rotation")))return!1;a.visualVariables=b;a.materialParameters=p(b,c);a.customTransformation=b&&
null!=b.size;return!0};r.getMaterialParams=p;var z;(function(c){var f=a.mat4d,l=a.vec3,k=f.create(),n=l.create();c.evaluateModelTransform=function(a,c,l){if(!a.vvSizeEnabled)return l;f.identity(k);f.multiply(l,k,k);b.computeObjectRotation(a.vvSymbolRotation[2],a.vvSymbolRotation[0],a.vvSymbolRotation[1],k);if(a.vvSizeEnabled){for(l=0;3>l;++l){var p=a.vvSizeOffset[l]+c[0]*a.vvSizeFactor[l],q=l;var t=a.vvSizeMinSize[l],r=a.vvSizeMaxSize[l],p=p<t?t:p>r?r:p;n[q]=p}f.scale(k,n,k)}else f.scale(k,a.vvSizeValue,
k);f.translate(k,a.vvSymbolAnchor,k);return k}})(z||(z={}));r.evaluateModelTransform=z.evaluateModelTransform})},"esri/symbols/support/symbolUtils":function(){define(["require","exports","../../core/sniff"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.isVolumetricSymbol=function(a){return(a=a&&a.symbolLayers)?a.some(function(a){a=a.type;return"object"===a||"path"===a||"extrude"===a}):!1};r.getIconHref=function(b,c){c=c.resource.href;return!k("esri-canvas-svg-support")&&b.styleOrigin&&
a.test(c)?c.replace(a,"/resource/png/$1.png"):c};var a=/\/resource\/(.*?)\.svg$/})},"esri/views/3d/layers/graphics/Graphics3DObjectSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang dojo/errors/CancelError ../../../../Color ../../../../core/screenUtils ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./ElevationAligners ./Graphics3DSymbolCommonCode ./graphicUtils ../support/FastSymbolUpdates ./objectResourceUtils ../../lib/glMatrix ../../../../symbols/ObjectSymbol3DLayer ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/materials/Material".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A){var J=w.mat4d,I=w.vec3d,K=[1,1,1],L=[1,1,1,1],O=[0,0,0];x=[-.5,-.5,-.5,.5,.5,.5];r=[-.5,-.5,0,.5,.5,1];var P={sphere:x,cube:x,cylinder:r,cone:r,"inverted-cone":r,tetrahedron:[-.5,-.5,0,.5,.5,.5],diamond:x},U=[G.ModelContentType.MATERIAL,G.ModelContentType.TEXTURE,G.ModelContentType.GEOMETRY];return function(n){function r(){return null!==n&&n.apply(this,arguments)||this}k(r,n);r.prototype._prepareResources=function(){var a=this.symbol,b=this._getStageIdHint();
if(!this._isPropertyDriven("size")){var c=y.validateSymbolLayerSize(this.symbol);if(c){this._logWarning(c);this.reject();return}}a.resource&&a.resource.href?this._prepareModelResources(a.resource.href,b):this._preparePrimitiveResources(a.resource?a.resource.primitive:"sphere",b)};r.prototype._preparePrimitiveResources=function(b,f){var l=this.symbol;if("sphere"===b)this._geometryData=z.createPolySphereGeometry(.5,2,!0);else if("cube"===b)this._geometryData=z.createBoxGeometry(1);else if("cylinder"===
b)this._geometryData=z.createCylinderGeometry(1,.5,32,[0,0,1],[0,0,.5]);else if("cone"===b)this._geometryData=z.createConeGeometry(1,.5,15,!1),z.cgToGIS(this._geometryData);else if("inverted-cone"===b)this._geometryData=z.createConeGeometry(1,.5,15,!0),z.cgToGIS(this._geometryData);else if("tetrahedron"===b)this._geometryData=z.createTetrahedronGeometry(1),z.cgToGIS(this._geometryData);else if("diamond"===b)this._geometryData=z.createDiamondGeometry(1),z.cgToGIS(this._geometryData);else{this._logWarning("Unknown object symbol primitive: "+
b);this.reject();return}this._geometry=new p(this._geometryData,f);this._context.stage.add(G.ModelContentType.GEOMETRY,this._geometry);this._resourceBoundingBox=P[b];this._resourceSize=F.size(this._resourceBoundingBox);this._symbolSize=y.computeSizeWithResourceSize(this._resourceSize,l);b=this._getMaterialOpacity();b={specular:[0,0,0],shininess:3,opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),instanced:["transformation"],ambient:K,diffuse:K};var h=this.symbolContainer;if("point-3d"===
h.type&&h.verticalOffset){var h=h.verticalOffset,k=h.minWorldLength,n=h.maxWorldLength;b.verticalOffset={screenLength:t.pt2px(h.screenLength),minWorldLength:k||0,maxWorldLength:null!=n?n:Infinity};b.castShadows=!1}this._context.screenSizePerspectiveEnabled&&(b.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);this._isPropertyDriven("color")?b.externalColor=L:(l=l.material?c.toUnitRGBA(l.material.color):L,b.externalColor=l);this._fastUpdates=B.initFastSymbolUpdatesState(this._context.renderer,
this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(b,this._fastUpdates.materialParameters),b.instanced.push("featureAttribute")):this._hasPerInstanceColor()&&b.instanced.push("color");this._material=new A(b,f+"_objectmat");this._context.stage.add(G.ModelContentType.MATERIAL,this._material);this.resolve()};r.prototype._prepareModelResources=function(c,f){var l=this,h=["transformation"];f={materialParamsMixin:{instanced:h},idHint:f,streamDataSupplier:this._context.streamDataSupplier};
this._fastUpdates=B.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(f.materialParamsMixin,this._fastUpdates.materialParameters),h.push("featureAttribute")):this._hasPerInstanceColor()&&h.push("color");h=this.symbolContainer;if("point-3d"===h.type&&h.verticalOffset){var h=h.verticalOffset,k=h.minWorldLength,n=h.maxWorldLength;f.materialParamsMixin.verticalOffset={screenLength:t.pt2px(h.screenLength),
minWorldLength:k||0,maxWorldLength:null!=n?n:Infinity};f.materialParamsMixin.castShadows=!1}this._symbolLoaderPromise=v.fetch(c,f);this._symbolLoaderPromise.then(function(a){l._symbolLoaderPromise=null;if(!l.isRejected()){var b=l._context,e=a.stageResources,c=b.stage,f=l._getExternalColorParameters(l.symbol.material),h=l._getMaterialOpacity(),k=l._isPropertyDriven("opacity"),n=e[G.ModelContentType.MATERIAL];a.originalMaterialOpacities=Array(n.length);n.forEach(function(d,e){var c=d.getParameterValues();
d.setParameterValues(f);a.originalMaterialOpacities[e]=c.opacity;e=c.opacity*h;d.setParameterValues({opacity:e,transparent:1>e||k||c.transparent});b.screenSizePerspectiveEnabled&&d.setParameterValues({screenSizePerspective:b.sharedResources.screenSizePerspectiveSettings})});U.forEach(function(a){for(var b=e[a],d=0;b&&d<b.length;d++)c.add(a,b[d])});l._resourceBoundingBox=v.computeBoundingBox(a);l._resourceSize=F.size(l._resourceBoundingBox);l._pivotOffset=a.pivotOffset;l._symbolSize=y.computeSizeWithResourceSize(l._resourceSize,
l.symbol);l._i3sModel=a;B.updateFastSymbolUpdatesState(l._fastUpdates,l._context.renderer,l._fastVisualVariableConvertOptions())&&n.forEach(function(a){return a.setParameterValues(l._fastUpdates.materialParameters)});l.resolve()}},function(a){l._symbolLoaderPromise=null;if(!l.isFulfilled()){if(!(a instanceof b)){var d="ObjectSymbol3DLayer failed to load";a&&a.message&&(d+=" ("+a.message+")");l._logWarning(d)}l.reject()}})};r.prototype._forEachMaterial=function(a){this._i3sModel?this._i3sModel.stageResources[G.ModelContentType.MATERIAL].forEach(a):
a(this._material)};r.prototype._getExternalColorParameters=function(a){var b={};this._isPropertyDriven("color")?b.externalColor=L:a&&a.color?b.externalColor=c.toUnitRGBA(a.color):(b.externalColor=L,b.colorMixMode="ignore");return b};r.prototype.destroy=function(){n.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._symbolLoaderPromise&&this._symbolLoaderPromise.cancel();var a=this._context.stage;if(this._i3sModel){var b=this._i3sModel.stageResources;U.forEach(function(c){for(var f=
b[c],l=0;f&&l<f.length;l++)a.remove(c,f[l].getId())})}else this._material&&a.remove(G.ModelContentType.MATERIAL,this._material.getId()),this._geometry&&a.remove(G.ModelContentType.GEOMETRY,this._geometry.getId())};r.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);return"polyline"===a.type?l.placePointOnPolyline(a):"polygon"===a.type?l.placePointOnPolygon(a):"extent"===a.type?a.center:"point"!==a.type?(this._logWarning("unsupported geometry type for object symbol: "+a.type),
null):a};r.prototype.createGraphics3DGraphic=function(a,b){var c=this._getGeometry(a);if(null===c)return null;var f="graphic"+a.uid,l=this.getGraphicElevationContext(a);return this._createAs3DShape(a,c,b,l,f,a.uid)};r.prototype.layerPropertyChanged=function(a,b,c){var f=this;if("opacity"===a){var k=this._isPropertyDriven("opacity");if(this._i3sModel){var n=this._getMaterialOpacity();this._i3sModel.stageResources[G.ModelContentType.MATERIAL].forEach(function(a,b){b=f._i3sModel.originalMaterialOpacities[b]*
n;a.setParameterValues({opacity:b,transparent:1>b||k})})}else b=this._getMaterialOpacity(),this._material.setParameterValues({opacity:b,transparent:1>b||k});return!0}if("elevationInfo"===a){this._updateElevationContext();for(var e in b){var d=b[e];if(a=c(d))d=this.getGraphicElevationContext(d.graphic),a.needsElevationUpdates=l.needsElevationUpdates3D(d.mode),a.elevationContext.set(d)}return!0}return!1};r.prototype.applyRendererDiff=function(a,b,c,f){var h=this,l;for(l in a.diff)switch(l){case "visualVariables":if(B.updateFastSymbolUpdatesState(this._fastUpdates,
b,this._fastVisualVariableConvertOptions()))this._forEachMaterial(function(a){return a.setParameterValues(h._fastUpdates.materialParameters)});else return!1;break;default:return!1}return!0};r.prototype._createAs3DShape=function(a,b,c,h,k,n){var e=this,d=null,g=null;if(a=this._getFastUpdateAttrValues(a))d=d||{},d.featureAttribute=a,g=function(a){return B.evaluateModelTransform(e._fastUpdates.materialParameters,d.featureAttribute,a)};!this._fastUpdates.enabled&&this._hasPerInstanceColor()&&(d=d||{},
d.color=y.mixinColorAndOpacity(c.color,c.opacity));a=this._context.layer.uid;var m=J.identity();this._applyObjectRotation(c,m);this._applyObjectRotation(this.symbol,m);this._applyObjectScale(c,m);this._applyAnchor(m);if(this._i3sModel){c=this._i3sModel.stageResources[G.ModelContentType.GEOMETRY];for(var p=this._i3sModel.materialsByComponent,t=Array(c.length),r=0;r<m.length;r++)t[r]=m;k=l.createStageObjectForPoint.call(this,b,c,p,t,d,h,k,a,n,null,g)}else k=l.createStageObjectForPoint.call(this,b,[this._geometry],
[[this._material]],[m],d,h,k,a,n,null,g);if(null===k)return null;if(this._fastUpdates.enabled){var v=B.getMaterialParams(this._fastUpdates.visualVariables,this._fastVisualVariableConvertOptions());this._forEachMaterial(function(a){return a.setParameterValues(v)})}k.object.setCastShadow(!0);n=new f(this,k.object,null,null,null,q.perObjectElevationAligner,h,f.VisibilityModes.REMOVE_OBJECT);n.alignedTerrainElevation=k.terrainElevation;n.needsElevationUpdates=l.needsElevationUpdates3D(h.mode);l.extendPointGraphicElevationContext(n,
b,this._context.elevationProvider);return n};r.prototype._applyObjectScale=function(a,b){this._fastUpdates.enabled&&this._fastUpdates.customTransformation||(a=this._isPropertyDriven("size")&&a.size?a.size:this._symbolSize,a=y.computeObjectScale(a,this._symbolSize,this._resourceSize,this._context.renderCoordsHelper.unitInMeters),1===a[0]&&1===a[1]&&1===a[2]||J.scale(b,a))};r.prototype._applyObjectRotation=function(a,b){if(!(this._fastUpdates.enabled&&this._fastUpdates.customTransformation&&a instanceof
D))return y.computeObjectRotation(a.heading,a.tilt,a.roll,b)};r.prototype._computeAnchor=function(){switch(this.symbol.anchor){case "center":return I.scale(F.center(this._resourceBoundingBox),-1);case "top":var a=F.center(this._resourceBoundingBox);return[-a[0],-a[1],-this._resourceBoundingBox[5]];case "bottom":return a=F.center(this._resourceBoundingBox),[-a[0],-a[1],-this._resourceBoundingBox[2]];default:return this._pivotOffset?I.scale(this._pivotOffset,-1,Array(3)):O}};r.prototype._applyAnchor=
function(a){if(!this._fastUpdates.enabled||!this._fastUpdates.customTransformation){var b=this._computeAnchor();b&&J.translate(a,b)}};r.prototype._hasPerInstanceColor=function(){return this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};r.prototype._supportsShaderVisualVariables=function(){return this._context.stage.has("angleInstancedArrays")?!0:!1};r.prototype._fastVisualVariableConvertOptions=function(){var a=this._resourceBoundingBox?F.size(this._resourceBoundingBox):K,b=this._resourceBoundingBox?
this._computeAnchor():O,c=this._context.renderCoordsHelper.unitInMeters,f=y.computeObjectScale(this._symbolSize,this._symbolSize,this._resourceSize,c);return{modelSize:a,symbolSize:this._symbolSize||K,unitInMeters:c,transformation:{anchor:b,scale:f,rotation:[this.symbol.tilt||0,this.symbol.roll||0,this.symbol.heading||0]}}};r.PRIMITIVE_BOUNDING_BOX=P;return r}(n)})},"esri/views/3d/layers/graphics/objectResourceUtils":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/sniff dojo/_base/lang dojo/Deferred dojo/errors/CancelError ../../../../request ../../../../core/Error ../../../../core/Version ../../../../core/Logger ../../lib/glMatrix ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/materials/Material ../../webgl-engine/lib/Texture ../../support/aaBoundingBox".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G){function p(a){return new f("","Request for object resource failed: "+a)}function z(c,f){var l,k,n=[],p=[],t=[],r=[],y=[],z=q.Version.parse(c.version||"1.0","wosr");J.validate(z);var z="meshsymbol_"+c.model.name,B=c.textureDefinitions,h={},x;for(x in B){var G=B[x];if(l=G.images[0].data){k=G.encoding+";base64,"+l;l="/textureDefinitions/"+x;var e={noUnpackFlip:!0,wrapClamp:!1};a("enable-feature:jkieboom/alpha-channel-usage")&&(e.wrapClamp=!0);k=new F(k,z,
e);y.push(k);h[l]={engineTexObj:k,alphaChannelUsage:"rgba"===G.channels?G.alphaChannelUsage||"transparency":"none"}}else A.warn("Externally referenced texture data is not yet supported")}x=c.model.geometries;B=c.materialDefinitions;for(G=0;G<x.length;G++){k=e=x[G];var d=k.params,g=d.topology;l=!0;d.vertexAttributes||(A.warn("Geometry must specify vertex attributes"),l=!1);switch(d.topology){case "PerAttributeArray":break;case "Indexed":case null:case void 0:if(!d.faces)A.warn("Indexed geometries must specify faces"),
l=!1;else if(d.vertexAttributes)for(g in g=void 0,d.vertexAttributes){var m=d.faces[g];m&&m.values?(null!=m.valueType&&"UInt32"!==m.valueType&&(A.warn("Unsupported indexed geometry indices type '"+m.valueType+"', only UInt32 is currently supported"),l=!1),null!=m.valuesPerElement&&1!==m.valuesPerElement&&(A.warn("Unsupported indexed geometry values per element '"+m.valuesPerElement+"', only 1 is currently supported"),l=!1)):(A.warn("Indexed geometry does not specify face indices for '"+g+"' attribute"),
l=!1)}break;default:A.warn("Unsupported topology '"+g+"'"),l=!1}k.params.material||(A.warn("Geometry requires material"),l=!1);k=k.params.vertexAttributes;d=void 0;for(d in k)k[d].values||(A.warn("Geometries with externally defined attributes are not yet supported"),l=!1);if(l){k=e.params;l=k.material;k=k.texture;var g=e.params.vertexAttributes,d={},u;for(u in g)m=g[u],d[u]={data:m.values,size:m.valuesPerElement};t.push([]);g={};if("PerAttributeArray"===e.params.topology){for(var e=d.position.data.length/
d.position.size,m=new Uint32Array(e),C=0;C<e;C++)m[C]=C;var e=m,I;for(I in d)g[I]=e}else for(var K in e.params.faces)g[K]=new Uint32Array(e.params.faces[K].values);e=k?h[k]:null;m=r[l]?r[l][k]:null;m||(m=l.substring(l.lastIndexOf("/")+1),m=B[m].params,1===m.transparency&&(m.transparency=0),m={ambient:m.diffuse,diffuse:m.diffuse,specular:[0,0,0],shininess:0,opacity:1-(m.transparency||0),transparent:0<m.transparency,textureId:e?e.engineTexObj.getId():void 0,doubleSided:!0,cullFace:"none",flipV:!1,colorMixMode:m.externalColorMixMode||
"tint"},a("enable-feature:jkieboom/alpha-channel-usage")&&e&&("transparency"===e.alphaChannelUsage||"maskAndTransparency"===e.alphaChannelUsage)&&(m.transparent=!0),f&&f.materialParamsMixin&&b.mixin(m,f.materialParamsMixin),m=new D(m,z),r[l]||(r[l]={}),r[l][k]=m,p.push(m));t[G].push(m);l=new v(new w(d,g),z);n.push(l)}}return{stageResources:{textures:y,materials:p,geometries:n},materialsByComponent:t,pivotOffset:c.model.pivotOffset}}Object.defineProperty(r,"__esModule",{value:!0});var A=l.getLogger("esri.views.3d.layers.graphics.objectResourceUtils"),
J=new q.Version(1,1,"wosr");r.fetch=function(a,b){b=b||{};var f=b.streamDataSupplier;if(f){var l=f.request(a,"json"),k=new c(function(){return f.cancelRequest(l)});l.then(function(a,c){try{var f=z(c,b);return k.resolve(f)}catch(V){return k.reject(V)}},function(a){k.reject(a instanceof t?a:p(a))});return k.promise}var q=n(a),r=new c(function(){return q.cancel()});q.then(function(a){try{var c=z(a.data,b);return r.resolve(c)}catch(T){return r.reject(T)}},function(b){r.reject(b instanceof t?b:p(a))});
return r.promise};r.computeBoundingBox=function(a){a=a.stageResources[B.ModelContentType.GEOMETRY];for(var b=G.create(G.NEGATIVE_INFINITY),c=[0,0,0],f=[0,0,0],l=0;l<a.length;l++){var k=a[l].getBoundingInfo();y.vec3d.set(k.getBBMin(),c);y.vec3d.set(k.getBBMax(),f);for(k=0;3>k;++k)b[k]=Math.min(b[k],c[k]),b[k+3]=Math.max(b[k+3],f[k])}return b};r.createStageResources=z})},"esri/core/Version":function(){define(["require","exports","./Error"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});
x=function(){function a(a,c,k){void 0===k&&(k="");this.major=a;this.minor=c;this._context=k}a.prototype.lessThan=function(a,c){return this.major<a||a===this.major&&this.minor<c};a.prototype.since=function(a,c){return!this.lessThan(a,c)};a.prototype.validate=function(a){if(this.major!==a.major)throw new k((this._context&&this._context+":")+"unsupported-version","Required major "+(this._context&&this._context+" ")+"version is '"+this.major+"', but got '${version.major}.${version.minor}'",{version:a});
};a.prototype.clone=function(){return new a(this.major,this.minor,this._context)};a.parse=function(b,c){void 0===c&&(c="");var t=b.split("."),n=t[0],t=t[1],f=/^\s*\d+\s*$/;if(!n||!n.match||!n.match(f))throw new k((c&&c+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:b});if(!t||!t.match||!t.match(f))throw new k((c&&c+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:b});b=parseInt(n,10);n=parseInt(t,10);return new a(b,
n,c)};return a}();r.Version=x})},"esri/views/3d/layers/graphics/Graphics3DLineSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DDrapedGraphicLayer ./ElevationAligners ./Graphics3DSymbolCommonCode ./lineUtils ../../../../core/screenUtils ../../../../geometry/Polygon ../../lib/glMatrix ../../webgl-engine/Stage ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/RenderGeometry ./graphicUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F){var G=y.vec3d,p=y.mat4d;return function(a){function r(){return null!==a&&a.apply(this,arguments)||this}k(r,a);r.prototype._prepareResources=function(){var a=this.symbol,b=this._isPropertyDriven("size")||this._isPropertyDriven("color")||this._isPropertyDriven("opacity"),a={idHint:this._getStageIdHint(),width:this._getWidth(a),color:this._getMaterialOpacityAndColor()};if(!this._isPropertyDriven("size")){var c=F.validateSymbolLayerSize(a.width);if(c){this._logWarning(c);
this.reject();return}}if(b||1.5<=a.width)this._isPropertyDriven("size")&&(a.width=0),this._material=f.createRibbonMaterial(a);else if(0<a.width)this._material=f.createNativeMaterial(a);else{this.reject();return}this._context.stage.add(B.ModelContentType.MATERIAL,this._material);this.resolve()};r.prototype._getWidth=function(a){return null!=a.size?q.pt2px(a.size):1};r.prototype.destroy=function(){a.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(B.ModelContentType.MATERIAL,
this._material.getId()),this._material=null)};r.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polyline"!==c.type&&"polygon"!==c.type&&"extent"!==c.type)return this._logWarning("unsupported geometry type for line symbol: "+c.type),null;var c="polygon"===c.type||"extent"===c.type?"rings":"paths",f="graphic"+a.uid,l=this._getVertexOpacityAndColor(b,Float32Array,255),k=0;b.size&&this._isPropertyDriven("size")&&(k=n.getSingleSizeDriver(b.size),k=q.pt2px(k));
b=this.getGraphicElevationContext(a);return"on-the-ground"===b.mode?this._createAsOverlay(a,c,l,k,b,f):this._createAs3DShape(a,c,l,k,b,f,a.uid)};r.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)return b=this._material.getColor(),this._material.setColor([b[0],b[1],b[2],this._getMaterialOpacity()]),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var f=this._elevationContext.mode;if(null==a||null==f)return!1;if("on-the-ground"===a&&"on-the-ground"===
f)return!0;if(a!==f&&("on-the-ground"===a||"on-the-ground"===f))return!1;a=n.needsElevationUpdates2D(f);for(var l in b){var k=b[l];(f=c(k))&&!f.isDraped()&&(k=k.graphic,f.needsElevationUpdates=a,f.elevationContext.set(this.getGraphicElevationContext(k)))}return!0}return!1};r.prototype._getOutlineGeometry=function(a,b){return b};r.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);"extent"===a.type&&(a=l.fromExtent(a));return a};r.prototype._createAs3DShape=function(a,c,l,k,q,
r,y){var z=this._getGeometry(a),B=z.hasZ,A=z[c],D=this._getOutlineGeometry(z,A);a=[];var x=[],h=[],F=G.create(),I=Array(6),z=n.getGeometryVertexData3D(D,B,z.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,q);this._logGeometryCreationWarnings(z,A,c,"LineSymbol3DLayer");if(0<D.length){for(var A=z.geometryData.outlines,D=z.eleVertexData,B=z.vertexData,e=0;e<A.length;++e){var d=A[e];if(!(1>=d.count)){var g=d.index,m=d.count;if(this._context.clippingExtent&&
(n.computeBoundingBox(D,g,m,I),n.boundingBoxClipped(I,this._context.clippingExtent)))continue;n.chooseOrigin(B,g,m,F);n.subtractCoordinates(B,g,m,F);d=new Float64Array(D.buffer,3*g*D.BYTES_PER_ELEMENT,3*m);g=new Float64Array(B.buffer,3*g*B.BYTES_PER_ELEMENT,3*m);g=f.createPolylineGeometry(g,d,"rings"===c,l,k);g=new w(g,r+"path"+e);g.singleUse=!0;a.push(g);x.push([this._material]);g=p.identity();p.translate(g,F,g);h.push(g)}}if(0<a.length)return c=new v({geometries:a,materials:x,transformations:h,
castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicId:y},idHint:r}),c=new b(this,c,a,null,null,t.perVertexElevationAligner,q),c.alignedTerrainElevation=z.terrainElevation,c.needsElevationUpdates=n.needsElevationUpdates2D(q.mode),c}return null};r.prototype._createAsOverlay=function(a,b,l,k,q,t){var r=this._getGeometry(a);this._material.setRenderPriority(this._symbolLayerOrder);var v=r[b],y=this._getOutlineGeometry(r,v);a=[];var w=Array(6),z=G.create(),r=n.getGeometryVertexDataDraped(y,
r.spatialReference,this._context.overlaySR);this._logGeometryCreationWarnings(r,v,b,"LineSymbol3DLayer");if(0<y.length){v=r.vertexData;y=r.geometryData.outlines;for(r=0;r<y.length;++r){var B=y[r],h=B.index,B=B.count;n.computeBoundingBox(v,h,B,w);if(!n.boundingBoxClipped(w,this._context.clippingExtent)){n.chooseOrigin(v,h,B,z);n.subtractCoordinates(v,h,B,z);n.setZ(v,h,B,this._getDrapedZ());B=new Float64Array(v.buffer,3*h*v.BYTES_PER_ELEMENT,3*B);h=p.identity();p.translate(h,z,h);var B=f.createPolylineGeometry(B,
null,"rings"===b,l,k),A=new D(B);A.material=this._material;A.center=[.5*(w[0]+w[3]),.5*(w[1]+w[4]),0];A.bsRadius=.5*Math.sqrt((w[3]-w[0])*(w[3]-w[0])+(w[4]-w[1])*(w[4]-w[1]));A.transformation=h;A.name=t;A.uniqueName=t+"#"+B.id;a.push(A)}}return new c(this,a,null,null,w,q)}return null};return r}(a)})},"esri/views/3d/layers/graphics/lineUtils":function(){define("require exports ../../webgl-engine/materials/RibbonLineMaterial ../../webgl-engine/materials/NativeLineMaterial ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Util".split(" "),
function(x,r,k,a,b,c){function t(a){var b=a.length;return a[0]===a[b-3]&&a[1]===a[b-2]&&a[2]===a[b-1]}Object.defineProperty(r,"__esModule",{value:!0});var n=c.VertexAttrConstants;r.createRibbonMaterial=function(a){var b={width:a.width,color:a.color,miterLimit:a.miterLimit,polygonOffset:!0};"miter"===a.join||"bevel"===a.join?b.join=a.join:(b.join="miter",a.join&&console.warn("unsupported join type for line symbol: "+a.join));return new k(b,a.idHint+"_ribbonlinemat")};r.createNativeMaterial=function(b){return new a(b.width,
b.color,b.idHint+"_nativelinemat")};r.isClosed=t;r.createPolylineGeometry=function(a,c,l,k,r){var f,q,y;if(l=l&&!t(a)){l=new Float32Array(a.length+3);for(q=0;q<a.length;q++)l[q]=a[q];q=l.length;l[q-3]=a[0];l[q-2]=a[1];l[q-1]=a[2];f=a.length/3+1;q=new Uint32Array(2*(f-1));y=new Uint32Array(2*(f-1))}else f=a.length/3,q=new Uint32Array(2*(f-1)),y=new Uint32Array(2*(f-1)),l=a;a=new Float32Array(1);a[0]=r;for(var B=r=0,x=0;x<f-1;x++)q[r++]=x,q[r++]=x+1,y[B++]=0,y[B++]=0;r={};f={};r[n.POSITION]=q;r[n.COLOR]=
y;r[n.SIZE]=y;f[n.POSITION]={size:3,data:l,offsetIdx:0,strideIdx:3};f[n.COLOR]={size:4,data:k,offsetIdx:0,strideIdx:4};f[n.SIZE]={size:1,data:a,offsetIdx:0,strideIdx:1};c&&(r.mapPos=q,f.mapPos={size:3,data:c,offsetIdx:0,strideIdx:3});return new b(f,r,b.DefaultOffsets,"line")}})},"esri/views/3d/webgl-engine/materials/NativeLineMaterial":function(){define("./internal/MaterialUtil ../lib/Util ../lib/gl-matrix ../lib/RenderSlot ../lib/DefaultVertexBufferLayouts ../lib/ComponentUtils ../../../webgl/Util".split(" "),
function(x,r,k,a,b,c,t){var n=k.vec3d,f=k.vec2d,q=k.mat4d,l=r.VertexAttrConstants,y=n.create(),B=n.create(),v=n.create(),w=n.create(),D=f.create(),F=f.create(),G=n.create(),p=n.create(),z=[],A=function(b,c){x.basicGLMaterialConstructor(this,b);var f=c.get("simple"),l=b.getColor();this.beginSlot=function(b){return b===a.OPAQUE_MATERIAL};this.getProgram=function(){return f};this.bind=function(a,b){a.bindProgram(f);f.setUniform4fv("color",l);a.setBlendingEnabled(1>l[3]);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,
a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0)};this.release=function(a){1>l[3]&&a.setBlendingEnabled(!1)};this.bindView=function(a,b){x.bindView(b.origin,b.view,f)};this.bindInstance=function(a,b){f.setUniformMatrix4fv("model",b.transformation)};this.getDrawMode=function(a){return a.gl.LINES}},J=function(b,c){x.basicGLMaterialConstructor(this,b);var f=c.get("highlight");this.beginSlot=function(b){return b===a.OPAQUE_MATERIAL};this.getProgram=function(){return f};
this.bind=function(a,b){a.bindProgram(f);a.setDepthTestEnabled(!0)};this.release=function(a){};this.bindView=function(a,b){x.bindView(b.origin,b.view,f)};this.bindInstance=function(a,b){f.setUniformMatrix4fv("model",b.transformation)};this.getDrawMode=function(a){return a.gl.LINES}};return function(a,f,k){x.basicMaterialConstructor(this,k);var I=b.Pos3,K=t.getStride(I)/4;this.canBeMerged=!0;this.setColor=function(a){f=a;this.notifyDirty("matChanged")};this.getColor=function(){return f};this.dispose=
function(){};this.getOutputAmount=function(a){return a*K};this.getVertexBufferLayout=function(){return I};this.fillInterleaved=function(a,b,c,f,k,n){c=a.vertexAttr[l.POSITION].data;if(b){var h=c;c=z;for(f=0;f<h.length;f+=3){var p=h[f],q=h[f+1],e=h[f+2];c[f]=b[0]*p+b[4]*q+b[8]*e+b[12];c[f+1]=b[1]*p+b[5]*q+b[9]*e+b[13];c[f+2]=b[2]*p+b[6]*q+b[10]*e+b[14]}}a=a.indices[l.POSITION];for(f=0;f<a.length;f++)b=3*a[f],k[n++]=c[b],k[n++]=c[b+1],k[n++]=c[b+2]};this.intersect=function(a,b,f,l,k,t,h){if(l.isSelection&&
!c.isAllHidden(b.componentVisibilities,a.data.componentOffsets)){b=a.getData().getVertexAttr("position").position.data;a=Number.MAX_VALUE;var z,A;k=l.camera;t=l.point;for(var e=0;e<b.length-5;e+=3){y[0]=b[e];y[1]=b[e+1];y[2]=b[e+2];q.multiplyVec3(f,y);B[0]=b[e+3];B[1]=b[e+4];B[2]=b[e+5];q.multiplyVec3(f,B);k.projectPoint(y,D);k.projectPoint(B,F);if(0>D[2]&&0<F[2])n.subtract(y,B,v),z=k.frustumPlanes,A=-(n.dot(z[4],y)+z[4][3]),z=A/n.dot(v,z[4]),n.scale(v,z,v),n.add(y,v,y),k.projectPoint(y,D);else if(0<
D[2]&&0>F[2])n.subtract(B,y,v),z=k.frustumPlanes,A=-(n.dot(z[4],B)+z[4][3]),z=A/n.dot(v,z[4]),n.scale(v,z,v),n.add(B,v,B),k.projectPoint(B,F);else if(0>D[2]&&0>F[2])continue;z=r.pointLineSegmentDistance2D(D,F,t);z<a&&(a=z,n.set(y,G),n.set(B,p))}f=l.p0;l=l.p1;2>a&&(a=r.lineSegmentLineSegmentDistance3D(G,p,f,l),b=Number.MAX_VALUE,a[0]&&(n.subtract(a[2],f,w),a=n.length(w),n.scale(w,1/a),b=a/n.dist(f,l)),h(b,w))}};this.getGLMaterials=function(){return{color:A,depthShadowMap:void 0,normal:void 0,depth:void 0,
highlight:J}};this.getAllTextureIds=function(){return[]}}})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ../../../../geometry/Point ../../support/projectionUtils ../../../../views/3d/lib/glMatrix ../../webgl-engine/Stage ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/materials/Material ../../webgl-engine/lib/Util ./graphicUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D){function F(a,b,f,l){for(var k=a.getGeometryRecords(),n=k.length,p="absolute-height"!==b.mode,q=0,h=0;h<n;h++){var t=k[h].geometry,r=[k[h].transformation[12],k[h].transformation[13],k[h].transformation[14]],e=t.getData().getVertexAttr(),d=e[A.POSITION].data,g=e.zOffset.data,e=e.mapPos.data,m=e.length/3;z(d.length/3===m*L+2,"unexpected tube geometry");var v=0,y=0;I.spatialReference=f.spatialReference;for(var w=0,B=0;B<m;B++){I.x=e[3*B];I.y=e[3*B+1];I.z=e[3*
B+2];var D=c.computeElevation(f,I,b,l,p?K:null);p&&(w+=K.terrainElevation);var x=L;0!==B&&B!==m-1||x++;for(var F=0;F<x;F++)J[0]=d[v]+r[0],J[1]=d[v+1]+r[1],J[2]=d[v+2]+r[2],l.setAltitude(D+g[y],J),d[v]=J[0]-r[0],d[v+1]=J[1]-r[1],d[v+2]=J[2]-r[2],v+=3,y+=1;t.invalidateBoundingInfo()}a.geometryVertexAttrsUpdated(h);q+=w/m}return q/n}var G=f.vec3d,p=f.mat4d,z=w.assert;x=function(a){function f(){return null!==a&&a.apply(this,arguments)||this}k(f,a);f.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=
D.validateSymbolLayerSize(this._getSymbolSize());if(a){this._logWarning(a);this.reject();return}}var a=this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),c=G.create(b),b=b[3],c={diffuse:c,ambient:c,opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),vertexColors:this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};this._material=new v(c,a+"_3dlinemat");this._context.stage.add(q.ModelContentType.MATERIAL,this._material);this.resolve()};f.prototype.destroy=function(){a.prototype.destroy.call(this);
this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(q.ModelContentType.MATERIAL,this._material.getId()),this._material=null)};f.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polyline"!==c.type)return this._logWarning("unsupported geometry type for path symbol: "+c.type),null;var c="graphic"+a.uid,f=this.getGraphicElevationContext(a);return this._createAs3DShape(a,b,f,c,a.uid)};f.prototype.layerPropertyChanged=function(a,b,f){if("opacity"===
a)return b=this._getMaterialOpacity(),f=1>b||this._isPropertyDriven("opacity"),this._material.setParameterValues({opacity:b,transparent:f}),!0;if("elevationInfo"===a){this._updateElevationContext();for(var l in b){var k=b[l];if(a=f(k))k=this.getGraphicElevationContext(k.graphic),a.needsElevationUpdates=c.needsElevationUpdates3D(k.mode),a.elevationContext.set(k)}return!0}return!1};f.prototype._getPathSize=function(a){a=a.size&&this._isPropertyDriven("size")?c.getSingleSizeDriver(a.size):this._getSymbolSize();
return a/=this._context.renderCoordsHelper.unitInMeters};f.prototype._getSymbolSize=function(){return this.symbol.size||1};f.prototype._createAs3DShape=function(a,f,k,q,t){var r=a.geometry,h=r.hasZ,v=r.paths;a=[];var w=[],e=[],d=G.create(),g=this._context.renderSpatialReference===n.SphericalECEFSpatialReference,m=Array(6),u=this._getPathSize(f),r=c.getGeometryVertexData3D(v,h,r.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,k);
this._logGeometryCreationWarnings(r,v,"paths","PathSymbol3DLayer");if(0<v.length){for(var v=r.geometryData.outlines,h=r.eleVertexData,z=r.vertexData,A=0;A<v.length;++A){var D=v[A];if(!(1>=D.count)){var x=D.index,I=D.count;if(this._context.clippingExtent&&(c.computeBoundingBox(h,x,I,m),c.boundingBoxClipped(m,this._context.clippingExtent)))continue;c.chooseOrigin(z,x,I,d);c.subtractCoordinates(z,x,I,d);D=new Float64Array(h.buffer,3*x*h.BYTES_PER_ELEMENT,3*I);x=c.flatArrayToArrayOfArrays(z,x,I);x=B.createTubeGeometry(x,
.5*u,L,g,d);x.getVertexAttr().mapPos={size:3,data:D,offsetIdx:0,strideIdx:3};this._material.getParams().vertexColors&&(D=this._getVertexOpacityAndColor(f),x=B.addVertexColors(x,D));D=new y(x,q+"path"+A);D.singleUse=!0;a.push(D);w.push([this._material]);D=p.identity();p.translate(D,d,D);e.push(D)}}if(0<a.length)return f=new l({geometries:a,materials:w,transformations:e,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:t},idHint:q}),f=new b(this,f,a,null,null,F,k),f.alignedTerrainElevation=
r.terrainElevation,f.needsElevationUpdates=c.needsElevationUpdates3D(k.mode),f}return null};return f}(a);var A=w.VertexAttrConstants,J=G.create(),I=new t,K={verticalDistanceToGround:0,terrainElevation:0},L=10;return x})},"esri/views/3d/layers/graphics/Graphics3DFillSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/screenUtils ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DDrapedGraphicLayer ./ElevationAligners ./Graphics3DSymbolCommonCode ./lineUtils ./graphicUtils ../../../../geometry/Polygon ../../../../Color ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/materials/ColorMaterial ../../webgl-engine/lib/Util ./earcut/earcut".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I){var K=J.VertexAttrConstants;x=v.vec3d;var L=v.mat4d;b=function(b){function r(){var a=null!==b&&b.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};return a}k(r,b);r.prototype._prepareResources=function(){this._prepareFillResources();this._prepareOutlineResources();this.resolve()};r.prototype._prepareFillResources=function(){var a=this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),b=
{color:b,transparent:1>b[3]||this._isPropertyDriven("opacity"),polygonOffset:!1,vertexColors:!0};this._material=new A(b,a+"_colormat");this._context.stage.add(D.ModelContentType.MATERIAL,this._material)};r.prototype._prepareOutlineResources=function(){var b=this.symbol.outline;if(this._hasOutline=!!(b&&b.size&&0<b.size&&b.color))b={idHint:this._getStageIdHint()+"_outline",color:this._getOutlineColor(),width:a.pt2px(b.size)},this._outlineMaterial=2<b.width?q.createRibbonMaterial(b):q.createNativeMaterial(b),
this._context.stage.add(D.ModelContentType.MATERIAL,this._outlineMaterial)};r.prototype.destroy=function(){b.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(D.ModelContentType.MATERIAL,this._material.getId()),this._material=null);this._outlineMaterial&&(this._context.stage.remove(D.ModelContentType.MATERIAL,this._outlineMaterial.getId()),this._outlineMaterial=null)};r.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);
if("polyline"!==c.type&&"polygon"!==c.type&&"extent"!==c.type)return this._logWarning("unsupported geometry type for fill symbol: "+c.type),null;c="graphic"+a.uid;b=this._getVertexOpacityAndColor(b,Uint8Array,255);var f=this.getGraphicElevationContext(a);return"on-the-ground"===f.mode?this._createAsOverlay(a,b,f,c):this._createAs3DShape(a,b,f,c,a.uid)};r.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)return b=this._material.getColor(),b[3]=this._getMaterialOpacity(),this._material.setColor(b),
this._material.setTransparent(1>b[3]),this._outlineMaterial&&(b=this._outlineMaterial.getColor(),this._outlineMaterial.setColor([b[0],b[1],b[2],this._getOutlineOpacity()])),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var h=this._elevationContext.mode;if(null==a||null==h)return!1;if("on-the-ground"===a&&"on-the-ground"===h)return!0;if(a!==h&&("on-the-ground"===a||"on-the-ground"===h))return!1;a=f.needsElevationUpdates2D(h);for(var l in b){var e=b[l];(h=c(e))&&
!h.isDraped()&&(e=e.graphic,h.needsElevationUpdates=a,h.elevationContext.set(this.getGraphicElevationContext(e)))}return!0}return!1};r.prototype.setDrawOrder=function(a,b,c){this._material&&(this._material.setRenderPriority(a+b/2),c[this._material.getId()]=!0);this._outlineMaterial&&(this._outlineMaterial.setRenderPriority(a),c[this._outlineMaterial.getId()]=!0)};r.prototype._createAs3DShape=function(a,b,h,l,k){var e=this._getPolyGeometry(a),d=e.hasZ;a=e.rings;var g=this._getOutlineGeometry(e,a),
e=f.getGeometryVertexData3D(g,d,e.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,h);N.idHint=l;N.color=b;N.data=e;var m;this._hasOutline&&(m=new e.vertexData.constructor(e.vertexData));N.outNum=0;N.outGeometries=[];N.outTransforms=[];N.outMaterials=[];this._createAs3DShapeFill(N);N.data.vertexData=m;this._createAs3DShapeOutline(N);this._logGeometryCreationWarnings(N.data,a,"rings","FillSymbol3DLayer");if(0===N.outNum)return null;
b=new F({geometries:N.outGeometries,materials:N.outMaterials,transformations:N.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicId:k},idHint:l});b=new c(this,b,N.outGeometries,null,null,n.perVertexElevationAligner,h);b.alignedTerrainElevation=e.terrainElevation;b.needsElevationUpdates=f.needsElevationUpdates2D(h.mode);return b};r.prototype._createAs3DShapeFill=function(a){for(var b=a.data.geometryData.polygons,c=a.data.eleVertexData,l=a.data.vertexData,k=function(d){var g=
b[d];d=g.count;var h=g.index;if(e._context.clippingExtent&&(f.computeBoundingBox(c,h,d,O),f.boundingBoxClipped(O,e._context.clippingExtent)))return"continue";var k=new Float64Array(c.buffer,3*h*c.BYTES_PER_ELEMENT,3*d),n=new Float64Array(l.buffer,3*h*l.BYTES_PER_ELEMENT,3*d),g=g.holeIndices.map(function(a){return a-h}),g=I(k,g,3);if(0===g.length)return"continue";f.chooseOrigin(l,h,d,P);f.subtractCoordinates(l,h,d,P);d=e._createFillGeometry(g,0,n,k,a.color);d=new G(d,a.idHint);d.singleUse=!0;k=L.identity();
L.translate(k,P,k);a.outGeometries.push(d);a.outMaterials.push([e._material]);a.outTransforms.push(k);a.outNum++},e=this,d=0;d<b.length;++d)k(d)};r.prototype._createAs3DShapeOutline=function(a){if(this._hasOutline)for(var b=a.data.geometryData.outlines,c=a.data.eleVertexData,l=a.data.vertexData,k=0;k<b.length;++k){var e=b[k],d=e.index,g=e.count;if(this._context.clippingExtent&&(f.computeBoundingBox(c,d,g,O),f.boundingBoxClipped(O,this._context.clippingExtent)))continue;f.chooseOrigin(l,d,g,P);f.subtractCoordinates(l,
d,g,P);e=new Float64Array(c.buffer,3*d*c.BYTES_PER_ELEMENT,3*g);d=new Float64Array(l.buffer,3*d*l.BYTES_PER_ELEMENT,3*g);d=q.createPolylineGeometry(d,e,a.isRings,U,0);d=new G(d,a.idHint+"outline"+k);d.singleUse=!0;e=L.identity();L.translate(e,P,e);a.outGeometries.push(d);a.outMaterials.push([this._outlineMaterial]);a.outTransforms.push(e);a.outNum++}};r.prototype._createAsOverlay=function(a,b,c,l){var h=this._getPolyGeometry(a);a=h.rings;var e=this._getOutlineGeometry(h,a);this._material.setRenderPriority(this._symbolLayerOrder+
this._symbolLayerOrderDelta/2);this._hasOutline&&this._outlineMaterial.setRenderPriority(this._symbolLayerOrder);h=f.getGeometryVertexDataDraped(e,h.spatialReference,this._context.overlaySR);N.idHint=l;N.color=b;N.data=h;var d;this._hasOutline&&(d=new h.vertexData.constructor(h.vertexData));N.outNum=0;N.outGeometries=[];N.outBoundingBox=w.create(w.NEGATIVE_INFINITY);this._createAsOverlayFill(N);N.data.vertexData=d;this._createAsOverlayOutline(N);this._logGeometryCreationWarnings(N.data,a,"rings",
"FillSymbol3DLayer");return 0<N.outNum?new t(this,N.outGeometries,null,null,N.outBoundingBox,c):null};r.prototype._createAsOverlayFill=function(a){for(var b=a.data.vertexData,c=a.data.geometryData.polygons,l=function(d){var e=c[d];d=e.count;var h=e.index,l=new Float64Array(b.buffer,3*h*b.BYTES_PER_ELEMENT,3*d),e=e.holeIndices.map(function(a){return a-h}),l=I(l,e,3);if(0===l.length)return"continue";f.computeBoundingBox(b,h,d,O);if(f.boundingBoxClipped(O,k._context.clippingExtent))return"continue";
w.expand(a.outBoundingBox,O);f.chooseOrigin(b,h,d,P);f.subtractCoordinates(b,h,d,P);f.setZ(b,h,d,k._getDrapedZ());d=L.identity();L.translate(d,P,d);l=k._createFillGeometry(l,h,b,null,a.color);e=new z(l);e.material=k._material;var n=O;e.center=[.5*(n[0]+n[3]),.5*(n[1]+n[4]),0];e.bsRadius=.5*Math.sqrt((n[3]-n[0])*(n[3]-n[0])+(n[4]-n[1])*(n[4]-n[1]));e.transformation=d;e.name=a.idHint;e.uniqueName=a.idHint+"#"+l.id;a.outGeometries.push(e);a.outNum++},k=this,e=0;e<c.length;++e)l(e)};r.prototype._createAsOverlayOutline=
function(a){if(this._hasOutline)for(var b=a.data.vertexData,c=a.data.geometryData.outlines,l=0;l<c.length;++l){var k=c[l],e=k.index,k=k.count;f.computeBoundingBox(b,e,k,O);if(!f.boundingBoxClipped(O,this._context.clippingExtent)){w.expand(a.outBoundingBox,O);f.chooseOrigin(b,e,k,P);f.subtractCoordinates(b,e,k,P);f.setZ(b,e,k,this._getDrapedZ());k=new Float64Array(b.buffer,3*e*b.BYTES_PER_ELEMENT,3*k);e=L.identity();L.translate(e,P,e);var k=q.createPolylineGeometry(k,null,!0,U,0),d=new z(k);d.material=
this._outlineMaterial;var g=O;d.center=[.5*(g[0]+g[3]),.5*(g[1]+g[4]),0];d.bsRadius=.5*Math.sqrt((g[3]-g[0])*(g[3]-g[0])+(g[4]-g[1])*(g[4]-g[1]));d.transformation=e;d.name=a.idHint+"outline";d.uniqueName=a.idHint+"outline#"+k.id;a.outGeometries.push(d);a.outNum++}}};r.prototype._getOutlineGeometry=function(a,b){return b};r.prototype._getOutlineOpacity=function(){return this._getLayerOpacity()*this.symbol.outline.color.a};r.prototype._getOutlineColor=function(){var a=this.symbol.outline.color,b=this._getOutlineOpacity();
return l.mixinColorAndOpacity(B.toUnitRGB(a),b)};r.prototype._getPolyGeometry=function(a){a=a.geometry;return"extent"===a.type?y.fromExtent(a):a};r.prototype._createFillGeometry=function(a,b,c,f,l){for(var e=a.length,d=new Uint32Array(e),g=new Uint32Array(e),h=0;h<e;h++)d[h]=a[h]+b,g[h]=0;a={};b={};a[K.POSITION]=d;a[K.COLOR]=g;b[K.POSITION]={size:3,data:c};b[K.COLOR]={size:4,data:l};f&&(b.mapPos={size:3,data:f},a.mapPos=d);return new p(b,a)};return r}(b);var O=w.create(),P=x.create(),U=new Float32Array([255,
255,255,255]),N={idHint:null,color:null,data:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};return b})},"esri/views/3d/layers/graphics/earcut/earcut":function(){define([],function(){function x(f,l,q){q=q||2;var p=l&&l.length,t=p?l[0]*q:f.length,y=r(f,0,t,q,!0),w=[];if(!y)return w;var z,B,A,D;if(p){var x=q,p=[],F,G,V;D=0;for(F=l.length;D<F;D++)G=l[D]*x,V=D<F-1?l[D+1]*x:f.length,G=r(f,G,V,x,!1),G===G.next&&(G.steiner=!0),p.push(n(G));p.sort(b);for(D=0;D<p.length;D++){l=
p[D];x=y;if(x=c(l,x))l=v(x,l),k(l,l.next);y=k(y,y.next)}}if(f.length>80*q){z=A=f[0];B=p=f[1];for(x=q;x<t;x+=q)D=f[x],l=f[x+1],D<z&&(z=D),l<B&&(B=l),D>A&&(A=D),l>p&&(p=l);A=Math.max(A-z,p-B)}a(y,w,q,z,B,A);return w}function r(a,b,c,f,k){var n;if(k===0<G(a,b,c,f))for(k=b;k<c;k+=f)n=w(k,a[k],a[k+1],n);else for(k=c-f;k>=b;k-=f)n=w(k,a[k],a[k+1],n);n&&l(n,n.next)&&(D(n),n=n.next);return n}function k(a,b){if(!a)return a;b||(b=a);var c;do if(c=!1,a.steiner||!l(a,a.next)&&0!==q(a.prev,a,a.next))a=a.next;
else{D(a);a=b=a.prev;if(a===a.next)return null;c=!0}while(c||a!==b);return b}function a(b,c,n,r,w,x,F){if(b){if(!F&&x){var p=b,z=p;do null===z.z&&(z.z=t(z.x,z.y,r,w,x)),z.prevZ=z.prev,z=z.nextZ=z.next;while(z!==p);z.prevZ.nextZ=null;z.prevZ=null;var p=z,A,G,I,J,K,L,h=1;do{z=p;I=p=null;for(J=0;z;){J++;G=z;for(A=K=0;A<h&&(K++,G=G.nextZ,G);A++);for(L=h;0<K||0<L&&G;)0===K?(A=G,G=G.nextZ,L--):0!==L&&G?z.z<=G.z?(A=z,z=z.nextZ,K--):(A=G,G=G.nextZ,L--):(A=z,z=z.nextZ,K--),I?I.nextZ=A:p=A,A.prevZ=I,I=A;z=
G}I.nextZ=null;h*=2}while(1<J)}for(p=b;b.prev!==b.next;){z=b.prev;G=b.next;if(x)a:{I=b;L=r;var ca=w,Q=x;J=I.prev;K=I;h=I.next;if(0<=q(J,K,h))I=!1;else{var e=J.x>K.x?J.x>h.x?J.x:h.x:K.x>h.x?K.x:h.x,d=J.y>K.y?J.y>h.y?J.y:h.y:K.y>h.y?K.y:h.y;A=t(J.x<K.x?J.x<h.x?J.x:h.x:K.x<h.x?K.x:h.x,J.y<K.y?J.y<h.y?J.y:h.y:K.y<h.y?K.y:h.y,L,ca,Q);L=t(e,d,L,ca,Q);for(ca=I.nextZ;ca&&ca.z<=L;){if(ca!==I.prev&&ca!==I.next&&f(J.x,J.y,K.x,K.y,h.x,h.y,ca.x,ca.y)&&0<=q(ca.prev,ca,ca.next)){I=!1;break a}ca=ca.nextZ}for(ca=
I.prevZ;ca&&ca.z>=A;){if(ca!==I.prev&&ca!==I.next&&f(J.x,J.y,K.x,K.y,h.x,h.y,ca.x,ca.y)&&0<=q(ca.prev,ca,ca.next)){I=!1;break a}ca=ca.prevZ}I=!0}}else a:if(I=b,J=I.prev,K=I,h=I.next,0<=q(J,K,h))I=!1;else{for(A=I.next.next;A!==I.prev;){if(f(J.x,J.y,K.x,K.y,h.x,h.y,A.x,A.y)&&0<=q(A.prev,A,A.next)){I=!1;break a}A=A.next}I=!0}if(I)c.push(z.i/n),c.push(b.i/n),c.push(G.i/n),D(b),p=b=G.next;else if(b=G,b===p){if(!F)a(k(b),c,n,r,w,x,1);else if(1===F){F=c;p=n;z=b;do G=z.prev,I=z.next.next,!l(G,I)&&y(G,z,z.next,
I)&&B(G,I)&&B(I,G)&&(F.push(G.i/p),F.push(z.i/p),F.push(I.i/p),D(z),D(z.next),z=b=I),z=z.next;while(z!==b);b=z;a(b,c,n,r,w,x,2)}else if(2===F)a:{F=b;do{for(p=F.next.next;p!==F.prev;){if(z=F.i!==p.i){z=F;G=p;I=void 0;if(I=z.next.i!==G.i&&z.prev.i!==G.i){I=void 0;b:{I=z;do{if(I.i!==z.i&&I.next.i!==z.i&&I.i!==G.i&&I.next.i!==G.i&&y(I,I.next,z,G)){I=!0;break b}I=I.next}while(I!==z);I=!1}I=!I}J=void 0;if(J=I&&B(z,G)&&B(G,z)){I=z;J=!1;K=(z.x+G.x)/2;G=(z.y+G.y)/2;do I.y>G!==I.next.y>G&&K<(I.next.x-I.x)*
(G-I.y)/(I.next.y-I.y)+I.x&&(J=!J),I=I.next;while(I!==z)}z=J}if(z){b=v(F,p);F=k(F,F.next);b=k(b,b.next);a(F,c,n,r,w,x);a(b,c,n,r,w,x);break a}p=p.next}F=F.next}while(F!==b)}break}}}}function b(a,b){return a.x-b.x}function c(a,b){var c=b,l=a.x,k=a.y,n=-Infinity,p;do{if(k<=c.y&&k>=c.next.y){var q=c.x+(k-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(q<=l&&q>n){n=q;if(q===l){if(k===c.y)return c;if(k===c.next.y)return c.next}p=c.x<c.next.x?c:c.next}}c=c.next}while(c!==b);if(!p)return null;if(l===n)return p.prev;
b=p;for(var q=p.x,t=p.y,r=Infinity,v,c=p.next;c!==b;)l>=c.x&&c.x>=q&&f(k<t?l:n,k,q,t,k<t?n:l,k,c.x,c.y)&&(v=Math.abs(k-c.y)/(l-c.x),(v<r||v===r&&c.x>p.x)&&B(c,a)&&(p=c,r=v)),c=c.next;return p}function t(a,b,c,f,l){a=32767*(a-c)/l;b=32767*(b-f)/l;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function n(a){var b=a,c=a;do b.x<c.x&&(c=b),b=b.next;while(b!==a);return c}function f(a,
b,c,f,l,k,n,q){return 0<=(l-n)*(b-q)-(a-n)*(k-q)&&0<=(a-n)*(f-q)-(c-n)*(b-q)&&0<=(c-n)*(k-q)-(l-n)*(f-q)}function q(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}function l(a,b){return a.x===b.x&&a.y===b.y}function y(a,b,c,f){return l(a,b)&&l(c,f)||l(a,f)&&l(c,b)?!0:0<q(a,b,c)!==0<q(a,b,f)&&0<q(c,f,a)!==0<q(c,f,b)}function B(a,b){return 0>q(a.prev,a,a.next)?0<=q(a,b,a.next)&&0<=q(a,a.prev,b):0>q(a,b,a.prev)||0>q(a,a.next,b)}function v(a,b){var c=new F(a.i,a.x,a.y),f=new F(b.i,b.x,b.y),l=a.next,
k=b.prev;a.next=b;b.prev=a;c.next=l;l.prev=c;f.next=c;c.prev=f;k.next=f;f.prev=k;return f}function w(a,b,c,f){a=new F(a,b,c);f?(a.next=f.next,a.prev=f,f.next.prev=a,f.next=a):(a.prev=a,a.next=a);return a}function D(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function F(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function G(a,b,c,f){for(var l=0,k=c-f;b<c;b+=f)l+=(a[k]-a[b])*(a[b+
1]+a[k+1]),k=b;return l}x.deviation=function(a,b,c,f){var l=b&&b.length,k=Math.abs(G(a,0,l?b[0]*c:a.length,c));if(l)for(var l=0,n=b.length;l<n;l++)k-=Math.abs(G(a,b[l]*c,l<n-1?b[l+1]*c:a.length,c));for(l=b=0;l<f.length;l+=3){var n=f[l]*c,p=f[l+1]*c,q=f[l+2]*c;b+=Math.abs((a[n]-a[q])*(a[p+1]-a[n+1])-(a[n]-a[p])*(a[q+1]-a[n+1]))}return 0===k&&0===b?0:Math.abs((b-k)/k)};x.flatten=function(a){for(var b=a[0][0].length,c={vertices:[],holes:[],dimensions:b},f=0,l=0;l<a.length;l++){for(var k=0;k<a[l].length;k++)for(var n=
0;n<b;n++)c.vertices.push(a[l][k][n]);0<l&&(f+=a[l-1].length,c.holes.push(f))}return c};return x})},"esri/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ../../../../geometry/Polygon ../../../../geometry/Point ../../support/projectionUtils ../../lib/glMatrix ../../webgl-engine/Stage ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/materials/Material ../../webgl-engine/lib/Util ./earcut/earcut ./graphicUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G){function p(a,b,d,e,c,f,g,h,l,k,n,p,q,t){var m=d.length/3,r=0;n+=2*e.count;var v=e.index,u=e.count,y=l,w=n;K.set(q,P);var z=0<p?1:-1,v=3*v,B=y;q=3*B;for(var D=y+u,y=3*D,C=0;C<u;++C)t&&(P[0]=a[v+0],P[1]=a[v+1],P[2]=a[v+2],K.normalize(P)),c[q+0]=a[v+0],c[q+1]=a[v+1],c[q+2]=a[v+2],f[q+0]=b[v+0],f[q+1]=b[v+1],f[q+2]=b[v+2],g[q+0]=-z*P[0],g[q+1]=-z*P[1],g[q+2]=-z*P[2],h[B]=0,c[y+0]=a[v+0]+p*P[0],c[y+1]=a[v+1]+p*P[1],c[y+2]=a[v+2]+p*P[2],f[y+0]=b[v+0],f[y+1]=
b[v+1],f[y+2]=b[v+2],g[y+0]=z*P[0],g[y+1]=z*P[1],g[y+2]=z*P[2],h[D]=p,q+=3,y+=3,v+=3,B+=1,D+=1;v=0;q=3*w;y=3*(w+m);q=3*(w+m);y=3*w;a=U;b=N;0>p&&(a=N,b=U);for(C=0;C<m;++C)k[q+0]=d[v+a[0]],k[q+1]=d[v+a[1]],k[q+2]=d[v+a[2]],k[y+0]=d[v+b[0]]+u,k[y+1]=d[v+b[1]]+u,k[y+2]=d[v+b[2]]+u,q+=3,y+=3,v+=3;l+=2*e.count;n=n+2*m-(2*e.count+2*m);A(c,f,h,g,r,e.pathLengths[0],e.count,l,k,n,p);l+=4*e.pathLengths[0];n+=2*e.pathLengths[0];r+=e.pathLengths[0];for(d=1;d<e.pathLengths.length;++d)A(c,f,h,g,r,e.pathLengths[d],
e.count,l,k,n,p),l+=4*e.pathLengths[d],n+=2*e.pathLengths[d],r+=e.pathLengths[d]}function z(a,b,d,e,c,f,g){e[f]=e[g];g*=3;f*=3;a[f+0]=a[g+0];a[f+1]=a[g+1];a[f+2]=a[g+2];b[f+0]=b[g+0];b[f+1]=b[g+1];b[f+2]=b[g+2];d[f+0]=c[0];d[f+1]=c[1];d[f+2]=c[2]}function A(a,b,d,c,f,g,l,k,n,p,q){var m=f,t=f+1,r=f+l,v=f+l+1,u=k,y=k+1,w=k+2*g;k=k+2*g+1;0>q&&(m=f+l+1,v=f);p*=3;for(var B=0;B<g;++B){B===g-1&&(0<q?(t=f,v=f+l):(t=f,m=f+l));var A=a,D=m,C=t,x=r,F=T,D=3*D,C=3*C,x=3*x;K.set3(A[D++],A[D++],A[D++],V);K.set3(A[C++],
A[C++],A[C++],h);K.set3(A[x++],A[x++],A[x++],ca);K.subtract(h,V,Q);K.subtract(ca,V,e);K.cross(e,Q,F);K.normalize(F,F);z(a,b,c,d,T,u,m);z(a,b,c,d,T,y,t);z(a,b,c,d,T,w,r);z(a,b,c,d,T,k,v);n[p++]=u;n[p++]=w;n[p++]=k;n[p++]=u;n[p++]=k;n[p++]=y;m++;t++;r++;v++;u+=2;y+=2;w+=2;k+=2}}function J(a,b,e,f){var h=f.setAltitude;R.spatialReference=e.spatialReference;for(var l=a.getGeometryRecords(),k=l.length,m="absolute-height"!==b.mode,n=0,p=0;p<k;p++){var q=l[p].geometry,t=l[p].transformation,r=q.getData();
g[0]=t[12];g[1]=t[13];g[2]=t[14];q.invalidateBoundingInfo();for(var r=r.getVertexAttr(),q=r[I.POSITION].data,t=r[I.SIZE].data,r=r.mapPos.data,v=q.length/3,u=0,y=0,w=!1,z=0,B=0;B<v;B++){R.x=r[y];R.y=r[y+1];R.z=r[y+2];d[0]=q[u];d[1]=q[u+1];d[2]=q[u+2];var A=c.computeElevation(e,R,b,f,m?S:null);m&&(z+=S.terrainElevation);O[0]=q[u]+g[0];O[1]=q[u+1]+g[1];O[2]=q[u+2]+g[2];h(A+t[u/3],O);q[u]=O[0]-g[0];q[u+1]=O[1]-g[1];q[u+2]=O[2]-g[2];A=.01/f.unitInMeters;if(Math.abs(d[0]-q[u])>A||Math.abs(d[1]-q[u+1])>
A||Math.abs(d[2]-q[u+2])>A)w=!0;y+=3;u+=3}w&&a.geometryVertexAttrsUpdated(p);n+=z/v}return n/k}var I=D.VertexAttrConstants,K=q.vec3d,L=q.mat4d,O=K.create(),P=K.create(),U=[0,2,1],N=[0,1,2],R=new n,S={verticalDistanceToGround:0,terrainElevation:0};x=function(a){function d(){return null!==a&&a.apply(this,arguments)||this}k(d,a);d.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=G.validateSymbolLayerSize(this._getSymbolSize());if(a){this._logWarning(a);this.reject();return}}var a=
this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),d=K.create(b),b=b[3],d={diffuse:d,ambient:d,opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),vertexColors:!0};this._material=new w(d,a+"_3dlinemat");this._context.stage.add(l.ModelContentType.MATERIAL,this._material);this.resolve()};d.prototype.destroy=function(){a.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&this._context.stage.remove(l.ModelContentType.MATERIAL,this._material.getId())};d.prototype.createGraphics3DGraphic=
function(a,b){var d=this._validateGeometry(a.geometry);if("polygon"!==d.type&&"extent"!==d.type)return this._logWarning("unsupported geometry type for extrude symbol: "+d.type),null;var d="polygon"===d.type||"extent"===d.type?"rings":"paths",e="graphic"+a.uid,c=this._getVertexOpacityAndColor(b,Float32Array,255),f=this.getGraphicElevationContext(a);return this._createAs3DShape(a,d,b,c,f,e,a.uid)};d.prototype.layerPropertyChanged=function(a,b,d){if("opacity"===a)return b=this._getMaterialOpacity(),
d=1>b||this._isPropertyDriven("opacity"),this._material.setParameterValues({opacity:b,transparent:d}),!0;if("elevationInfo"===a){this._updateElevationContext();for(var e in b){var f=b[e];if(a=d(f))f=this.getGraphicElevationContext(f.graphic),a.needsElevationUpdates=c.needsElevationUpdates3D(f.mode),a.elevationContext.set(f)}return!0}return!1};d.prototype._getExtrusionSize=function(a){a=a.size&&this._isPropertyDriven("size")?c.getSingleSizeDriver(a.size,2):this._getSymbolSize();return a/=this._context.renderCoordsHelper.unitInMeters};
d.prototype._getSymbolSize=function(){return this.symbol.size||1};d.prototype._createAs3DShape=function(a,d,e,g,h,l,k){var m=a.geometry;"extent"===m.type&&(m=t.fromExtent(m));a=m[d];var n=m.hasZ,q=[],r=[],v=[],u=K.create(),w=Array(6),z=this._context.renderSpatialReference===f.SphericalECEFSpatialReference,A=this._getExtrusionSize(e),D=K.create();z||this._context.renderCoordsHelper.worldUpAtPosition(null,D);e=c.getGeometryVertexData3D(a,n,m.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,
this._context.renderCoordsHelper,h);this._logGeometryCreationWarnings(e,a,d,"ExtrudeSymbol3DLayer");if(0<a.length){var C=e.geometryData.polygons,x=e.eleVertexData,G=e.vertexData;d=G.length/3;var I=new Float64Array(18*d),M=new Float64Array(18*d),Q=new Float64Array(18*d),O=new Float64Array(6*d),N=0;d=function(a){var b=C[a],d=b.count,e=b.index;if(P._context.clippingExtent&&(c.computeBoundingBox(x,e,d,w),c.boundingBoxClipped(w,P._context.clippingExtent)))return"continue";var f=new Float64Array(x.buffer,
3*e*I.BYTES_PER_ELEMENT,3*d),h=b.holeIndices.map(function(a){return a-e}),f=F(f,h,3);if(0<f.length){c.chooseOrigin(G,e,d,u);var h=new Uint32Array(6*d+2*f.length),k=6*d,m=new Float64Array(I.buffer,3*N*I.BYTES_PER_ELEMENT,3*k),n=new Float64Array(M.buffer,3*N*M.BYTES_PER_ELEMENT,3*k),t=new Float64Array(Q.buffer,3*N*Q.BYTES_PER_ELEMENT,3*k),y=new Float64Array(O.buffer,1*N*O.BYTES_PER_ELEMENT,1*k);p(G,x,f,b,m,t,n,y,0,h,0,A,D,z);c.subtractCoordinates(m,0,k,u);N+=6*d;b=P._createExtrudeGeometry(h,{positions:m,
elevation:t,normals:n,heights:y},g);a=new B(b,l+"path"+a);a.singleUse=!0;q.push(a);r.push([P._material]);a=L.identity();L.translate(a,u,a);v.push(a)}};var P=this;for(a=0;a<C.length;++a)d(a);if(0<q.length)return k=new y({geometries:q,materials:r,transformations:v,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:k},idHint:l}),k=new b(this,k,q,null,null,J,h),k.alignedTerrainElevation=e.terrainElevation,k.needsElevationUpdates=c.needsElevationUpdates3D(h.mode),k}return null};d.prototype._createExtrudeGeometry=
function(a,b,d){for(var e=a.length,c=new Uint32Array(e),f=0;f<e;f++)c[f]=0;e={};f={};e[I.POSITION]=a;e[I.NORMAL]=a;e[I.COLOR]=c;f[I.POSITION]={size:3,data:b.positions};f[I.NORMAL]={size:3,data:b.normals};f[I.COLOR]={size:4,data:d};f[I.SIZE]={size:1,data:b.heights};b.elevation&&(f.mapPos={size:3,data:b.elevation},e.mapPos=a);return new v(f,e)};return d}(a);var T=K.create(),V=K.create(),h=K.create(),ca=K.create(),Q=K.create(),e=K.create(),d=K.create(),g=K.create();return x})},"esri/views/3d/layers/graphics/Graphics3DTextSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../core/screenUtils ../../../../symbols/callouts/calloutUtils ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./ElevationAligners ./Graphics3DSymbolCommonCode ./graphicUtils ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/TextTexture ../../webgl-engine/materials/HUDMaterial".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){var D=[1,1,1,1],F=[0,0,1],G={mode:"relative-to-ground",offset:0},p=[0,0,0,1];return function(t){function r(){var a=null!==t&&t.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};return a}k(r,t);r.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=l.validateSymbolLayerSize(this._getTextSize());if(a){this._logWarning(a);this.reject();return}}this._anchor="center";this.resolve()};r.prototype.destroy=
function(){t.prototype.destroy.call(this);this.isFulfilled()||this.reject()};r.prototype.createGraphics3DGraphic=function(a,b,c,f){var l="polyline"===a.geometry.type,k=this._getGeometry(a);if(!k)return this._logWarning("unsupported geometry type for text symbol: "+a.geometry.type),null;var n=this._context.layer.id+"_label_"+a.uid,p=b.text||this.symbol.text;if(!p||1>p.length)return null;b&&null!=b.needsOffsetAdjustment&&(this._elevationOptions.needsOffsetAdjustment=b.needsOffsetAdjustment);var q=this.getGraphicElevationContext(a,
b.elevationOffset||0);return this._createAs3DShape(this.symbol,k,p,q,n,a.uid,b,c,f,l)};r.prototype.getGraphicElevationContext=function(a,b){void 0===b&&(b=0);a=t.prototype.getGraphicElevationContext.call(this,a);a.addOffsetRenderUnits(b);return a};r.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);return"polyline"===a.type?q.placePointOnPolyline(a):"polygon"===a.type?q.placePointOnPolygon(a):"extent"===a.type?a.center:"point"!==a.type?null:a};r.prototype.layerPropertyChanged=
function(a,b,c){if("opacity"===a)this._logWarning("layer opacity change not yet implemented in Graphics3DTextSymbolLayer");else if("elevationInfo"===a){this._updateElevationContext();if(b)for(var f in b){a=b[f];var l=c(a);l&&this.updateGraphicElevationContext(a.graphic,l)}return!0}return!1};r.prototype.updateGraphicElevationContext=function(a,b){a=this.getGraphicElevationContext(a,b.metadata.elevationOffset);b.elevationContext.set(a);b.needsElevationUpdates=q.needsElevationUpdates2D(a.mode)||"absolute-height"===
a.mode};r.prototype._defaultElevationInfoNoZ=function(){return G};r.prototype._createAs3DShape=function(l,k,t,r,z,A,x,G,R,S){var I=x.centerOffset||p,K=x.screenOffset||[0,0],h=x.debugDrawBorder||!1,J=x.translation||[0,0,0],L=x.anchor||this._anchor||"center";this._anchor=L;var e=l.material?a.toUnitRGBA(l.material.color):D,d=l.halo&&l.halo.color&&0<l.halo.size,g=d?a.toUnitRGBA(l.halo.color):D,d=d?b.pt2px(l.halo.size):0,m=this._getTextSize(l);l=new v(t,{size:m,color:e,font:{family:l.font&&l.font.family?
l.font.family:"Arial",weight:l.font&&l.font.weight?l.font.weight:"normal",style:l.font&&l.font.style?l.font.style:"normal"},halo:{size:d,color:g}},z);R=(e=R&&R.canHoldTextTexture(l))?R.addTextTexture(l):null;var u;G?u=x:c.isCalloutSupport(this.symbolContainer)&&this.symbolContainer.hasVisibleVerticalOffset()&&(u=this.symbolContainer);K={textureId:e?R.texture.getId():l.getId(),texCoordScale:e?[1,1]:l.getTexcoordScale(),occlusionTest:!0,screenOffset:K,anchorPos:L,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:x.centerOffsetUnits,
debugDrawBorder:h,drawInSecondSlot:!0};u&&u.verticalOffset&&(u=u.verticalOffset,h=u.minWorldLength,L=u.maxWorldLength,K.verticalOffset={screenLength:b.pt2px(u.screenLength),minWorldLength:h||0,maxWorldLength:null!=L?L:Infinity});this._context.screenSizePerspectiveEnabled&&(u=this._context.sharedResources,h=u.screenSizePerspectiveSettings,K.screenSizePerspective=u.screenSizePerspectiveSettingsLabels.overridePadding(d),K.screenSizePerspectiveAlignment=h);S&&(K.shaderPolygonOffset=1E-4);S=null;d=JSON.stringify(K);
null!=G?(S=G.getMaterial(d),null==S?(S=new w(K,z),G.addMaterial(d,S)):e&&S.setTextureDirty()):S=new w(K,z);S=[S];d=[l.getTextWidth(),l.getTextHeight()];I=B.createPointGeometry(F,J,void 0,d,I,R?R.uvMinMax:null);I=[new y(I,z)];z=q.createStageObjectForPoint.call(this,k,I,[S],null,null,r,z,this._context.layer.uid,A,!0);G=new n(this,z.object,I,null==G?S:null,e?null:[l],f.perObjectElevationAligner,r);G.alignedTerrainElevation=z.terrainElevation;G.needsElevationUpdates=q.needsElevationUpdates2D(r.mode)||
"absolute-height"===r.mode;var C=e?l.getTextWidth():l.getWidth(),M=e?l.getTextHeight():l.getHeight();G.getScreenSize=function(a){void 0===a&&(a=Array(2));a[0]=C;a[1]=M;return a};G.metadata={labelText:t,elevationOffset:x.elevationOffset||0};q.extendPointGraphicElevationContext(G,k,this._context.elevationProvider);return G};r.prototype._getTextSize=function(a){return b.pt2px((a||this.symbol).size)||12};return r}(t)})},"esri/views/3d/webgl-engine/lib/TextTexture":function(){define("require exports ./Texture ./Util ../../../webgl/Texture ../../../webgl/enums".split(" "),
function(x,r,k,a,b,c){function t(){var a=document.createElement("canvas");a.width=512;a.height=512;return a}function n(a){return"rgb("+a.slice(0,3).map(function(a){return Math.floor(255*a)}).toString()+")"}function f(a){return"rgba("+a.slice(0,3).map(function(a){return Math.floor(255*a)}).toString()+","+a[3]+")"}x=function(){function c(b,c,l,k){void 0===k&&(k=!0);this._idHint=l;this._text=b;this._textLines=b.split(/\r?\n/);this._params=c;this._haloSize=Math.round(this._params.halo.size);this._fillStyle=
f(this._params.color);this._haloStyle=n(this._params.halo.color);this._textWidth=this._computeTextWidth();this._lineHeight=this._computeLineHeight();this._textHeight=this._computeTextHeight();this._scaleFactor=k?Math.min(1,Math.min(2048/this._textWidth,2048/this._textHeight)):1;this._renderedWidth=Math.round(this._textWidth*this._scaleFactor);this._renderedHeight=Math.round(this._textHeight*this._scaleFactor);k&&a.assert(2048>=this._renderedWidth&&2048>=this._renderedHeight);this._width=a.nextHighestPowerOfTwo(this._renderedWidth);
this._height=a.nextHighestPowerOfTwo(this._renderedHeight)}c.prototype.getId=function(){null==this._id&&(this._id=k.idGen.gen(this._idHint));return this._id};c.prototype.getParams=function(){return this._params};c.prototype.getText=function(){return this._text};c.prototype.deferredLoading=function(){return!1};c.prototype.getWidth=function(){return this._width};c.prototype.getHeight=function(){return this._height};c.prototype.getTextWidth=function(){return this._textWidth};c.prototype.getTextHeight=
function(){return this._textHeight};c.prototype.getRenderedWidth=function(){return this._renderedWidth};c.prototype.getRenderedHeight=function(){return this._renderedHeight};c.prototype.initializeThroughRender=function(a,c){var f=this._getTextCanvas();f.width=this._width;f.height=this._height;var l=f.getContext("2d");l.save();c.samplingMode=9987;c.wrapMode=33071;c.flipped=!0;c.preMultiplyAlpha=!0;c.hasMipmap=!0;this.renderText(this._renderedWidth,this._renderedHeight,l,0,this._height-this._renderedHeight);
a=new b(a,c,f);l.restore();return a};c.prototype.getTexcoordScale=function(){return[this._renderedWidth/this._width,this._renderedHeight/this._height]};c.prototype.setUnloadFunc=function(a){this._unloadFunc=a};c.prototype.unload=function(){this._unloadFunc&&(this._unloadFunc(this._id),this._unloadFunc=null)};c.prototype.renderText=function(a,b,c,f,l){void 0===f&&(f=0);void 0===l&&(l=0);b=this._lineHeight*this._scaleFactor;var k=this._haloSize,n=c.textAlign;a=("center"===n?.5*a:"right"===n?a:0)+k;
c.save();var p=3>k;if(0<k){var n=k,t=this._getHaloCanvas();t.width=Math.max(512,this._renderedWidth);t.height=Math.max(512,this._renderedHeight);var r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);this._setFontProperties(r,this._params.size*this._scaleFactor);r.fillStyle=this._haloStyle;r.strokeStyle=this._haloStyle;r.lineJoin=p?"miter":"round";if(p)for(var v=0,y=this._textLines;v<y.length;v++){for(var p=y[v],w=0,B=q;w<B.length;w++){var D=B[w];r.fillText(p,a+k*D[0],k+k*D[1])}n+=b}else for(v=
0,y=this._textLines;v<y.length;v++){p=y[v];w=2*k;for(B=0;5>B;B++)r.lineWidth=(.6+.1*B)*w,r.strokeText(p,a,n);n+=b}c.globalAlpha=this._params.halo.color[3];c.drawImage(t,f,l);t.width=512;t.height=512;c.globalAlpha=1}this._setFontProperties(c,this._params.size*this._scaleFactor);n=l+k;l=0;for(k=this._textLines;l<k.length;l++)p=k[l],c.globalCompositeOperation="destination-out",c.fillStyle="rgb(0, 0, 0)",c.fillText(p,f+a,n),c.globalCompositeOperation="source-over",c.fillStyle=this._fillStyle,c.fillText(p,
f+a,n),n+=b;c.restore()};c.preferredAtlasSize=function(){return 512};c.prototype._getTextCanvas=function(){null==c._textCanvas2D&&(c._textCanvas2D=t());return c._textCanvas2D};c.prototype._getHaloCanvas=function(){null==c._haloCanvas2D&&(c._haloCanvas2D=t());return c._haloCanvas2D};c.prototype._setFontProperties=function(a,b){var c=this._params.font;a.font=c.style+" "+c.weight+" "+b+"px "+c.family;a.textAlign="left";a.textBaseline="top"};c.prototype._computeTextWidth=function(){var a=this._getTextCanvas().getContext("2d");
this._setFontProperties(a,this._params.size);for(var b=0,c=0,f=this._textLines;c<f.length;c++){var l=a.measureText(f[c]).width;l>b&&(b=l)}c=this._params.font;if("italic"===c.style||"oblique"===c.style||"string"===typeof c.weight&&("bold"===c.weight||"bolder"===c.weight)||"number"===typeof c.weight&&600<c.weight)b+=.3*a.measureText("A").width;b+=2*this._haloSize;return b=Math.round(b)};c.prototype._computeLineHeight=function(){return Math.floor(1.275*this._params.size+2*this._haloSize)};c.prototype._computeTextHeight=
function(){return this._computeLineHeight()*this._textLines.length};return c}();var q=[];for(r=0;360>r;r+=22.5)q.push([Math.cos(Math.PI*r/180),Math.sin(Math.PI*r/180)]);return x})},"esri/views/3d/layers/graphics/Graphics3DPointSymbol":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./Graphics3DSymbol","./Graphics3DCalloutSymbolLayerFactory"],function(x,r,k,a,b){return function(a){function c(c,f,k){c=a.call(this,c,f,k)||this;c.calloutSymbolLayer=null;c.symbol.hasVisibleCallout()&&
(c.calloutSymbolLayer=b.make(c.symbol,f));return c}k(c,a);c.prototype.destroy=function(){a.prototype.destroy.call(this)};c.prototype.createGraphics3DGraphic=function(b,c,k){k=a.prototype.createGraphics3DGraphic.call(this,b,c,k);this.calloutSymbolLayer&&(b=this.createCalloutGraphic(b,c))&&k.addAuxiliaryGraphic(b);return k};c.prototype.layerPropertyChanged=function(b,c){var f=this;return a.prototype.layerPropertyChanged.call(this,b,c)?this.calloutSymbolLayer?this.calloutSymbolLayer.layerPropertyChanged(b,
c,function(a){var b=0;for(a=a._auxiliaryGraphics;b<a.length;b++){var c=a[b];if(c.graphics3DSymbolLayer===f.calloutSymbolLayer)return c}}):!0:!1};c.prototype.createCalloutGraphic=function(a,b){return this.calloutSymbolLayer.createGraphics3DGraphic(a,{renderer:b.renderer,symbol:b.symbol,needsOffsetAdjustment:b.needsOffsetAdjustment,translation:[0,0,0],centerOffset:[0,0,0,0],screenOffset:[0,0],centerOffsetUnits:"world",elevationOffset:0,materialCollection:null})};return c}(a)})},"esri/views/3d/layers/graphics/Graphics3DCalloutSymbolLayerFactory":function(){define(["require",
"exports","../../../../core/Logger","../../../../symbols/callouts/calloutUtils","./Graphics3DLineCalloutSymbolLayer"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});var c=k.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory");r.make=function(b,f){if(!a.isCalloutSupport(b))return c.error("Graphics3DCalloutSymbolLayerFactory#make","symbol of type '"+b.type+"' does not support callouts"),null;if(!b.callout)return null;var k=t[b.callout.type];return k?new k(b,
f):(c.error("Graphics3DCalloutSymbolLayerFactory#make","unknown or unsupported callout type "+b.callout.type),null)};var t={line:b}})},"esri/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DSymbolLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./ElevationAligners ../../../../core/screenUtils ../../../../Color ../../../../geometry/Polygon ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Util ../../webgl-engine/lib/GeometryData ../../webgl-engine/materials/LineCalloutMaterial".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w){var D=B.VertexAttrConstants;x=function(a){function r(b,c){b=a.call(this,b,null,c,!0)||this;b._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};return b}k(r,a);r.prototype.destroy=function(){a.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(l.ModelContentType.MATERIAL,this._material.getId()),this._material=null)};r.prototype._prepareResources=function(){var a=this._getStageIdHint();
this._createMaterialsAndAddToStage(this._context.stage,a);this.resolve()};r.prototype.perInstanceMaterialParameters=function(a){var b=this.materialParameters;b.screenOffset=a.screenOffset||[0,0];b.centerOffsetUnits=a.centerOffsetUnits||"world";return b};Object.defineProperty(r.prototype,"materialParameters",{get:function(){var a=this.symbolContainer,b=a.callout,c=f.toUnitRGBA(b.color);c[3]*=this._getLayerOpacity();var l=n.pt2px(b.size||0),k=null;if(a.verticalOffset)var k=a.verticalOffset,p=k.minWorldLength,
q=k.maxWorldLength,k={screenLength:n.pt2px(k.screenLength),minWorldLength:p||0,maxWorldLength:null!=q?q:Infinity};b=b.border&&b.border.color?f.toUnitRGBA(b.border.color):null;p="object"===a.symbolLayers.getItemAt(0).type;return{color:c,size:l,verticalOffset:k,screenSizePerspective:this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,screenOffset:[0,0],centerOffsetUnits:"world",borderColor:b,occlusionTest:!p,shaderPolygonOffset:p?0:void 0,depthHUDAlignStart:"label-3d"===
a.type}},enumerable:!0,configurable:!0});r.prototype._createMaterialsAndAddToStage=function(a,b){this._material=new w(this.materialParameters,b+"_lineCallout_common");a.add(l.ModelContentType.MATERIAL,this._material)};r.prototype._defaultElevationInfoNoZ=function(){return z};r.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);if("extent"===a.type)return c.placePointOnPolygon(q.fromExtent(a));if("polyline"===a.type)return c.placePointOnPolyline(a);if("polygon"===a.type)return c.placePointOnPolygon(a);
if("point"===a.type)return a;this._logWarning("unsupported geometry type for point symbol: "+a.type);return null};r.prototype.createGraphics3DGraphic=function(a,b){null!=b.needsOffsetAdjustment&&(this._elevationOptions.needsOffsetAdjustment=b.needsOffsetAdjustment);var c=this.getGraphicElevationContext(a,b.elevationOffset||0),f=b.symbol,l="on-the-ground"===this._elevationContext.mode&&!f.symbolLayers.some(function(a){return"object"===a.type||"text"===a.type});if("label-3d"!==f.type&&l)return null;
f=this._getGeometry(a);return null===f?null:this._createAs3DShape(a,f,c,b,"graphic"+a.uid,a.uid)};r.prototype.layerPropertyChanged=function(a,b,c){switch(a){case "opacity":return this.layerOpacityChanged(b,c);case "elevationInfo":return this.layerElevationInfoChanged(b,c)}return!1};r.prototype.layerOpacityChanged=function(a,b){this._material.setParameterValues(this.materialParameters);return!0};r.prototype.layerElevationInfoChanged=function(a,b){var c=this._elevationContext.mode;this._updateElevationContext();
var f=this._elevationContext.mode;if(c!==f&&("on-the-ground"===c||"on-the-ground"===f))return!1;for(var l in a)c=a[l],(f=b(c))&&this.updateGraphicElevationContext(c.graphic,f);return!0};r.prototype.getGraphicElevationContext=function(b,c){void 0===c&&(c=0);b=a.prototype.getGraphicElevationContext.call(this,b);b.addOffsetRenderUnits(c);return b};r.prototype.updateGraphicElevationContext=function(a,b){a=this.getGraphicElevationContext(a,b.metadata.elevationOffset);b.elevationContext.set(a);b.needsElevationUpdates=
c.needsElevationUpdates2D(a.mode)};r.prototype.createVertexData=function(a){var b=a.translation;a=a.centerOffset;if(!b&&!a)return F;b=b?{size:3,data:[b[0],b[1],b[2]]}:F[D.POSITION];a=a?{size:4,data:[a[0],a[1],a[2],a[3]]}:F[D.AUXPOS1];return c={},c[D.POSITION]=b,c[D.NORMAL]=F[D.NORMAL],c[D.AUXPOS1]=a,c;var c};r.prototype.getOrCreateMaterial=function(a,b){var c=this.perInstanceMaterialParameters(a),f=w.uniqueMaterialIdentifier(c);if(f===this._material.uniqueMaterialIdentifier)return{material:this._material,
isUnique:!1};if(a.materialCollection){var l=a.materialCollection.getMaterial(f);l||(l=new w(c,b+"_lineCallout_shared"),a.materialCollection.addMaterial(f,l));return{material:l,isUnique:!1}}l=new w(c,b+"_lineCallout_unique");return{material:l,isUnique:!0}};r.prototype._createAs3DShape=function(a,f,l,k,n,q){a=new v(this.createVertexData(k),p,v.DefaultOffsets,"point");a=[new y(a,n)];var r=this.getOrCreateMaterial(k,n);n=c.createStageObjectForPoint.call(this,f,a,[[r.material]],null,null,l,n,this._context.layer.uid,
q,!0);if(null===n)return null;q=new b(this,n.object,a,r.isUnique?[r.material]:null,null,t.perObjectElevationAligner,l);q.metadata={elevationOffset:k.elevationOffset||0};q.alignedTerrainElevation=n.terrainElevation;q.needsElevationUpdates=c.needsElevationUpdates2D(l.mode);c.extendPointGraphicElevationContext(q,f,this._context.elevationProvider);return q};return r}(a);var F=(G={},G[D.POSITION]={size:3,data:[0,0,0]},G[D.NORMAL]={size:3,data:[0,0,1]},G[D.AUXPOS1]={size:4,data:[0,0,0,1]},G),G=new Uint32Array([0]),
p=(A={},A[D.POSITION]=G,A[D.NORMAL]=G,A[D.AUXPOS1]=G,A),z={mode:"relative-to-ground",offset:0},G,A;return x})},"esri/views/3d/layers/graphics/Graphics3DOwner":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});x=function(){return function(){this.featureExpressionInfoContext=this.localOriginFactory=this.layerView=this.layer=this.overlaySR=this.renderCoordsHelper=this.renderSpatialReference=this.clippingExtent=this.layerOrderDelta=this.layerOrder=
this.stage=this.renderer=this.elevationProvider=this.streamDataSupplier=this.sharedResources=null;this.screenSizePerspectiveEnabled=!0}}();r.Graphics3DSymbolCreationContext=x})},"esri/views/3d/layers/graphics/ElevationQuery":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper dojo/Deferred dojo/_base/lang ../../../../core/Scheduler ../../../../geometry/Multipoint".split(" "),function(x,r,k,a,b,c,t,n){Object.defineProperty(r,"__esModule",
{value:!0});x=function(){function f(a,b,f){this.spatialReference=a;this._getElevationQueryProvider=b;this._queries=[];this._isScheduled=!1;this._queryOptions=c.mixin({},f,{ignoreInvisibleLayers:!0})}f.prototype.queryElevation=function(c,f){return a(this,void 0,void 0,function(){var a;return k(this,function(l){a=new b;this._queries.push({x:c,y:f,result:a});this._scheduleDoQuery();return[2,a.promise]})})};f.prototype._scheduleDoQuery=function(){var a=this;this._isScheduled||(t.schedule(function(){return a._doQuery()}),
this._isScheduled=!0)};f.prototype._doQuery=function(){return a(this,void 0,void 0,function(){var a,b,c,f,t,r,D;return k(this,function(l){switch(l.label){case 0:this._isScheduled=!1;a=this._queries;this._queries=[];b=a.map(function(a){return[a.x,a.y]});c=new n({points:b,spatialReference:this.spatialReference});f=this._getElevationQueryProvider();if(!f)return a.forEach(function(a,b){return a.result.reject()}),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,f.queryElevation(c,this._queryOptions)];
case 2:return t=l.sent(),[3,4];case 3:return r=l.sent(),a.forEach(function(a){return a.result.reject(r)}),[2];case 4:return D=t.geometry.points,a.forEach(function(a,b){return a.result.resolve(D[b][2])}),[2]}})})};return f}();r.ElevationQuery=x})},"esri/views/3d/layers/graphics/Graphics3DSpatialIndex":function(){define("require exports dojo/Deferred ../../../../processors/SpatialIndex ../../../../geometry/SpatialReference ../../../../geometry/support/webMercatorUtils".split(" "),function(x,r,k,a,b,
c){return function(){function t(){var b=this;this.spatialIndex=new a;this.spatialIndexNumPendingQueries=this.spatialIndexNumGraphics=0;this.graphicsCore=this.viewSR=this.layer=this.layerView=null;this._readyDfd=new k;var c=function(a){return a.workerClient&&a.workerClient.worker};if(c(this.spatialIndex))this._readyDfd.resolve();else this.spatialIndex.on("start",function(){c(b.spatialIndex)&&b._readyDfd.resolve()})}t.prototype.initialize=function(a,b,c,l){this.layerView=a;this.layer=b;this.viewSR=
c;this.graphicsCore=l};t.prototype.destroy=function(){this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.graphicsCore=this.layerView=this.viewSR=null};t.prototype.numNodesUpdating=function(){return 0};t.prototype.isUpdating=function(){return 0<this.spatialIndexNumPendingQueries};t.prototype.hasGraphics=function(){return 0<this.spatialIndexNumGraphics};t.prototype.intersects=function(a,b,c){var f=this;this.hasGraphics()?(this.spatialIndexNumPendingQueries++,this.spatialIndex.intersects(a,
void 0,void 0,!0).then(function(a){f.spatialIndexNumPendingQueries--;c(a.results,a.results.length);f.layerView._evaluateUpdatingState()})):c([],0)};t.prototype.shouldAddToSpatialIndex=function(a,b,c){return c||b.needsElevationUpdates()};t.prototype.addGraphicsToSpatialIndex=function(a){if(this.layerView.loadedGraphics)for(var b=this.layerView.loadedGraphics.toArray(),c=b.length,l=0;l<c;l++){var k=b[l],n=this.graphicsCore.getGraphics3DGraphicById(k.uid);n&&!n.addedToSpatialIndex&&this.shouldAddToSpatialIndex(k,
n,a)&&this.addGraphicToSpatialIndex(k,n)}};t.prototype.addGraphicToSpatialIndex=function(a,f){var k=a.geometry.spatialReference,l=this.viewSR,n={id:a.uid,geometry:null};if(k.equals(l))n.geometry=a.geometry.toJSON();else{var t=void 0;if(k.wkid===b.WGS84.wkid&&l.isWebMercator)t=c.geographicToWebMercator(a.geometry);else if(k.isWebMercator&&l.wkid===b.WGS84.wkid)t=c.webMercatorToGeographic(a.geometry);else return console.warn("Cannot convert graphic geometry to map spatial reference, elevation and scale updates are disabled"),
!1;n.geometry=t.toJSON()}this.spatialIndexNumGraphics++;this.spatialIndex.runProcess([n],this.layer.id);return f.addedToSpatialIndex=!0};t.prototype.whenLoaded=function(){return this._readyDfd.promise};return t}()})},"esri/processors/SpatialIndex":function(){define("../core/declare dojo/Deferred dojo/_base/lang ./Processor ../workers/WorkerClient ../layers/FeatureLayer".split(" "),function(x,r,k,a,b,c){return x([a],{declaredClass:"esri.processors.SpatialIndex",index:null,indexType:"rtree",autostart:!1,
constructor:function(a){a=a||{};var c=!1!==a.autostart;k.mixin(this,a);this.workerCallback=["./scripts/helpers","./scripts/indexInterface","./indexWorker"];if(!this.fetchWithWorker){var f=this;this.workerClient=new b("./mutableWorker",function(a){this.workerClient=a;this.workerCallback.push("./libs/"+this.indexType);this.workerClient.importScripts(this.workerCallback).then(function(){f._attachedSystem=!0;c&&f.start()})}.bind(this))}this._featCache={}},destroy:function(){this.workerClient&&this.workerClient.terminate()},
addLayer:function(a,b){if(a.graphics&&a.graphics.length||b||a.isInstanceOf(c)){var f=this.workerClient;if(!this._attachedSystem&&f.worker){var k=this;this.inherited(arguments,[a,!0]);f.importScripts("./libs/"+this.indexType).then(function(){k.runProcess(a.graphics,a.id);k._attachedSystem=!0})}else this.inherited(arguments,[a])}},unsetMap:function(){this.stop();this.workerClient.terminate();this.fetchWithWorker||(this.workerClient=new b(this.workerCallback,function(){}));this.inherited(arguments);
this.start()},removeLayer:function(a){this.inherited(arguments)},runProcess:function(a,b){if(a&&a.length){var c=this,k=this.workerClient,l=a[0]._graphicsLayer;b||0===b||(b=l?l.id:"rawFeatures_"+Object.keys(this._featCache).length);this._featCache[b]||(this._featCache[b]={});for(var n,t,r=[],w=a.length,D=l&&l.objectIdField;w--;)t=a[w],n=t.attributes&&D?t.attributes[D]:t.id,null!=n&&this._featCache[b][n]||(this._featCache[b][n]=1,t.declaredClass?r.push({id:n,geometry:t.geometry.toJSON(!0),attributes:t.attributes}):
r.push(t));0!==r.length&&(k.postMessage({insert:r,system:this.indexType,options:this.indexOptions,idField:l&&l.objectIdField,layerId:b}).then(function(a){l&&l.emit("process-end",{processor:c,results:{insert:a.insert}})}),l&&l.emit("process-start",{processor:this}))}},_sendFeaturesFromLayer:function(a,b){b=b.graphic;var c=this.workerClient,k=this,l=b.attributes[a.objectIdField];this._featCache[a.id]||(this._featCache[a.id]={});this._featCache[a.id][l]||(this._featCache[a.id][l]=1,c.postMessage({insert:[{attributes:b.attributes,
geometry:b.geometry.toJSON(!0)}],system:this.indexType,options:this.indexOptions,idField:a.objectIdField,layerId:a.id}).then(function(b){a.emit("process-end",{processor:k,results:{insert:b.insert}})}),a.emit("process-start",{processor:k}))},_notifyProcessStart:function(a,b){},_sendFeaturesFromTask:function(a,b){b=b.featureSet.features;var c=[],k=this.workerClient,l=this,n=b.length,t,r;for(this._featCache[a.id]||(this._featCache[a.id]={});n--;)r=b[n],t=r.attributes[a.objectIdField],this._featCache[a.id][t]||
(this._featCache[a.id][t]=1,c.push(r));k.postMessage({insert:c,system:this.indexType,options:this.indexOptions,idField:a.objectIdField,layerId:a.id}).then(function(b){a.emit("process-end",{processor:l,results:{insert:b.insert}})});a.emit("process-start",{processor:l})},get:function(){},intersects:function(a,b,c,k){return"rtree"!=this.indexType?(console.error("Index.intersects only works with rtree indexes"),a=new r,a.reject({message:"Index.intersects only works with rtree indexes"}),a.promise):this.workerClient.postMessage({search:a,
layerId:b,returnNode:c,onlyIds:k})},within:function(a,b,c){if("rtree"!=this.indexType)return console.error("Index.within only works with rtree indexes"),a=new r,a.reject({message:"Index.within only works with rtree indexes"}),a.promise},nearest:function(a){return"kdtree"!=this.indexType?(console.error("Index.nearest only works with kdtree indexes"),a=new r,a.reject({message:"Index.nearest only works with kdtree indexes"}),a.promise):this.workerClient.postMessage({search:a})}})})},"esri/processors/Processor":function(){define("../core/sniff ../core/declare dojo/_base/lang dojo/_base/array dojo/Evented ../workers/RequestClient ../layers/GraphicsLayer".split(" "),
function(x,r,k,a,b,c,t){return r([b],{declaredClass:"esri.processors.Processor",layers:null,results:null,passFeatures:!0,drawFeatures:!0,requireWorkerSupport:!0,fetchWithWorker:!1,workerCallback:null,workerClient:null,_started:null,_handlers:null,constructor:function(a){a=a||{};k.mixin(this,a);x("esri-workers")||!1===this.requireWorkerSupport&&!1===a.requireWorkerSupport?(this._handlers={},this._notifyProcessStart=k.hitch(this,this._notifyProcessStart),this._sendFeaturesFromTask=k.hitch(this,this._sendFeaturesFromTask),
this._sendFeaturesFromLayer=k.hitch(this,this._sendFeaturesFromLayer),!1!==a.autostart&&this.start()):(console.log("Browser doesn't support workers \x26 worker support is required for this processor"),this.addLayer=this.setMap=this.start=this.runProcess=function(){},this._disabled=!0)},addLayer:function(a,b){var f=a._task,l=this._handlers[a.id]=[],n="complete";!1===this.drawFeatures&&(a._params.drawMode=!1);this.fetchWithWorker?(this.workerClient||(this.workerClient=c.getClient(this.workerCallback)),
f.requestOptions={workerOptions:{worker:this.workerClient}},this.passFeatures&&l.push(f.on(n,k.partial(this._notifyProcessStart,a)))):this.passFeatures?(n=this.drawFeatures?"graphic-draw":"graphic-add",l.push(a.on(n,k.partial(this._sendFeaturesFromLayer,a)))):l.push(f.on(n,k.partial(this._sendFeaturesFromTask,a)));!0!==b&&a.graphics&&this.runProcess(a.graphics,a.id)},removeLayer:function(b){a.forEach(this._handlers[b.id],function(a){a.remove()});delete this._handlers[b.id]},setMap:function(b){if(this.map)if(b!=
this.map)this.unsetMap();else return;var c=this;a.forEach(this.layers,c.removeLayer);a.forEach(b.graphicsLayerIds,function(a){c.addLayer(b.findLayerById(a))});this._handlers.map=[b.on("layer-add",function(a){a=a.layer;a.isInstanceOf(t)&&c.addLayer(a)}),b.on("layer-remove",function(a){a=a.layer;a.isInstanceOf(t)&&c.removeLayer(a)})];this.map=b},unsetMap:function(){this.map&&(a.forEach(this._handlers.map,function(a){a.remove()}),delete this._handlers.map,a.forEach(this.layers,this.removeLayer),this.map=
null)},start:function(){this.map?this.setMap(this.map):this.layers&&(k.isArray(this.layers)||(this.layers=[this.layers]),a.forEach(this.layers,this.addLayer));this._started=!0;this.emit("start",{processor:this});console.log("processor started")},stop:function(){this._started=!1;for(var a in this._handlers)this._handlers.hasOwnProperty(a)&&(this._handlers[a].remove(),delete this._handlers[a]);this.emit("stop",{processor:this});console.log("processor stopped")},runProcess:function(a,b){},_sendFeaturesFromTask:function(){},
_sendFeaturesFromLayer:function(){},_notifyProcessStart:function(){}})})},"esri/workers/RequestClient":function(){define(["../core/declare","dojo/_base/xhr","../config","./WorkerClient"],function(x,r,k,a){function b(a,b){var f=new c;f.addWorkerCallback(a,b);t.unshift({id:b?a+"::"+b:a,client:f});t.length>n&&t.pop().client.terminate();return f}var c=x([a],{declaredClass:"esri.workers.RequestClient",constructor:function(){this.setWorker(["./mutableWorker","./requestWorker"],function(){})},get:function(a){return this._send("GET",
a)},post:function(a){return this._send("POST",a)},_send:function(a,b){b=r._ioSetArgs(b);b.xhr=null;var c=b.ioArgs,f=c.url;delete c.url;delete c.args;this.postMessage({method:a,url:f,options:c}).then(this._getSuccessHandler(b),this._getErrorHandler(b),this._getProgressHandler(b));return b},_addHeaderFunctions:function(a){a.getResponseHeader=function(b){var c,f=a.headers;Object.keys(f).forEach(function(a){if(a.toLowerCase()==b.toLowerCase())return c=f[a],!1});return c};a.getAllResponseHeaders=function(){var b=
[],c=a.headers;Object.keys(c).forEach(function(a){b.push(a+": "+c[a])});return b=b.join("\n")};return a},_getSuccessHandler:function(a){var b=this,c=a.ioArgs;return function(f){a.xhr=b._addHeaderFunctions(f);f=a.xhr.getResponseHeader("content-type");("xml"==c.handleAs||-1<f.indexOf("xml"))&&"string"==typeof a.xhr.response&&(a.xhr.response=(new DOMParser).parseFromString(a.xhr.response,"text/xml"));a.resolve(a.xhr.response,a.xhr)}},_getErrorHandler:function(a){return function(b){a.reject(b)}},_getProgressHandler:function(a){return function(b){a.progress(b)}}}),
t=[],n=k.request.maxWorkers,f=new c;c.getClient=function(a,c){if(a){var l;t.some(function(b){b.id==(c?a+"::"+c:a)&&(l=b.client);return!0});return l||b(a,c)}return f};c.setLimit=function(a){n=k.request.maxWorkers=a};return c})},"esri/workers/WorkerClient":function(){define("dojo/Evented ../core/declare dojo/Deferred dojo/_base/lang dojo/request ../core/sniff ../core/urlUtils require".split(" "),function(x,r,k,a,b,c,t,n){var f=window.Blob||window.webkitBlob||window.mozBlob,q=window.URL||window.webkitURL||
window.mozURL;return r([x],{declaredClass:"esri.workers.WorkerClient",worker:null,_queue:null,constructor:function(b,f){this._isIE=c("ie");this._queue={};this._acceptMessage=a.hitch(this,this._acceptMessage);this._errorMessage=a.hitch(this,this._errorMessage);b&&this.setWorker(b,function(a){this.worker=a;f(this)}.bind(this))},setWorker:function(a,b){if(a instanceof Array){var c=a;a=c.shift()}var l=this._getUrl(a),l=t.normalize(l);a=!t.hasSameOrigin(l,location.href);var k;if(!1===l)return console.log("Can not resolve worker path"),
!1;this.worker&&(k=this.worker,k.removeEventListener("message",this._acceptMessage,!1),k.removeEventListener("error",this._errorMessage,!1),k.terminate(),k=null);if(a){a=this._getUrl("./mutableWorker",!0);try{this._getRemoteText(a,function(a){a=q.createObjectURL(new f([a],{type:"text/javascript"}));b(this._createWorker(a,l))}.bind(this))}catch(D){try{a=t.getProxyUrl(a).path+"?"+encodeURI(a),this._useProxy=!0,b(this._createWorker(a,c))}catch(F){return console.log("Can not create worker"),!1}}}else b(this._createWorker(l,
c))},_createWorker:function(a,b){a=new Worker(a);a.addEventListener("message",this._acceptMessage,!1);a.addEventListener("error",this._errorMessage,!1);this.worker=a;b&&this.importScripts(b);return a},postMessage:function(a,b){if(a instanceof Array||"object"!=typeof a)a={data:a};var c=Math.floor(64E9*Math.random()).toString(36);a.msgId=c;c=this._queue[c]=new k;this.worker?(b?this.worker.postMessage(a,b):this.worker.postMessage(a),this.emit("start-message",{target:this,message:a})):c.reject({message:"No worker was set."});
return c.promise},terminate:function(){var a=Object.keys(this._queue);this.worker&&this.worker.terminate();for(var b=a.length-1;0<=b;b--)this._queue[a[b]].cancel("terminated"),delete this._queue[a[b]]},addWorkerCallback:function(b,c){var f=this._getUrl(b,!0);return!1===f?(c=new k,c.reject({message:"Could not load text from "+b}),c.promise):this.postMessage({action:"add-callback",url:f,cbName:c||"main"}).then(a.hitch(this,function(a){a.target=this;this.emit("callback-added",a)}))},importScripts:function(b){Array.isArray(b)||
(b=[b]);b=b.map(function(a){a=this._getUrl(a,!0);this._useProxy&&!t.hasSameOrigin(a,location.href)&&(a=t.getProxyUrl(a).path+"?"+encodeURI(a));return a},this);return this.postMessage({action:"import-script",url:b}).then(a.hitch(this,function(a){a.target=this;this.emit("scripts-imported",a)}))},_acceptMessage:function(a){var b=a.data,c=b.msgId;if(b.status&&"debug"==b.status)console[b.showAs||"debug"](b);else if(c&&c in this._queue){var f=this._queue[c];"progress"==b.status?f.progress(a.data):("error"==
b.status?f.reject(a.data):f.resolve(a.data),delete this._queue[c])}this.emit("message",{message:a.data,event:a,target:this})},_errorMessage:function(a){this.onerror||this.onError?this.onerror?this.onerror(a):this.onError(a):console.log("Worker Error: "+a.message+"\nIn "+a.filename+" on "+a.lineno)},_getUrl:function(a,b){if(!a)return console.error("can not resolve empty path"),!1;a.match(/\.js$/)||(a+=".js");a=n.toUrl(a);return b?t.makeAbsolute(a):a},_getRemoteText:function(a,c){(a=this._getUrl(a))&&
b.get(a,{sync:!1,handleAs:"text",headers:{"X-Requested-With":"","Content-Type":"text/plain"}}).then(function(a){c(a)})},_startBlobWorker:function(){var a=this._xdSource;a||(a=this._getUrl("./mutableWorker"),a=new f(["if(!self._mutable){importScripts('"+a+"');}"],{type:"text/javascript"}),a=this._xdSource=q.createObjectURL(a));try{return new Worker(a)}catch(y){return console.log(y.message),!1}}})})},"esri/layers/GraphicsLayer":function(){define("../core/Accessor ../core/Collection ../core/promiseUtils ./Layer ./mixins/ScaleRangeLayer ../Graphic dojo/_base/lang".split(" "),
function(x,r,k,a,b,c,t){var n=x.createSubclass({properties:{layer:null,layerView:null,graphics:null}});return a.createSubclass([b],{declaredClass:"esri.layers.GraphicsLayer",viewModulePaths:{"2d":"../views/2d/layers/GraphicsLayerView2D","3d":"../views/3d/layers/FeatureLayerView3D"},getDefaults:function(a){return t.mixin(this.inherited(arguments),{graphics:[]})},destroy:function(){this.removeAll()},_gfxHdl:null,properties:{elevationInfo:null,graphics:{type:r.ofType(c),set:function(a){var b=this._get("graphics");
b||(a.forEach(function(a){a.layer=this},this),this._gfxHdl=a.on("change",function(a){var b,c,f;f=a.added;for(b=0;c=f[b];b++)c.layer=this;f=a.removed;for(b=0;c=f[b];b++)c.layer=null}.bind(this)),this._set("graphics",a),b=a);b.removeAll();b.addMany(a)}},screenSizePerspectiveEnabled:!0,type:{readOnly:!0,value:"graphics"}},add:function(a){this.graphics.add(a);return this},addMany:function(a){this.graphics.addMany(a);return this},removeAll:function(){this.graphics.removeAll();return this},createGraphicsController:function(a){return k.resolve(new n({layer:this,
layerView:a.layerView,graphics:this.graphics}))},remove:function(a){this.graphics.remove(a)},removeMany:function(a){this.graphics.removeMany(a)},graphicChanged:function(a){this.emit("graphic-update",a)}})})},"esri/views/3d/layers/graphics/Graphics3DElevationAlignment":function(){define(["require","exports","../../../../core/throttle","../../support/aaBoundingRect"],function(x,r,k,a){return function(){function b(){this.dirtyExtent=a.create(a.NEGATIVE_INFINITY);this.numPendingSpatialIndexQueries=0;
this.elevationDirtyGraphicsQueue=[];this.elevationDirtyGraphicsSet={};this.elevationUpdateEventHandle=null;this.eventHandles=[];this.updateElevation=!1;this.graphicsCore=this.layerView=null;this.markDirtyThrottled=k.throttle(this.markDirty,100,this)}b.prototype.initialize=function(a,b,k,f){var c=this;this.layerView=a;this.graphicsCore=k;this.elevationProvider=f;this.getGraphicsInExtent=b;this.elevationUpdateEventHandle=f.on("elevation-change",function(a){return c.elevationUpdateHandler(a)});this.eventHandles.push(this.layerView.watch("suspended",
function(){return c.suspendedChange()}))};b.prototype.destroy=function(){this.elevationDirtyGraphicsSet=this.elevationDirtyGraphicsQueue=null;this.elevationUpdateEventHandle&&(this.elevationUpdateEventHandle.remove(),this.elevationUpdateEventHandle=null);this.eventHandles.forEach(function(a){return a.remove()});this.eventHandles=null;this.markDirtyThrottled.remove();this.getGraphicsInExtent=this.graphicsCore=this.layerView=null};b.prototype.clear=function(){this.elevationDirtyGraphicsSet={};this.elevationDirtyGraphicsQueue=
[]};b.prototype.suspendedChange=function(){!0===this.layerView.suspended?this.updateElevation=!1:!1===this.layerView.suspended&&this.updateElevation&&this.markAllGraphicsElevationDirty()};b.prototype.isUpdating=function(){return 0<this.elevationDirtyGraphicsQueue.length||this.markDirtyThrottled.hasPendingUpdates()||0<this.numPendingSpatialIndexQueries};b.prototype.numNodesUpdating=function(){return this.elevationDirtyGraphicsQueue.length};b.prototype.needsIdleUpdate=function(){return this.elevationProvider&&
0<this.elevationDirtyGraphicsQueue.length};b.prototype.idleUpdate=function(a){if(!a.done()){var b=this.layerView.view,c=this.elevationDirtyGraphicsQueue.length;if(0<c){for(var f=this.graphicsCore.stageLayer.getId(),k=this.graphicsCore.labelStageLayer?this.graphicsCore.labelStageLayer.getId():null,l=0,r=0,r=0;r<c;r++){var B=this.elevationDirtyGraphicsQueue[r],v=this.graphicsCore.graphics[B];v&&v.alignWithElevation(this.elevationProvider,b.renderCoordsHelper);delete this.elevationDirtyGraphicsSet[B];
l++;if(20<=l){b._stage.processDirtyLayer(f);null!=k&&b._stage.processDirtyLayer(k);if(a.done())break;l=0}}b._stage.processDirtyLayer(f);null!=k&&b._stage.processDirtyLayer(k);this.elevationDirtyGraphicsQueue.splice(0,r+1);b.deconflictor.setDirty();this.layerView._evaluateUpdatingState()}}};b.prototype.markAllGraphicsElevationDirty=function(){for(var a in this.graphicsCore.graphics)this.markGraphicElevationDirty(this.graphicsCore.graphics[a].graphic.uid);this.layerView._evaluateUpdatingState()};b.prototype.markGraphicElevationDirty=
function(a){this.elevationDirtyGraphicsSet[a]||(this.elevationDirtyGraphicsSet[a]=!0,this.elevationDirtyGraphicsQueue.push(a))};b.prototype.elevationUpdateHandler=function(b){var c=b.extent;this.layerView.suspended?this.updateElevation||(b=this.graphicsCore.computedExtent)&&c[2]>b.xmin&&c[0]<b.xmax&&c[3]>b.ymin&&c[1]<b.ymax&&(this.updateElevation=!0):(a.expand(this.dirtyExtent,c),this.spatialReference=b.spatialReference,this.markDirtyThrottled(),this.layerView._evaluateUpdatingState())};b.prototype.markDirty=
function(){var b=this,k=this.dirtyExtent;-Infinity===k[0]?this.markAllGraphicsElevationDirty():(this.numPendingSpatialIndexQueries++,this.getGraphicsInExtent(k,this.spatialReference,function(a,c){b.numPendingSpatialIndexQueries--;for(var f=0;f<c;f++){var k=a[f],n=b.graphicsCore.graphics[k];n&&n.needsElevationUpdates()&&b.markGraphicElevationDirty(k)}b.layerView._evaluateUpdatingState()}),this.layerView._evaluateUpdatingState());a.set(this.dirtyExtent,a.NEGATIVE_INFINITY)};return b}()})},"esri/views/ui/3d/DefaultUI3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../DefaultUI dojo/_base/lang".split(" "),
function(x,r,k,a,b,c,t){return function(c){function f(){return c.call(this)||this}k(f,c);f.prototype.getDefaults=function(){return t.mixin(this.inherited(arguments),{components:["attribution","zoom","navigation-toggle","compass"]})};return f=a([b.subclass("esri.views.ui.3d.DefaultUI3D")],f)}(b.declared(c))})},"esri/layers/graphics/controllers/I3SOnDemandController":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/promise/all dojo/errors/CancelError dojo/has dojo/_base/lang ../../../views/3d/support/ResourceController ../../../core/sql/WhereClause ../../../views/3d/layers/SceneLayerView3D ../../../views/3d/layers/i3s/I3SNodeLoader ../../../views/3d/layers/i3s/I3SIndexTraversal ../../../views/3d/layers/i3s/I3SUtil ../../../views/3d/layers/i3s/I3SLodHandling ../../../views/3d/layers/i3s/I3SViewportQueries ../../../views/3d/layers/i3s/IdleQueue ../../../views/3d/layers/i3s/GoogPriorityQueue ../../../layers/SceneLayer ../../../layers/IntegratedMeshLayer ../../../core/accessorSupport/decorators ../../../core/Accessor ../../../core/Evented ../../../core/Promise ../../../core/Logger ../../../core/promiseUtils ../../../core/watchUtils ../../../core/HandleRegistry ../../../views/3d/support/PromiseLightweight ../../../views/3d/support/projectionUtils ../../../views/3d/lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S){function T(a,b){b=b.toLowerCase();for(var d=0;d<a.length;d++)if(a[d].name.toLowerCase()===b)return d;return-1}var V=L.getLogger("esri.layers.graphics.controllers.I3SOnDemandController");x=function(r){function e(a){a=r.call(this)||this;a.nodeIndex={};a.screenSizeFactor=0;a.updating=!0;a.updatingPercentage=0;a._lodFactorProperty=null;a._isIdle=!1;a._alwaysLoadEverythingModeEnabled=!1;a._uncompressedTextureDownsamplingEnabled=!1;
a._computedMbs={};a._nodeQueue=null;a.maxQueueLevel=0;a._numNodesLoading=0;a._numAttributesLoading=0;a._progressMaxNumNodes=1;a._poi=null;a._requiredAttributesDirty=!0;a._updatesDisabled=!1;a.disableCache=!1;a._restartNodeLoading=!1;a._fields=null;a._attributeStorageInfo=null;a._handles=new U;a._idleQueue=new F.IdleQueue;return a}k(e,r);Object.defineProperty(e.prototype,"isMeshPyramid",{get:function(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType},enumerable:!0,
configurable:!0});Object.defineProperty(e.prototype,"streamDataSupplier",{get:function(){return this.layerView.view.resourceController.registerClient(this.layerView,f.ClientType.SCENE,{trackRequests:!0})},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"parsedDefinitionExpression",{get:function(){if(this.layer instanceof p&&this.layer.definitionExpression)try{var a=q.create(this.layer.definitionExpression);if(!a.isStandardized())return V.error("definitionExpression is using non standard function"),
null;var b=[],c=a.getFields();v.findFieldsCaseInsensitive(c,this.layer.fields,{missingFields:b});return 0<b.length?(V.error("definitionExpression references unknown fields: "+b.join(", ")),null):a}catch(u){return V.error("Failed to parse definitionExpression: "+u),null}else return null},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"definitionExpressionFields",{get:function(){if(this.parsedDefinitionExpression){var a=this.parsedDefinitionExpression.getFields();return v.findFieldsCaseInsensitive(a,
this._fields)}return null},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"crsVertex",{get:function(){return v.getVertexCrs(this.layer)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"crsIndex",{get:function(){return v.getIndexCrs(this.layer)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rootNodeVisible",{get:function(){var a=this._rootNodeId&&this.nodeIndex[this._rootNodeId];return a&&this._viewportQueries?this._viewportQueries.isNodeVisible(a):
!0},enumerable:!0,configurable:!0});e.prototype.initialize=function(){var a=this;this.updateEventListener={needsUpdate:function(){return a._needsAnimationFrameHandler()},idleFrame:function(b){return a._animationFrameHandler(b)},idleBegin:function(){a._startNodeLoading();a._updateIdleState(!0)},idleEnd:function(){a.cancelNodeLoading();a._updateIdleState(!1)}};this.updateEventListenerWhileSuspended={idleBegin:function(){return a._startNodeLoadingWhileSuspended()}};this._lodHandling=new w(this.layerViewRequiredFunctions,
this.layerViewOptionalFunctions,function(){return a._evaluateUpdatingState()});this.layerView._controller=this;var c=this.layer;this._defaultGeometrySchema=c.store.defaultGeometrySchema;this._rootNodeUrl=c.store.rootNode;var e=this._rootNodeUrl.split("/");this._rootNodeId=e[e.length-1];this.disableCache=t("disable-feature:idb-cache");c instanceof p?("mesh"===c.geometryType?this._lodFactorProperty="qualitySettings.sceneService.3dObject.lodFactor":"point"===c.geometryType&&(this._lodFactorProperty=
"qualitySettings.sceneService.point.lodFactor"),this._fields=c.fields,this._attributeStorageInfo=c.attributeStorageInfo):c instanceof z&&(this._lodFactorProperty="qualitySettings.sceneService.integratedMesh.lodFactor");c=b([this.layer.when(),this.layerView.when()]).then(function(){if(!a.destroyed&&a.layerView&&!a.layerView.destroyed){a.setClippingArea(a.layerView.view.clippingArea);var b=a.layerView.view.pointsOfInterest,d=function(){return a.restartNodeLoading()};a._centerOnSurface=b.centerOnSurfaceFrequent;
a._handles.add([a._centerOnSurface.watch("renderLocation",function(){return a._pointOfInterestChanged()}),b.events.on("camera-parameters-changed",d)],"view");var c=a.layerView.view.resourceController,e=!1;a._handles.add(P.init(a.layerView,"suspended",function(b){e&&c.deregisterIdleFrameWorker(a);b?c.registerIdleFrameWorker(a,a.updateEventListenerWhileSuspended):c.registerIdleFrameWorker(a,a.updateEventListener);e=!0}),"layerview");a._handles.add(a.layer.watch("elevationInfo",function(b){return a._elevationInfoChanged(b)}),
"layer");a.layerView instanceof l&&a._handles.add([P.init(a.layerView,"alwaysLoadEverythingModeEnabled",function(b){a._alwaysLoadEverythingModeEnabled=b;d()}),P.init(a.layerView,"uncompressedTextureDownsamplingEnabled",function(b){a._uncompressedTextureDownsamplingEnabled=b;d()})],"layer");a._lodFactorProperty&&a._handles.add(a.layerView.view.watch(a._lodFactorProperty,function(){return a._qualityChanged()}),"quality")}});this.addResolvingPromise(c)};e.prototype.destroy=function(){this.layerView.view.resourceController.deregisterIdleFrameWorker(this);
this.layerView.view.resourceController.deregisterClient(this.layerView);this._handles.destroy();this._nodeLoader=null};e.prototype._getRequiredAttributes=function(){if(!(null!=this._attributeStorageInfo&&this.layer instanceof p&&this._fields))return[];var a=Object.create(null);this.layer.renderer&&this.layer.renderer.collectRequiredFields(a);this.layer.labelsVisible&&this.layer.labelingInfo&&this.layer.labelingInfo.forEach(function(b){b._collectRequiredFields(a)});if(null!=this.definitionExpressionFields)for(var b=
0,c=this.definitionExpressionFields;b<c.length;b++)a[c[b]]=!0;var e=this._attributeStorageInfo,f=this._fields,h=this.layer.objectIdField;return Object.keys(a).map(function(a){var b=T(e,a);a=T(f,a);return 0<=b&&0<=a?{index:b,name:f[a].name,field:f[a],attributeStorageInfo:e[b]}:null}).filter(function(a){return null!=a&&a.name!==h}).sort(function(a,b){return b.index-a.index}).filter(function(a,b,d){return 0===b||d[b-1].index!==a.index})};e.prototype._requiredFieldsChange=function(){this._requiredAttributesDirty=
!0;this.restartNodeLoading()};e.prototype._labelingChanged=function(){var a=this._requiredAttributes,b=this._getRequiredAttributes();a.length===b.length&&a.every(function(a){return 0<=T(b,a.name)})||this._requiredFieldsChange()};e.prototype.setClippingArea=function(a){var b=[];R.extentToBoundingBox(a,b,this.layerView.view.renderSpatialReference)?this._clippingArea=b:this._clippingArea=null};e.prototype._qualityChanged=function(){this.restartNodeLoading()};e.prototype._pointOfInterestChanged=function(){this._poi&&
(this._calculatePointOfInterest(this._poi),this._indexLoader&&(this._indexLoader.updatePointOfInterest(this._poi),this._indexLoader.progressiveLoadPenalty=h.distancePenalty*this._viewportQueries.distCameraToPOI(this._poi)))};e.prototype._calculatePointOfInterest=function(a){void 0===a&&(a=S.vec3d.create());var b=S.vec3d.create(),d=S.vec3d.create(),c=this._centerOnSurface.renderLocation,e=this.layerView.view.renderCoordsHelper;S.vec3d.subtract(c,this.camPos,b);S.vec3d.normalize(b);e.worldUpAtPosition(c,
d);b=Math.acos(S.vec3d.dot(d,b))-.5*Math.PI;S.vec3d.lerp(this.camPos,c,Math.max(0,Math.min(1,b/(.5*Math.PI))),a);return a};e.prototype.updateClippingArea=function(a){this.setClippingArea(a);this.restartNodeLoading()};e.prototype.getBaseUrl=function(){return this.layer.parsedUrl.path};e.prototype.updateElevationChanged=function(a,b,c){v.findIntersectingNodes(a,b,this.nodeIndex.root,this.crsIndex,this.nodeIndex,c);for(a=0;a<c.length;a++)b=c.data[a],this._computedMbs[b.id]&&(this._computedMbs[b.id][3]=
-1),b.id===this._rootNodeId&&this.notifyChange("rootNodeVisible");c.length&&this.restartNodeLoading()};e.prototype._elevationInfoChanged=function(a){a=0;for(var b=Object.keys(this._computedMbs);a<b.length;a++)this._computedMbs[b[a]][3]=-1;this._initViewData()};e.prototype.restartNodeLoading=function(){this._restartNodeLoading=!0;this._evaluateUpdatingState()};e.prototype.schedule=function(a){return this._idleQueue.push(a)};e.prototype._needsAnimationFrameHandler=function(){return!0};e.prototype._animationFrameHandler=
function(a){this._restartNodeLoading&&(this.cancelNodeLoading(),this._startNodeLoading());if(null!=this._nodeLoader){var b=this._indexLoader&&(this.maxQueueLevel>=this._indexLoader.getMaxLevel(0)||!this._indexLoader.isLoading());if(this._nodeQueue&&b)for(var d=this._indexLoader.isLoading()?3:5;this._numNodesLoading<d&&!this._nodeQueue.isEmpty();)this._loadNode(this._nodeQueue.dequeue());this._indexLoader&&(b=b?4:10,d=this._indexLoader.getNumLoading(),b=Math.min(b-d,4),0<b&&this._indexLoader.continueTraversal(b));
for(;0<this._idleQueue.length()&&!a.done();)this._idleQueue.process();this._evaluateUpdatingState();this._lodHandling.lodGlobalHandling()}};e.prototype._evaluateUpdatingState=function(){var a=this._indexLoader?this._indexLoader.getQueueSize():0,b=this._nodeQueue?this._nodeQueue.getCount():0,a=a+3*(b+this._numNodesLoading),b=!(!(0<a||0<this._numAttributesLoading||this._indexLoader&&this._indexLoader.isLoading()||this._restartNodeLoading||0<this._idleQueue.length()||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling)&&
this._isIdle);0===a&&(this._progressMaxNumNodes=1);this._progressMaxNumNodes=Math.max(a,this._progressMaxNumNodes);b!==this._get("updating")&&this._set("updating",b);a=100*a/this._progressMaxNumNodes;a!==this._get("updatingPercentage")&&this._set("updatingPercentage",a)};e.prototype._initViewData=function(){var a=this.layerView.view,b=a.state.camera,c=a.renderCoordsHelper;this.camPos=S.vec3d.create(a.pointsOfInterest.renderPointOfView);this.screenSizeFactor=1/b.perPixelRatio;this._poi=this._calculatePointOfInterest();
var e=this._lodFactorProperty&&this.layerView.view.get(this._lodFactorProperty)||1;this._viewportQueries=new D(this._computedMbs,this.crsIndex,c,b,this._clippingArea,null!=this.layerViewOptionalFunctions.traversalOptions?this.layerViewOptionalFunctions.traversalOptions.errorMetricPreference:null,a.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(this.layer,e),screenspaceErrorBias:e,angleDependentLoD:.5>e,disableLod:this._alwaysLoadEverythingModeEnabled});
this.notifyChange("rootNodeVisible")};e.prototype._getProgressiveLoadFactor=function(a,b){return a instanceof p&&"mesh"===a.geometryType?(a=1<=b&&t("enable-feature:progressive-3dobject"))?h.factor3dObject:1:a instanceof z?(a=1<=b&&!t("disable-feature:progressive-im"))?h.factorIM:1:1};e.prototype._startNodeLoadingWhileSuspended=function(){var a=this;this._initViewData();this._alwaysLoadEverythingModeEnabled&&this.layerView.visible&&!this.layerView.get("parent.suspended")||this._removeInvisibleNodes(function(b){return a._viewportQueries.isNodeVisible(b)})};
e.prototype._startNodeLoading=function(){var a=this;this._restartNodeLoading=!1;if(!this._updatesDisabled&&null!=this.streamDataSupplier){this._initViewData();null!=this.layerViewOptionalFunctions.getLoadedAttributes&&this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1,this._handles.add([this.layer.watch("renderer",function(){return a._requiredFieldsChange()}),this.layer.watch("definitionExpression",function(){return a._requiredFieldsChange()}),
this.layer.watch("labelsVisible",function(){return a._labelingChanged()}),this.layer.watch("labelingInfo",function(){return a._labelingChanged()})],"requiredAttributes"));var b=this.layerViewOptionalFunctions.textureOptions,c=y.TextureFormat.Normal;b&&b.useCompressedTextures?c=y.TextureFormat.Compressed:this._uncompressedTextureDownsamplingEnabled&&(c=y.TextureFormat.Downsampled);b=this._defaultGeometrySchema;this._nodeLoader=new y(this.streamDataSupplier,V,b,this._requiredAttributes,{textureFormat:c,
loadTextureData:this.layerView instanceof l&&this.layerView.rendererNeedsTextures,loadFeatureData:!this.isMeshPyramid||null==b||null==b.ordering});c=n.mixin({loadEverything:this._alwaysLoadEverythingModeEnabled},this.layerViewOptionalFunctions.traversalOptions);this._indexLoader=new B(this.getBaseUrl(),this._rootNodeUrl,this._rootNodeId,this._poi,this.nodeIndex,this.streamDataSupplier,this._viewportQueries,function(b,d){return a._processNodeIndexDocument(b,d)},function(b){return a._lodHandling.finishedLevel(b)},
V,c);this._indexLoader.progressiveLoadPenalty=h.distancePenalty*this._viewportQueries.distCameraToPOI(this._poi);this._nodeQueue=new ca;this.maxQueueLevel=0;this._indexLoader.start();this._alwaysLoadEverythingModeEnabled||this._removeInvisibleNodes(function(b){return a._indexLoader.nodeIsVisible(b)});this._lodHandling.startNodeLoading(function(b){return a._indexLoader.nodeIsVisible(b)},function(b){return a._indexLoader.nodeTraversalState(b)},this.nodeIndex,this._rootNodeId,{mode:null!=c&&c.perLevelTraversal?
"perLevel":"global",allowPartialOverlaps:!!c.allowPartialOverlaps,maxLodLevel:this._viewportQueries.maxLodLevel});this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler&&this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler();this._evaluateUpdatingState()}};e.prototype.isNodeLoading=function(){return null!=this._nodeLoader&&null!=this._indexLoader};e.prototype.cancelNodeLoading=function(){this.isNodeLoading()&&(this._indexLoader.cancel(),this._nodeLoader.cancel(),this.streamDataSupplier.cancelAll(),
this._idleQueue.cancelAll(),this._numNodesLoading=0,this._poi=this._nodeQueue=this._indexLoader=this._nodeLoader=null,this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler&&this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler(),this._evaluateUpdatingState())};e.prototype._removeInvisibleNodes=function(a){for(var b={},d=this.layerViewRequiredFunctions.getAddedNodeIDs(),c=0;c<d.length;c++){var e=d[c],f=this.nodeIndex[e];this._isNodeVisibleWithParents(f,a)?b[e]=f:this._removeNodeData(f)}return b};
e.prototype._isNodeVisibleWithParents=function(a,b){var d=a;do a=b(d),d=d.parentNode,d=null!=d?this.nodeIndex[d.id]:null;while(a&&null!=d);return a};e.prototype._removeNodeData=function(a){this._lodHandling.setLodGlobalDirty();this.layerViewRequiredFunctions.removeNodeData(a)};e.prototype._processNodeIndexDocument=function(a,b){var d=this.layerViewOptionalFunctions.traversalOptions;if(d&&d.perLevelTraversal)return this._loadNode(a);this._nodeQueue.enqueue(b,a);this.maxQueueLevel=Math.max(a.level,
this.maxQueueLevel);a=new N.Promise;a.done();return a};e.prototype._loadNode=function(a){var b=this,d=new N.Promise;if(null!=a.featureData&&0<a.featureData.length)if(this.layerViewRequiredFunctions.areAllBundlesLoaded(a)){var c=this.layerViewOptionalFunctions.getLoadedAttributes,c=null!=c?c(a):void 0;null!=c&&c!==this._requiredAttributes&&(this._nodeLoader.loadAttributes(a,a.baseUrl,this._requiredAttributes).then(function(d){b.layerViewOptionalFunctions.setAttributeData(a,b._requiredAttributes,d)}).otherwise(function(d){b.layerViewOptionalFunctions.setAttributeData(a,
b._requiredAttributes,{})}).then(function(){b._numAttributesLoading--;b._evaluateUpdatingState()}),this._numAttributesLoading++,this._evaluateUpdatingState());this._lodHandling.shouldLoadNode(a)&&this._lodHandling.lodSwapBundleLoaded(a)}else if(this._lodHandling.shouldLoadNode(a)){if(this.layerViewRequiredFunctions.isOverMemory())return d.done(),d;for(var c=[],e=0;e<a.featureData.length;e++)this.layerViewRequiredFunctions.isBundleAlreadyAddedToStage(a,e)||c.push(this._loadAndAddBundle(a,e));this._numNodesLoading++;
this._evaluateUpdatingState();O.eachAlways(c).then(function(){b._numNodesLoading--;b._evaluateUpdatingState();d.done()});return d}d.done();return d};e.prototype._loadCached=function(a,b){var d=this,c=this.disableCache?null:this.layerViewOptionalFunctions.loadCachedBundle,e=this.disableCache?null:this.layerViewOptionalFunctions.addCachedBundle;return c&&e?this.schedule().then(function(){return c(a,b,function(a,b){return d._nodeLoader.loadTextures(a,b)})}).then(function(c){if(null==c)return!1;var f=
d._requiredAttributes;return d.schedule().then(function(){return d._nodeLoader.loadAttributes(a,a.baseUrl,f)}).then(function(a){return d.schedule({loadedAttributes:f,attributeData:a})}).then(function(d){return e(a,b,c,d)}).then(function(){d._lodHandling.lodSwapBundleLoaded(a);return!0})}):O.resolve(!1)};e.prototype._loadUncached=function(a,b){var d=this;return this.schedule().then(function(){return d._nodeLoader.loadBundleData(a,b)}).then(function(a){return d.schedule(a)}).then(function(c){return d.layerViewRequiredFunctions.addBundle(a,
b,c)}).then(function(){return d._lodHandling.lodSwapBundleLoaded(a)})};e.prototype._loadAndAddBundle=function(a,b){var d=this;return this._loadCached(a,b).then(function(c){if(!c)return d._loadUncached(a,b)}).otherwise(function(d){d instanceof c||V.error("Failed to load node '"+a.id+"' bundle "+b+": "+d)})};e.prototype._updateIdleState=function(a){a!==this._isIdle&&(this._isIdle=a,this._evaluateUpdatingState())};a([A.property({readOnly:!0})],e.prototype,"isMeshPyramid",null);a([A.property({readOnly:!0})],
e.prototype,"streamDataSupplier",null);a([A.property({readOnly:!0,dependsOn:["layer.definitionExpression"]})],e.prototype,"parsedDefinitionExpression",null);a([A.property({readOnly:!0,dependsOn:["parsedDefinitionExpression"]})],e.prototype,"definitionExpressionFields",null);a([A.property({readOnly:!0})],e.prototype,"crsVertex",null);a([A.property({readOnly:!0})],e.prototype,"crsIndex",null);a([A.property({readOnly:!0})],e.prototype,"nodeIndex",void 0);a([A.property()],e.prototype,"camPos",void 0);
a([A.property()],e.prototype,"screenSizeFactor",void 0);a([A.property()],e.prototype,"layerView",void 0);a([A.property()],e.prototype,"layerViewRequiredFunctions",void 0);a([A.property()],e.prototype,"layerViewOptionalFunctions",void 0);a([A.property()],e.prototype,"layer",void 0);a([A.property({readOnly:!0})],e.prototype,"updating",void 0);a([A.property({readOnly:!0})],e.prototype,"updatingPercentage",void 0);a([A.property({readOnly:!0})],e.prototype,"rootNodeVisible",null);return e=a([A.subclass("esri.layers.graphics.controllers.I3SOnDemandController")],
e)}(A.declared(J,K,I));var h={factorIM:.2,factor3dObject:.05,distancePenalty:10},ca=G.goog.structs.PriorityQueue;return x})},"esri/core/sql/WhereClause":function(){define(["require","exports","./WhereGrammar","../../moment","./StandardizedFunctions"],function(x,r,k,a,b){function c(a){return Array.isArray(a)?a:[a]}function t(a){return null!==a?!0!==a:null}function n(a,b){if(null==a)return null;for(var c=!1,f=0;f<b.length;f++){var k=b[f];if(null==k)c=null;else if(a===k){c=!0;break}}return c}function f(a,
b,c){if(null==a)return null;for(var f="",k=0,l=0;l<b.length;l++){var n=b.charAt(l);switch(k){case 0:n===c?k=1:f=0<="-[]/{}()*+?.\\^$|".indexOf(n)?f+("\\"+n):"%"===n?f+".*":"_"===n?f+".":f+n;break;case 1:f=0<="-[]/{}()*+?.\\^$|".indexOf(n)?f+("\\"+n):f+n,k=0}}return(new RegExp("^"+f+"$")).test(a)}function q(a){return a instanceof Date?a.valueOf():a}function l(a,b,c){if(null==b||null==c)return null;b=q(b);c=q(c);switch(a){case "\x3c\x3e":return b!==c;case "\x3d":return b===c;case "\x3e":return b>c;
case "\x3c":return b<c;case "\x3e\x3d":return b>=c;case "\x3c\x3d":return b<=c}}function y(a){for(var b=[],c={},f=0;f<a.length;f++){var k=a[f],l=k.toLowerCase();void 0===c[l]&&(b.push(k),c[l]=1)}return b}return function(){function r(){this.parameters=this.parseTree=null}r.create=function(a){var b=new r;b.parseTree=k.WhereGrammar.parse(a);return b};r.prototype.isStandardized=function(){var a=!0;this.visitAll(this.parseTree,function(c){a&&"function"===c.type&&(a=b.isStandardized(c.name,c.args.value.length))});
return a};r.prototype.setVariablesDictionary=function(a){this.parameters=a};r.prototype.testFeature=function(a){return!!this.evaluateNode(this.parseTree,a)};r.prototype.calculateValue=function(a){return this.evaluateNode(this.parseTree,a)};r.prototype.getFunctions=function(){var a=[];this.visitAll(this.parseTree,function(b){"function"===b.type&&a.push(b.name.toLowerCase())});return y(a)};r.prototype.getFields=function(){var a=[];this.visitAll(this.parseTree,function(b){"column_ref"===b.type&&a.push(b.column)});
return y(a)};r.prototype.getVariables=function(){var a=[];this.visitAll(this.parseTree,function(b){"param"===b.type&&a.push(b.value.toLowerCase())});return y(a)};r.prototype.featureValue=function(a,b,c){a=a&&"object"===typeof a.attributes?a.attributes:a;var f=a[b];if(void 0!==f)return f;for(var k in a)if(b.toLowerCase()===k.toLowerCase())return c.column=k,a[k];return null};r.prototype.visitAll=function(a,b){if(null!=a)switch(b(a),a.type){case "when_clause":this.visitAll(a.operand,b);this.visitAll(a.value,
b);break;case "case_expression":for(var c=0,f=a.clauses;c<f.length;c++){var k=f[c];this.visitAll(k,b)}"simple"===a.format&&this.visitAll(a.operand,b);null!==a.else&&this.visitAll(a.else,b);break;case "expr_list":c=0;for(a=a.value;c<a.length;c++)k=a[c],this.visitAll(k,b);break;case "unary_expr":this.visitAll(a.expr,b);break;case "binary_expr":this.visitAll(a.left,b);this.visitAll(a.right,b);break;case "function":this.visitAll(a.args,b)}};r.prototype.evaluateNode=function(k,r){switch(k.type){case "case_expression":if("simple"===
k.format)for(var v=q(this.evaluateNode(k.operand,r)),y=0;y<k.clauses.length;y++){if(v===q(this.evaluateNode(k.clauses[y].operand,r)))return this.evaluateNode(k.clauses[y].value,r)}else for(y=0;y<k.clauses.length;y++)if(!0===this.evaluateNode(k.clauses[y].operand,r))return this.evaluateNode(k.clauses[y].value,r);return null!==k.else?this.evaluateNode(k.else,r):null;case "param":return this.parameters[k.value.toLowerCase()];case "expr_list":v=[];y=0;for(k=k.value;y<k.length;y++){var w=k[y];v.push(this.evaluateNode(w,
r))}return v;case "unary_expr":return t(this.evaluateNode(k.expr,r));case "binary_expr":switch(k.operator){case "AND":return v=this.evaluateNode(k.left,r),r=this.evaluateNode(k.right,r),null!=v&&null!=r?!0===v&&!0===r:!1===v||!1===r?!1:null;case "OR":return v=this.evaluateNode(k.left,r),r=this.evaluateNode(k.right,r),null!=v&&null!=r?!0===v||!0===r:!0===v||!0===r?!0:null;case "IS":if("null"!==k.right.type)throw Error("Unsupported RHS for IS");return null===this.evaluateNode(k.left,r);case "ISNOT":if("null"!==
k.right.type)throw Error("Unsupported RHS for IS");return null!==this.evaluateNode(k.left,r);case "IN":return v=c(this.evaluateNode(k.right,r)),n(this.evaluateNode(k.left,r),v);case "NOT IN":return v=c(this.evaluateNode(k.right,r)),t(n(this.evaluateNode(k.left,r),v));case "BETWEEN":return v=this.evaluateNode(k.left,r),r=this.evaluateNode(k.right,r),null==v||null==r[0]||null==r[1]?null:v>=r[0]&&v<=r[1];case "NOTBETWEEN":return v=this.evaluateNode(k.left,r),r=this.evaluateNode(k.right,r),null==v||null==
r[0]||null==r[1]?null:v<r[0]||v>r[1];case "LIKE":return f(this.evaluateNode(k.left,r),this.evaluateNode(k.right,r),k.escape);case "NOT LIKE":return t(f(this.evaluateNode(k.left,r),this.evaluateNode(k.right,r),k.escape));case "\x3c\x3e":case "\x3c":case "\x3e":case "\x3e\x3d":case "\x3c\x3d":case "\x3d":return l(k.operator,this.evaluateNode(k.left,r),this.evaluateNode(k.right,r));case "*":return this.evaluateNode(k.left,r)*this.evaluateNode(k.right,r);case "-":return this.evaluateNode(k.left,r)-this.evaluateNode(k.right,
r);case "+":return this.evaluateNode(k.left,r)+this.evaluateNode(k.right,r);case "/":return this.evaluateNode(k.left,r)/this.evaluateNode(k.right,r)}throw Error("Not Supported Operator "+k.operator);case "null":case "bool":case "string":case "number":return k.value;case "date":return a(k.value,["YYYY-M-D"]).toDate();case "timestamp":return a(k.value,["YYYY-M-D H:m:s","YYYY-M-D H:mZ","YYYY-M-D H:m:sZ","YYYY-M-D H:m","YYYY-m-d"]).toDate();case "column_ref":return"CURRENT_DATE"===k.column.toUpperCase()?
(w=new Date,w.setHours(0,0,0,0),w):"CURRENT_TIMESTAMP"===k.column.toUpperCase()?new Date:this.featureValue(r,k.column,k);case "function":return r=this.evaluateNode(k.args,r),b.evaluateFunction(k.name,r)}throw Error("Unsupported sql syntax "+k.type);};return r}()})},"esri/core/sql/WhereGrammar":function(){define(["require","exports","./sql92grammar"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function a(){}a.parse=function(a){return k.parse(a)};return a}();r.WhereGrammar=
x})},"esri/core/sql/sql92grammar":function(){define([],function(){function x(r,k,a,b){this.message=r;this.expected=k;this.found=a;this.location=b;this.name="SyntaxError";"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(this,x)}(function(r,k){function a(){this.constructor=r}a.prototype=k.prototype;r.prototype=new a})(x,Error);x.buildMessage=function(r,k){function a(a){return a.charCodeAt(0).toString(16).toUpperCase()}function b(b){return b.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,
"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+a(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+a(b)})}function c(b){return b.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+a(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+a(b)})}var t=
{literal:function(a){return'"'+b(a.text)+'"'},"class":function(a){var b="",k;for(k=0;k<a.parts.length;k++)b+=a.parts[k]instanceof Array?c(a.parts[k][0])+"-"+c(a.parts[k][1]):c(a.parts[k]);return"["+(a.inverted?"^":"")+b+"]"},any:function(a){return"any character"},end:function(a){return"end of input"},other:function(a){return a.description}};return"Expected "+function(a){var b=Array(a.length),c;for(c=0;c<a.length;c++){var k=c,n;n=a[c];n=t[n.type](n);b[k]=n}b.sort();if(0<b.length){for(a=c=1;c<b.length;c++)b[c-
1]!==b[c]&&(b[a]=b[c],a++);b.length=a}switch(b.length){case 1:return b[0];case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}(r)+" but "+(k?'"'+b(k)+'"':"end of input")+" found."};return{SyntaxError:x,parse:function(r,k){function a(a,b){return{type:"literal",text:a,ignoreCase:b}}function b(a,b,d){return{type:"class",parts:a,inverted:b,ignoreCase:d}}function c(a){var b=fb[a],d;if(!b){for(d=a-1;!fb[d];)d--;b=fb[d];for(b={line:b.line,column:b.column};d<a;)10===
r.charCodeAt(d)?(b.line++,b.column=1):b.column++,d++;fb[a]=b}return b}function t(a,b){var d=c(a),e=c(b);return{start:{offset:a,line:d.line,column:d.column},end:{offset:b,line:e.line,column:e.column}}}function n(a){H<Ia||(H>Ia&&(Ia=H,rb=[]),rb.push(a))}function f(){var a,b,d;a=H;b=Z();b!==E?(b=l(),b!==E?(d=Z(),d!==E?a=b:(H=a,a=E)):(H=a,a=E)):(H=a,a=E);return a}function q(){var a,b,d,c,e,f,g,h;a=H;b=l();if(b!==E){d=[];c=H;e=Z();e!==E?(f=ga(),f!==E?(g=Z(),g!==E?(h=l(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):
(H=c,c=E)):(H=c,c=E)):(H=c,c=E);for(;c!==E;)d.push(c),c=H,e=Z(),e!==E?(f=ga(),f!==E?(g=Z(),g!==E?(h=l(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);if(d!==E){a={type:"expr_list"};b=[b];for(c=0;c<d.length;c++)b.push(d[c][3]);a.value=b}else H=a,a=E}else H=a,a=E;return a}function l(){var a,b,d,c,e,f,g,h;a=H;b=y();if(b!==E){d=[];c=H;e=Z();e!==E?(f=M(),f!==E?(g=Z(),g!==E?(h=y(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);for(;c!==E;)d.push(c),c=H,e=Z(),e!==E?(f=M(),
f!==E?(g=Z(),g!==E?(h=y(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);d!==E?a=b=sa(b,d):(H=a,a=E)}else H=a,a=E;return a}function y(){var a,b,d,c,e,f,g,h;a=H;b=B();if(b!==E){d=[];c=H;e=Z();e!==E?(f=C(),f!==E?(g=Z(),g!==E?(h=B(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);for(;c!==E;)d.push(c),c=H,e=Z(),e!==E?(f=C(),f!==E?(g=Z(),g!==E?(h=B(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);d!==E?a=b=sa(b,d):(H=a,a=E)}else H=a,a=E;return a}function B(){var a,
b,d,c,e;a=H;b=u();b===E&&(b=H,33===r.charCodeAt(H)?(d=ya,H++):(d=E,0===X&&n(Ba)),d!==E?(c=H,X++,61===r.charCodeAt(H)?(e=xa,H++):(e=E,0===X&&n(va)),X--,e===E?c=void 0:(H=c,c=E),c!==E?b=d=[d,c]:(H=b,b=E)):(H=b,b=E));b!==E?(d=Z(),d!==E?(c=B(),c!==E?a=b={type:"unary_expr",operator:"NOT",expr:c}:(H=a,a=E)):(H=a,a=E)):(H=a,a=E);if(a===E)if(a=H,b=F(),b!==E)if(d=Z(),d!==E){var f,h,k;d=[];c=H;e=Z();e!==E?(f=v(),f!==E?(h=Z(),h!==E?(k=F(),k!==E?c=e=[e,f,h,k]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);if(c!==
E)for(;c!==E;)d.push(c),c=H,e=Z(),e!==E?(f=v(),f!==E?(h=Z(),h!==E?(k=F(),k!==E?c=e=[e,f,h,k]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);else d=E;d!==E&&(d={type:"arithmetic",tail:d});d===E&&(d=H,c=D(),c!==E?(e=Z(),e!==E?(e=la(),e!==E?(e=Z(),e!==E?(e=q(),e!==E?(f=Z(),f!==E?(f=ia(),f!==E?d=c={op:c,right:e}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E),d===E&&(d=H,c=D(),c!==E?(e=Z(),e!==E?(e=la(),e!==E?(e=Z(),e!==E?(e=ia(),e!==E?d=c={op:c,right:{type:"expr_list",value:[]}}:
(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E),d===E&&(d=H,c=D(),c!==E?(e=Z(),e!==E?(e=O(),e!==E?d=c={op:c,right:e}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E))),d===E&&(d=H,e=u(),e!==E?(c=Z(),c!==E?(c=Y(),c!==E?(f=Z(),f!==E?(f=F(),f!==E?(h=Z(),h!==E?(h=C(),h!==E?(e=Z(),e!==E?(e=F(),e!==E?d=e={op:"NOT"+c,right:{type:"expr_list",value:[f,e]}}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E),d===E&&(d=H,e=Y(),e!==E?(c=Z(),c!==E?(c=F(),c!==E?(f=Z(),f!==E?(f=
C(),f!==E?(h=Z(),h!==E?(h=F(),h!==E?d=e={op:e,right:{type:"expr_list",value:[c,h]}}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)),d===E&&(d=H,c=g(),c!==E?(e=Z(),e!==E?(e=u(),e!==E?(e=Z(),e!==E?(e=F(),e!==E?d=c={op:c+"NOT",right:e}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E),d===E&&(d=H,c=g(),c!==E?(e=Z(),e!==E?(e=F(),e!==E?d=c={op:c,right:e}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)),d===E&&(d=H,c=w(),c!==E?(e=Z(),e!==E?(e=U(),e!==E?(f=Z(),f!==E?(f=H,r.substr(H,6).toLowerCase()===
id?(h=r.substr(H,6),H+=6):(h=E,0===X&&n(jd)),h!==E?(h=H,X++,k=K(),X--,k===E?h=void 0:(H=h,h=E),h!==E?f="ESCAPE":(H=f,f=E)):(H=f,f=E),f!==E?(f=Z(),f!==E?(f=N(),f!==E?d=c={op:c,right:e,escape:f.value}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E)):(H=d,d=E),d===E&&(d=H,c=w(),c!==E?(e=Z(),e!==E?(e=U(),e!==E?d=c={op:c,right:e,escape:""}:(H=d,d=E)):(H=d,d=E)):(H=d,d=E))))));d===E&&(d=null);d!==E?(a=b,b=d,""==b||void 0==b||null==b?b=a:(d=null,b=d="arithmetic"==b.type?sa(a,b.tail):ma(b.op,
a,b.right,b.escape)),a=b):(H=a,a=E)}else H=a,a=E;else H=a,a=E;return a}function v(){var a;r.substr(H,2)===ba?(a=ba,H+=2):(a=E,0===X&&n(Ca));a===E&&(62===r.charCodeAt(H)?(a=za,H++):(a=E,0===X&&n(Da)),a===E&&(r.substr(H,2)===Ja?(a=Ja,H+=2):(a=E,0===X&&n(ab)),a===E&&(r.substr(H,2)===Xa?(a=Xa,H+=2):(a=E,0===X&&n(qa)),a===E&&(60===r.charCodeAt(H)?(a=Ga,H++):(a=E,0===X&&n(Sa)),a===E&&(61===r.charCodeAt(H)?(a=xa,H++):(a=E,0===X&&n(va)),a===E&&(r.substr(H,2)===Ya?(a=Ya,H+=2):(a=E,0===X&&n(Fa))))))));return a}
function w(){var a,b,d,c;a=a=H;b=u();b!==E?(d=Z(),d!==E?(c=m(),c!==E?a=b=[b,d,c]:(H=a,a=E)):(H=a,a=E)):(H=a,a=E);a!==E&&(a=a[0]+" "+a[2]);a===E&&(a=m());return a}function D(){var a,b,c,e;a=a=H;b=u();b!==E?(c=Z(),c!==E?(e=d(),e!==E?a=b=[b,c,e]:(H=a,a=E)):(H=a,a=E)):(H=a,a=E);a!==E&&(a=a[0]+" "+a[2]);a===E&&(a=d());return a}function F(){var a,b,d,c,e,f,g,h;a=H;b=p();if(b!==E){d=[];c=H;e=Z();e!==E?(f=G(),f!==E?(g=Z(),g!==E?(h=p(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);for(;c!==
E;)d.push(c),c=H,e=Z(),e!==E?(f=G(),f!==E?(g=Z(),g!==E?(h=p(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);d!==E?a=b=sa(b,d):(H=a,a=E)}else H=a,a=E;return a}function G(){var a;43===r.charCodeAt(H)?(a=Ta,H++):(a=E,0===X&&n(Ua));a===E&&(45===r.charCodeAt(H)?(a=bb,H++):(a=E,0===X&&n(ka)));return a}function p(){var a,b,d,c,e,f,g,h;a=H;b=A();if(b!==E){d=[];c=H;e=Z();e!==E?(f=z(),f!==E?(g=Z(),g!==E?(h=A(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);for(;c!==E;)d.push(c),
c=H,e=Z(),e!==E?(f=z(),f!==E?(g=Z(),g!==E?(h=A(),h!==E?c=e=[e,f,g,h]:(H=c,c=E)):(H=c,c=E)):(H=c,c=E)):(H=c,c=E);d!==E?a=b=sa(b,d):(H=a,a=E)}else H=a,a=E;return a}function z(){var a;42===r.charCodeAt(H)?(a=Ka,H++):(a=E,0===X&&n(La));a===E&&(47===r.charCodeAt(H)?(a=Ha,H++):(a=E,0===X&&n(Va)));return a}function A(){var a,b,c,e,f,g,k;k=N();if(k===E){var m,p,t,v;m=H;var u,y,z,w;u=H;y=V();y!==E?(z=h(),z!==E?(w=ca(),w!==E?u=y=parseFloat(y+z+w):(H=u,u=E)):(H=u,u=E)):(H=u,u=E);u===E&&(u=H,y=V(),y!==E?(z=h(),
z!==E?u=y=parseFloat(y+z):(H=u,u=E)):(H=u,u=E),u===E&&(u=H,y=V(),y!==E?(z=ca(),z!==E?u=y=parseFloat(y+z):(H=u,u=E)):(H=u,u=E),u===E&&(u=H,y=V(),y!==E&&(y=parseFloat(y)),u=y)));p=u;p!==E?(t=H,X++,v=I(),X--,v===E?t=void 0:(H=t,t=E),t!==E?m=p={type:"number",value:p}:(H=m,m=E)):(H=m,m=E);k=m;if(k===E){var B,A;B=H;var x,D,C,F;x=H;r.substr(H,4).toLowerCase()===kd?(D=r.substr(H,4),H+=4):(D=E,0===X&&n(ld));D!==E?(C=H,X++,F=K(),X--,F===E?C=void 0:(H=C,C=E),C!==E?x=D=[D,C]:(H=x,x=E)):(H=x,x=E);A=x;A!==E&&(A=
{type:"bool",value:!0});B=A;if(B===E){B=H;var G,na,wa,M;G=H;r.substr(H,5).toLowerCase()===md?(na=r.substr(H,5),H+=5):(na=E,0===X&&n(nd));na!==E?(wa=H,X++,M=K(),X--,M===E?wa=void 0:(H=wa,wa=E),wa!==E?G=na=[na,wa]:(H=G,G=E)):(H=G,G=E);A=G;A!==E&&(A={type:"bool",value:!1});B=A}k=B;if(k===E){var ya,Q,Ba,xa,ba;Q=H;r.substr(H,4).toLowerCase()===od?(Ba=r.substr(H,4),H+=4):(Ba=E,0===X&&n(pd));Ba!==E?(xa=H,X++,ba=K(),X--,ba===E?xa=void 0:(H=xa,xa=E),xa!==E?Q=Ba=[Ba,xa]:(H=Q,Q=E)):(H=Q,Q=E);ya=Q;ya!==E&&(ya=
{type:"null",value:null});k=ya;if(k===E){var Y,va,za,ea;Y=H;var Ca,ka,Sa,sa;Ca=H;r.substr(H,4).toLowerCase()===qd?(ka=r.substr(H,4),H+=4):(ka=E,0===X&&n(rd));ka!==E?(Sa=H,X++,sa=K(),X--,sa===E?Sa=void 0:(H=Sa,Sa=E),Sa!==E?Ca=ka="DATE":(H=Ca,Ca=E)):(H=Ca,Ca=E);va=Ca;va!==E?(za=Z(),za!==E?(ea=U(),ea!==E?Y=va={type:"date",value:ea.value}:(H=Y,Y=E)):(H=Y,Y=E)):(H=Y,Y=E);k=Y;if(k===E){var ga,ja,ma,Da;ga=H;var Ga,Ja,pa,ab;Ga=H;r.substr(H,9).toLowerCase()===sd?(Ja=r.substr(H,9),H+=9):(Ja=E,0===X&&n(td));
Ja!==E?(pa=H,X++,ab=K(),X--,ab===E?pa=void 0:(H=pa,pa=E),pa!==E?Ga=Ja="TIMESTAMP":(H=Ga,Ga=E)):(H=Ga,Ga=E);ja=Ga;ja!==E?(ma=Z(),ma!==E?(Da=U(),Da!==E?ga=ja={type:"timestamp",value:Da.value}:(H=ga,ga=E)):(H=ga,ga=E)):(H=ga,ga=E);k=ga}}}}}a=k;if(a===E){var qa,Ya,Xa,Fa,Ta,Ua,La,Ka,Va,Ha,bb,Ia;qa=H;var Ma,qb,eb,Tb;Ma=H;r.substr(H,7).toLowerCase()===ud?(qb=r.substr(H,7),H+=7):(qb=E,0===X&&n(vd));qb!==E?(eb=H,X++,Tb=K(),X--,Tb===E?eb=void 0:(H=eb,eb=E),eb!==E?Ma=qb="EXTRACT":(H=Ma,Ma=E)):(H=Ma,Ma=E);Ya=
Ma;if(Ya!==E)if(Xa=Z(),Xa!==E)if(Fa=la(),Fa!==E)if(Ta=Z(),Ta!==E){var Na,gb,Za,Fb,fb;gb=H;r.substr(H,4).toLowerCase()===wd?(Za=r.substr(H,4),H+=4):(Za=E,0===X&&n(xd));Za!==E?(Fb=H,X++,fb=K(),X--,fb===E?Fb=void 0:(H=Fb,Fb=E),Fb!==E?gb=Za="YEAR":(H=gb,gb=E)):(H=gb,gb=E);Na=gb;if(Na===E){var hb,$a,Gb,rb;hb=H;r.substr(H,5).toLowerCase()===yd?($a=r.substr(H,5),H+=5):($a=E,0===X&&n(zd));$a!==E?(Gb=H,X++,rb=K(),X--,rb===E?Gb=void 0:(H=Gb,Gb=E),Gb!==E?hb=$a="MONTH":(H=hb,hb=E)):(H=hb,hb=E);Na=hb;if(Na===
E){var ib,Ub,Hb,zb;ib=H;r.substr(H,3).toLowerCase()===Ad?(Ub=r.substr(H,3),H+=3):(Ub=E,0===X&&n(Bd));Ub!==E?(Hb=H,X++,zb=K(),X--,zb===E?Hb=void 0:(H=Hb,Hb=E),Hb!==E?ib=Ub="DAY":(H=ib,ib=E)):(H=ib,ib=E);Na=ib;if(Na===E){var jb,Vb,Ib,Ab;jb=H;r.substr(H,4).toLowerCase()===Cd?(Vb=r.substr(H,4),H+=4):(Vb=E,0===X&&n(Dd));Vb!==E?(Ib=H,X++,Ab=K(),X--,Ab===E?Ib=void 0:(H=Ib,Ib=E),Ib!==E?jb=Vb="HOUR":(H=jb,jb=E)):(H=jb,jb=E);Na=jb;if(Na===E){var kb,Wb,Jb,Bb;kb=H;r.substr(H,6).toLowerCase()===Ed?(Wb=r.substr(H,
6),H+=6):(Wb=E,0===X&&n(Fd));Wb!==E?(Jb=H,X++,Bb=K(),X--,Bb===E?Jb=void 0:(H=Jb,Jb=E),Jb!==E?kb=Wb="MINUTE":(H=kb,kb=E)):(H=kb,kb=E);Na=kb;if(Na===E){var lb,Xb,Kb,Cb;lb=H;r.substr(H,6).toLowerCase()===Gd?(Xb=r.substr(H,6),H+=6):(Xb=E,0===X&&n(Hd));Xb!==E?(Kb=H,X++,Cb=K(),X--,Cb===E?Kb=void 0:(H=Kb,Kb=E),Kb!==E?lb=Xb="SECOND":(H=lb,lb=E)):(H=lb,lb=E);Na=lb}}}}}Ua=Na;Ua!==E?(La=Z(),La!==E?(Ka=W(),Ka!==E?(Va=Z(),Va!==E?(Ha=l(),Ha!==E?(bb=Z(),bb!==E?(Ia=ia(),Ia!==E?qa=Ya={type:"function",name:"extract",
args:{type:"expr_list",value:[{type:"string",value:Ua},Ha]}}:(H=qa,qa=E)):(H=qa,qa=E)):(H=qa,qa=E)):(H=qa,qa=E)):(H=qa,qa=E)):(H=qa,qa=E)):(H=qa,qa=E)}else H=qa,qa=E;else H=qa,qa=E;else H=qa,qa=E;else H=qa,qa=E;a=qa;if(a===E){var ta,pc,Db,Eb,yc,Yb,zc,Ac,Bc,Zb,Cc,Ea,sb,qc,rc,sc;ta=H;var mb,$b,Lb,Dc;mb=H;r.substr(H,9).toLowerCase()===Id?($b=r.substr(H,9),H+=9):($b=E,0===X&&n(Jd));$b!==E?(Lb=H,X++,Dc=K(),X--,Dc===E?Lb=void 0:(H=Lb,Lb=E),Lb!==E?mb=$b="SUBSTRING":(H=mb,mb=E)):(H=mb,mb=E);pc=mb;if(pc!==
E)if(Db=Z(),Db!==E)if(Eb=la(),Eb!==E)if(yc=Z(),yc!==E)if(Yb=l(),Yb!==E)if(zc=Z(),zc!==E)if(Ac=W(),Ac!==E)if(Bc=Z(),Bc!==E)if(Zb=l(),Zb!==E)if(Cc=Z(),Cc!==E){Ea=H;var nb,ac,Mb,Ec;nb=H;r.substr(H,3).toLowerCase()===Kd?(ac=r.substr(H,3),H+=3):(ac=E,0===X&&n(Ld));ac!==E?(Mb=H,X++,Ec=K(),X--,Ec===E?Mb=void 0:(H=Mb,Mb=E),Mb!==E?nb=ac="FOR":(H=nb,nb=E)):(H=nb,nb=E);sb=nb;sb!==E?(qc=Z(),qc!==E?(rc=l(),rc!==E?(sc=Z(),sc!==E?Ea=sb=[sb,qc,rc,sc]:(H=Ea,Ea=E)):(H=Ea,Ea=E)):(H=Ea,Ea=E)):(H=Ea,Ea=E);Ea===E&&(Ea=
null);Ea!==E?(sb=ia(),sb!==E?ta=pc={type:"function",name:"substring",args:{type:"expr_list",value:Ea?[Yb,Zb,Ea[2]]:[Yb,Zb]}}:(H=ta,ta=E)):(H=ta,ta=E)}else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;else H=ta,ta=E;a=ta;if(a===E){var ha,tb,bc,cc,dc,Oa,ec,ub,fc,gc,Fc,tc,Gc,Hc;ha=H;tb=da();tb!==E?(bc=Z(),bc!==E?(cc=la(),cc!==E?(dc=Z(),dc!==E?(Oa=P(),Oa===E&&(Oa=null),Oa!==E?(ec=Z(),ec!==E?(ub=l(),ub!==E?(fc=Z(),fc!==
E?(gc=W(),gc!==E?(Fc=Z(),Fc!==E?(tc=l(),tc!==E?(Gc=Z(),Gc!==E?(Hc=ia(),Hc!==E?ha=tb={type:"function",name:"trim",args:{type:"expr_list",value:[{type:"string",value:null==Oa?"BOTH":Oa},ub,tc]}}:(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E);ha===E&&(ha=H,tb=da(),tb!==E?(bc=Z(),bc!==E?(cc=la(),cc!==E?(dc=Z(),dc!==E?(Oa=P(),Oa===E&&(Oa=null),Oa!==E?(ec=Z(),ec!==E?(ub=l(),ub!==E?(fc=
Z(),fc!==E?(gc=ia(),gc!==E?ha=tb={type:"function",name:"trim",args:{type:"expr_list",value:[{type:"string",value:null==Oa?"BOTH":Oa},ub]}}:(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E)):(H=ha,ha=E));a=ha;if(a===E){var ua,uc,Ic,Jc,Kc,vc,Lc,Mc,Nc,wc,Oc,Pc;ua=H;var ob,hc,Nb,Qc;ob=H;r.substr(H,8).toLowerCase()===Md?(hc=r.substr(H,8),H+=8):(hc=E,0===X&&n(Nd));hc!==E?(Nb=H,X++,Qc=K(),X--,Qc===E?Nb=void 0:(H=Nb,Nb=E),Nb!==E?ob=hc="POSITION":(H=ob,
ob=E)):(H=ob,ob=E);uc=ob;uc!==E?(Ic=Z(),Ic!==E?(Jc=la(),Jc!==E?(Kc=Z(),Kc!==E?(vc=l(),vc!==E?(Lc=Z(),Lc!==E?(Mc=d(),Mc!==E?(Nc=Z(),Nc!==E?(wc=l(),wc!==E?(Oc=Z(),Oc!==E?(Pc=ia(),Pc!==E?ua=uc={type:"function",name:"position",args:{type:"expr_list",value:[vc,wc]}}:(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E)):(H=ua,ua=E);a=ua;if(a===E){var Aa,ic,Rc,Sc,Tc,vb,Uc,Vc;Aa=H;var Pa,Ob,Pb,Wa;Pa=H;Pa=Ob=J();if(Pa===E)if(Pa=H,
96===r.charCodeAt(H)?(Ob=Wc,H++):(Ob=E,0===X&&n(Xc)),Ob!==E){Pb=[];Yc.test(r.charAt(H))?(Wa=r.charAt(H),H++):(Wa=E,0===X&&n(Zc));if(Wa!==E)for(;Wa!==E;)Pb.push(Wa),Yc.test(r.charAt(H))?(Wa=r.charAt(H),H++):(Wa=E,0===X&&n(Zc));else Pb=E;Pb!==E?(96===r.charCodeAt(H)?(Wa=Wc,H++):(Wa=E,0===X&&n(Xc)),Wa!==E?Pa=Ob=Pb.join(""):(H=Pa,Pa=E)):(H=Pa,Pa=E)}else H=Pa,Pa=E;ic=Pa;ic!==E?(Rc=Z(),Rc!==E?(Sc=la(),Sc!==E?(Tc=Z(),Tc!==E?(vb=q(),vb===E&&(vb=null),vb!==E?(Uc=Z(),Uc!==E?(Vc=ia(),Vc!==E?Aa=ic={type:"function",
name:ic,args:vb?vb:{type:"expr_list",value:[]}}:(H=Aa,Aa=E)):(H=Aa,Aa=E)):(H=Aa,Aa=E)):(H=Aa,Aa=E)):(H=Aa,Aa=E)):(H=Aa,Aa=E)):(H=Aa,Aa=E);a=Aa;if(a===E){var jc,oa,wb,kc,xb,lc,cb,Qa,Qb,$c,ad;oa=H;wb=fa();if(wb!==E)if(kc=Z(),kc!==E)if(xb=l(),xb!==E)if(lc=Z(),lc!==E){cb=[];for(Qa=S();Qa!==E;)cb.push(Qa),Qa=S();cb!==E?(Qa=Z(),Qa!==E?(Qb=aa(),Qb!==E?oa=wb={type:"case_expression",format:"simple",operand:xb,clauses:cb,else:null}:(H=oa,oa=E)):(H=oa,oa=E)):(H=oa,oa=E)}else H=oa,oa=E;else H=oa,oa=E;else H=
oa,oa=E;else H=oa,oa=E;if(oa===E)if(oa=H,wb=fa(),wb!==E)if(kc=Z(),kc!==E)if(xb=l(),xb!==E)if(lc=Z(),lc!==E){cb=[];for(Qa=S();Qa!==E;)cb.push(Qa),Qa=S();cb!==E?(Qa=Z(),Qa!==E?(Qb=T(),Qb!==E?($c=Z(),$c!==E?(ad=aa(),ad!==E?oa=wb={type:"case_expression",format:"simple",operand:xb,clauses:cb,else:Qb.value}:(H=oa,oa=E)):(H=oa,oa=E)):(H=oa,oa=E)):(H=oa,oa=E)):(H=oa,oa=E)}else H=oa,oa=E;else H=oa,oa=E;else H=oa,oa=E;else H=oa,oa=E;jc=oa;if(jc===E){var ra,yb,mc,db,Ra,Rb,bd,cd;ra=H;yb=fa();if(yb!==E)if(mc=
Z(),mc!==E){db=[];for(Ra=R();Ra!==E;)db.push(Ra),Ra=R();db!==E?(Ra=Z(),Ra!==E?(Rb=aa(),Rb!==E?ra=yb={type:"case_expression",format:"searched",clauses:db,else:null}:(H=ra,ra=E)):(H=ra,ra=E)):(H=ra,ra=E)}else H=ra,ra=E;else H=ra,ra=E;if(ra===E)if(ra=H,yb=fa(),yb!==E)if(mc=Z(),mc!==E){db=[];for(Ra=R();Ra!==E;)db.push(Ra),Ra=R();db!==E?(Ra=Z(),Ra!==E?(Rb=T(),Rb!==E?(bd=Z(),bd!==E?(cd=aa(),cd!==E?ra=yb={type:"case_expression",format:"searched",clauses:db,else:Rb.value}:(H=ra,ra=E)):(H=ra,ra=E)):(H=ra,
ra=E)):(H=ra,ra=E)):(H=ra,ra=E)}else H=ra,ra=E;else H=ra,ra=E;jc=ra}a=jc;if(a===E){var Sb,pb,xc,nc,oc;pb=H;xc=I();if(xc!==E){nc=[];for(oc=L();oc!==E;)nc.push(oc),oc=L();nc!==E?pb=xc+=nc.join(""):(H=pb,pb=E)}else H=pb,pb=E;Sb=pb;Sb!==E&&(Sb={type:"column_ref",table:"",column:Sb});a=Sb;a===E&&(a=O(),a===E&&(a=H,b=la(),b!==E?(c=Z(),c!==E?(e=l(),e!==E?(f=Z(),f!==E?(g=ia(),g!==E?(e.paren=!0,a=b=e):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)))}}}}}}}return a}function J(){var a,b,d,c;a=H;b=I();
if(b!==E){d=[];for(c=K();c!==E;)d.push(c),c=K();d!==E?a=b+=d.join(""):(H=a,a=E)}else H=a,a=E;return a}function I(){var a;Ma.test(r.charAt(H))?(a=r.charAt(H),H++):(a=E,0===X&&n(qb));return a}function K(){var a;eb.test(r.charAt(H))?(a=r.charAt(H),H++):(a=E,0===X&&n(Tb));return a}function L(){var a;ed.test(r.charAt(H))?(a=r.charAt(H),H++):(a=E,0===X&&n(fd));return a}function O(){var a,b,d;a=H;64===r.charCodeAt(H)?(b=dd,H++):(b=E,0===X&&n(gd));b!==E?(d=J(),d!==E?a=b=[b,d]:(H=a,a=E)):(H=a,a=E);a!==E&&
(a={type:"param",value:a[1]});return a}function P(){var a,b,d;a=H;r.substr(H,7).toLowerCase()===Od?(b=r.substr(H,7),H+=7):(b=E,0===X&&n(Pd));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="LEADING":(H=a,a=E)):(H=a,a=E);a===E&&(a=H,r.substr(H,8).toLowerCase()===Qd?(b=r.substr(H,8),H+=8):(b=E,0===X&&n(Rd)),b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="TRAILING":(H=a,a=E)):(H=a,a=E),a===E&&(a=H,r.substr(H,4).toLowerCase()===Sd?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(Td)),b!==E?(b=
H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="BOTH":(H=a,a=E)):(H=a,a=E)));return a}function U(){var a;a=N();a===E&&(a=O());return a}function N(){var a,b,d;a=H;39===r.charCodeAt(H)?(b=zb,H++):(b=E,0===X&&n(Ab));b===E&&(r.substr(H,2)===Bb?(b=Bb,H+=2):(b=E,0===X&&n(hd)));if(b!==E){b=[];d=H;r.substr(H,2)===Za?(d=Za,H+=2):(d=E,0===X&&n(Cb));d!==E&&(d="'");d===E&&(Db.test(r.charAt(H))?(d=r.charAt(H),H++):(d=E,0===X&&n(Eb)));for(;d!==E;)b.push(d),d=H,r.substr(H,2)===Za?(d=Za,H+=2):(d=E,0===X&&n(Cb)),
d!==E&&(d="'"),d===E&&(Db.test(r.charAt(H))?(d=r.charAt(H),H++):(d=E,0===X&&n(Eb)));b!==E?(39===r.charCodeAt(H)?(d=zb,H++):(d=E,0===X&&n(Ab)),d!==E?a=b={type:"string",value:b.join("")}:(H=a,a=E)):(H=a,a=E)}else H=a,a=E;return a}function R(){var a,b,d;a=H;b=ea();b!==E?(b=Z(),b!==E?(b=l(),b!==E?(d=Z(),d!==E?(d=ja(),d!==E?(d=Z(),d!==E?(d=l(),d!==E?a=b={type:"when_clause",operand:b,value:d}:(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E);return a}function S(){var a,b,d;a=H;
b=ea();b!==E?(b=Z(),b!==E?(b=l(),b!==E?(d=Z(),d!==E?(d=ja(),d!==E?(d=Z(),d!==E?(d=l(),d!==E?a=b={type:"when_clause",operand:b,value:d}:(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E)):(H=a,a=E);return a}function T(){var a,b;a=H;var d,c;b=H;r.substr(H,4).toLowerCase()===Ud?(d=r.substr(H,4),H+=4):(d=E,0===X&&n(Vd));d!==E?(d=H,X++,c=K(),X--,c===E?d=void 0:(H=d,d=E),d!==E?b="ELSE":(H=b,b=E)):(H=b,b=E);b!==E?(b=Z(),b!==E?(b=l(),b!==E?a={type:"else_clause",value:b}:(H=a,a=E)):(H=a,a=E)):
(H=a,a=E);return a}function V(){var a,b,d;a=Q();a===E&&(a=H,45===r.charCodeAt(H)?(b=bb,H++):(b=E,0===X&&n(ka)),b===E&&(43===r.charCodeAt(H)?(b=Ta,H++):(b=E,0===X&&n(Ua))),b!==E?(d=Q(),d!==E?a=b=b[0]+d:(H=a,a=E)):(H=a,a=E));return a}function h(){var a,b;a=H;46===r.charCodeAt(H)?(b=Wd,H++):(b=E,0===X&&n(Xd));b!==E?(b=Q(),b===E&&(b=null),b!==E?a="."+(null!=b?b:""):(H=a,a=E)):(H=a,a=E);return a}function ca(){var a,b,d;b=a=H;Yd.test(r.charAt(H))?(d=r.charAt(H),H++):(d=E,0===X&&n(Zd));d!==E?($d.test(r.charAt(H))?
(d=r.charAt(H),H++):(d=E,0===X&&n(ae)),d===E&&(d=null),d!==E?b="e"+(null===d?"":d):(H=b,b=E)):(H=b,b=E);b!==E?(d=Q(),d!==E?a=b+d:(H=a,a=E)):(H=a,a=E);return a}function Q(){var a,b;a=[];b=e();if(b!==E)for(;b!==E;)a.push(b),b=e();else a=E;a!==E&&(a=a.join(""));return a}function e(){var a;be.test(r.charAt(H))?(a=r.charAt(H),H++):(a=E,0===X&&n(ce));return a}function d(){var a,b,d;a=H;r.substr(H,2).toLowerCase()===de?(b=r.substr(H,2),H+=2):(b=E,0===X&&n(ee));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=
b,b=E),b!==E?a="IN":(H=a,a=E)):(H=a,a=E);return a}function g(){var a,b,d;a=H;r.substr(H,2).toLowerCase()===fe?(b=r.substr(H,2),H+=2):(b=E,0===X&&n(ge));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="IS":(H=a,a=E)):(H=a,a=E);return a}function m(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===he?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(ie));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="LIKE":(H=a,a=E)):(H=a,a=E);return a}function u(){var a,b,d;a=H;r.substr(H,3).toLowerCase()===je?
(b=r.substr(H,3),H+=3):(b=E,0===X&&n(ke));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="NOT":(H=a,a=E)):(H=a,a=E);return a}function C(){var a,b,d;a=H;r.substr(H,3).toLowerCase()===le?(b=r.substr(H,3),H+=3):(b=E,0===X&&n(me));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="AND":(H=a,a=E)):(H=a,a=E);return a}function M(){var a,b,d;a=H;r.substr(H,2).toLowerCase()===ne?(b=r.substr(H,2),H+=2):(b=E,0===X&&n(oe));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="OR":(H=a,
a=E)):(H=a,a=E);return a}function Y(){var a,b,d;a=H;r.substr(H,7).toLowerCase()===pe?(b=r.substr(H,7),H+=7):(b=E,0===X&&n(qe));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="BETWEEN":(H=a,a=E)):(H=a,a=E);return a}function W(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===re?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(se));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="FROM":(H=a,a=E)):(H=a,a=E);return a}function da(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===te?(b=r.substr(H,4),H+=
4):(b=E,0===X&&n(ue));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="TRIM":(H=a,a=E)):(H=a,a=E);return a}function fa(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===ve?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(we));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="CASE":(H=a,a=E)):(H=a,a=E);return a}function aa(){var a,b,d;a=H;r.substr(H,3).toLowerCase()===xe?(b=r.substr(H,3),H+=3):(b=E,0===X&&n(ye));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="END":(H=a,a=E)):(H=a,a=E);
return a}function ea(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===ze?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(Ae));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="WHEN":(H=a,a=E)):(H=a,a=E);return a}function ja(){var a,b,d;a=H;r.substr(H,4).toLowerCase()===Be?(b=r.substr(H,4),H+=4):(b=E,0===X&&n(Ce));b!==E?(b=H,X++,d=K(),X--,d===E?b=void 0:(H=b,b=E),b!==E?a="THEN":(H=a,a=E)):(H=a,a=E);return a}function ga(){var a;44===r.charCodeAt(H)?(a=De,H++):(a=E,0===X&&n(Ee));return a}function la(){var a;
40===r.charCodeAt(H)?(a=Fe,H++):(a=E,0===X&&n(Ge));return a}function ia(){var a;41===r.charCodeAt(H)?(a=He,H++):(a=E,0===X&&n(Ie));return a}function Z(){var a,b;a=[];for(b=pa();b!==E;)a.push(b),b=pa();return a}function pa(){var a;Je.test(r.charAt(H))?(a=r.charAt(H),H++):(a=E,0===X&&n(Ke));return a}function ma(a,b,d,c){a={type:"binary_expr",operator:a,left:b,right:d};void 0!==c&&(a.escape=c);return a}function sa(a,b){for(var d=0;d<b.length;d++)a=ma(b[d][1],a,b[d][3]);return a}k=void 0!==k?k:{};var E=
{},na={start:f},wa=f,ya="!",Ba=a("!",!1),xa="\x3d",va=a("\x3d",!1),ba="\x3e\x3d",Ca=a("\x3e\x3d",!1),za="\x3e",Da=a("\x3e",!1),Ja="\x3c\x3d",ab=a("\x3c\x3d",!1),Xa="\x3c\x3e",qa=a("\x3c\x3e",!1),Ga="\x3c",Sa=a("\x3c",!1),Ya="!\x3d",Fa=a("!\x3d",!1),Ta="+",Ua=a("+",!1),bb="-",ka=a("-",!1),Ka="*",La=a("*",!1),Ha="/",Va=a("/",!1),Ma=/^[A-Za-z_\x80-\uFFFF]/,qb=b([["A","Z"],["a","z"],"_",["\u0080","\uffff"]],!1,!1),eb=/^[A-Za-z0-9_]/,Tb=b([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ed=/^[A-Za-z0-9_.\x80-\uFFFF]/,
fd=b([["A","Z"],["a","z"],["0","9"],"_",".",["\u0080","\uffff"]],!1,!1),dd="@",gd=a("@",!1),zb="'",Ab=a("'",!1),Bb="N'",hd=a("N'",!1),Za="''",Cb=a("''",!1),Db=/^[^']/,Eb=b(["'"],!0,!1),Wd=".",Xd=a(".",!1),be=/^[0-9]/,ce=b([["0","9"]],!1,!1),Yd=/^[eE]/,Zd=b(["e","E"],!1,!1),$d=/^[+\-]/,ae=b(["+","-"],!1,!1),od="null",pd=a("NULL",!0),kd="true",ld=a("TRUE",!0),md="false",nd=a("FALSE",!0),de="in",ee=a("IN",!0),fe="is",ge=a("IS",!0),he="like",ie=a("LIKE",!0),id="escape",jd=a("ESCAPE",!0),je="not",ke=a("NOT",
!0),le="and",me=a("AND",!0),ne="or",oe=a("OR",!0),pe="between",qe=a("BETWEEN",!0),re="from",se=a("FROM",!0),Kd="for",Ld=a("FOR",!0),Id="substring",Jd=a("SUBSTRING",!0),ud="extract",vd=a("EXTRACT",!0),te="trim",ue=a("TRIM",!0),Md="position",Nd=a("POSITION",!0),sd="timestamp",td=a("TIMESTAMP",!0),qd="date",rd=a("DATE",!0),Od="leading",Pd=a("LEADING",!0),Qd="trailing",Rd=a("TRAILING",!0),Sd="both",Td=a("BOTH",!0),wd="year",xd=a("YEAR",!0),yd="month",zd=a("MONTH",!0),Ad="day",Bd=a("DAY",!0),Cd="hour",
Dd=a("HOUR",!0),Ed="minute",Fd=a("MINUTE",!0),Gd="second",Hd=a("SECOND",!0),ve="case",we=a("CASE",!0),xe="end",ye=a("END",!0),ze="when",Ae=a("WHEN",!0),Be="then",Ce=a("THEN",!0),Ud="else",Vd=a("ELSE",!0),De=",",Ee=a(",",!1),Fe="(",Ge=a("(",!1),He=")",Ie=a(")",!1),Je=/^[ \t\n\r]/,Ke=b([" ","\t","\n","\r"],!1,!1),Wc="`",Xc=a("`",!1),Yc=/^[^`]/,Zc=b(["`"],!0,!1),H=0,fb=[{line:1,column:1}],Ia=0,rb=[],X=0,$a;if("startRule"in k){if(!(k.startRule in na))throw Error("Can't start parsing from rule \""+k.startRule+
'".');wa=na[k.startRule]}$a=wa();if($a!==E&&H===r.length)return $a;$a!==E&&H<r.length&&n({type:"end"});throw function(a,b,d){return new x(x.buildMessage(a,b),a,b,d)}(rb,Ia<r.length?r.charAt(Ia):null,Ia<r.length?t(Ia,Ia+1):t(Ia,Ia));}}})},"esri/core/sql/StandardizedFunctions":function(){define(["require","exports","dojo/regexp"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});r.evaluateFunction=function(b,c){var k=a[b.toLowerCase()];if(null==k)throw Error("Function Not Recognised");
if(c.length<k.minParams||c.length>k.maxParams)throw Error("Invalid Parameter count for call to "+b.toUpperCase());return k.evaluate(c)};r.isStandardized=function(b,c){b=a[b.toLowerCase()];return null!=b&&c>=b.minParams&&c<=b.maxParams};var a={extract:{minParams:2,maxParams:2,evaluate:function(a){var b=a[0];a=a[1];if(null==a)return null;if(a instanceof Date)switch(b.toUpperCase()){case "SECOND":return a.getSeconds();case "MINUTE":return a.getMinutes();case "HOUR":return a.getHours();case "DAY":return a.getDate();
case "MONTH":return a.getMonth()+1;case "YEAR":return a.getFullYear()}throw Error("Invalid Parameter for call to EXTRACT");}},substring:{minParams:2,maxParams:3,evaluate:function(a){if(2===a.length){var b=a[0],k=a[1];return null==b||null==k?null:b.toString().substring(k-1)}if(3===a.length)return b=a[0],k=a[1],a=a[2],null==b||null==k||null==a?null:0>=a?"":b.toString().substring(k-1,k+a-1)}},position:{minParams:2,maxParams:2,evaluate:function(a){var b=a[0];a=a[1];return null==b||null==a?null:a.indexOf(b)+
1}},trim:{minParams:2,maxParams:3,evaluate:function(a){var b=3===a.length,t=b?a[1]:" ",b=b?a[2]:a[1];if(null==t||null==b)return null;t="("+k.escapeString(t)+")";switch(a[0]){case "BOTH":return b.replace(new RegExp("^"+t+"*|"+t+"*$","g"),"");case "LEADING":return b.replace(new RegExp("^"+t+"*","g"),"");case "TRAILING":return b.replace(new RegExp(t+"*$","g"),"")}throw Error("Invalid Parameter for call to TRIM");}},abs:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.abs(a[0])}},
ceiling:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.ceil(a[0])}},floor:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.floor(a[0])}},log:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])}},log10:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])*Math.LOG10E}},sin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.sin(a[0])}},cos:{minParams:1,maxParams:1,
evaluate:function(a){return null==a[0]?null:Math.cos(a[0])}},tan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.tan(a[0])}},asin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.asin(a[0])}},acos:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.acos(a[0])}},atan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.atan(a[0])}},sign:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:
0<a[0]?1:0>a[1]?-1:0}},power:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:Math.pow(a[0],a[1])}},mod:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:a[0]%a[1]}},round:{minParams:1,maxParams:2,evaluate:function(a){var b=a[0];a=2===a.length?Math.pow(10,a[1]):1;return null==b?null:Math.round(b*a)/a}},truncate:{minParams:1,maxParams:2,evaluate:function(a){return null==a[0]?null:1===a.length?parseInt(a[0].toFixed(0),10):parseFloat(a[0].toFixed(a[1]))}},
char_length:{minParams:1,maxParams:1,evaluate:function(a){return"string"===typeof a[0]||a[0]instanceof String?a[0].length:0}},concat:{minParams:1,maxParams:Infinity,evaluate:function(a){for(var b="",k=0;k<a.length;k++){if(null==a[k])return null;b+=a[k].toString()}return b}},lower:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:a[0].toString().toLowerCase()}},upper:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:a[0].toString().toUpperCase()}}}})},"esri/views/3d/layers/SceneLayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../layers/IntegratedMeshLayer ../../../core/arrayUtils ../../../core/watchUtils ../../../core/promiseUtils ../../../core/Logger ../../../core/Collection ../../../core/Scheduler ../../../core/lang ../../../geometry/support/scaleUtils ../../../symbols/support/unitConversionUtils dojo/_base/lang dojo/has dojo/errors/CancelError ../../../Graphic ../../../symbols/Symbol3D ../../../tasks/support/Query ./LayerView3D ./i3s/I3SUtil ./i3s/I3SElevationProvider ./i3s/I3SGeometryUtil ./i3s/I3SProjectionUtil ./i3s/I3SQueryEngine ./i3s/Highlights ./i3s/IDBCache ./graphics/graphicUtils ./support/LayerViewUpdatingPercentage ../support/projectionUtils ../support/aaBoundingBox ../webgl-engine/Stage ../webgl-engine/lib/Layer ../webgl-engine/lib/Geometry ../webgl-engine/lib/PreinterleavedGeometryData ../webgl-engine/lib/Object3D ../webgl-engine/lib/Texture ../webgl-engine/materials/Material ./support/attributeUtils ../webgl-engine/lib/Util ../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S,T,V,h,ca,Q,e,d,g,m,u,C,M){function Y(a,b,d,c,e){var f=!1,h;b.encoding===I.DDS_ENCODING_STRING?h=g.DDS_ENCODING:f=!(C.isPowerOfTwo(a.width)&&C.isPowerOfTwo(a.height));d=((a=b.usedByEngineMats.some(function(a){return a.getParams().atlasRegions})||b.atlas)?c:d)&&!f;return{mipmap:d,wrapClamp:a||!b.wrap,disableAnisotropy:a&&d&&e,encoding:h,noUnpackFlip:!0}}function W(a){return a.data instanceof ArrayBuffer}function da(a,b){for(var d=
1024,c=0;c<a.length;c++)d+=a[c].interleavedVertexData.byteLength;for(a=0;a<b.length;a++)c=b[a],c.data instanceof ArrayBuffer&&(d+=c.data.byteLength);return d}var fa=h.ModelContentType,aa=q.getLogger("esri.views.3d.layers.SceneLayerView3D"),ea=[1,1,1,1],ja=[.8,.8,.8],ga=[.5,.5,.5];x=function(h){function q(){var a=null!==h&&h.apply(this,arguments)||this;a._queryEngine=null;a._highlights=new U(a);a._elevationProvider=null;a._controllerCreated=!1;a._idbCache=new N.IDBCache("esri-scenelayer-cache","geometries",
4);a._cancelCount=0;a._hasColors=!1;a._hasTextures=!1;a._hasData=!1;a.alwaysLoadEverythingModeEnabled=!1;a._cacheKeySuffix=null;a._definitionExpressionErrors=0;a._maxDefinitionExpressionErrors=20;return a}k(q,h);Object.defineProperty(q.prototype,"hasTexturesOrVertexColors",{get:function(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"rendererNeedsTextures",{get:function(){return I.rendererNeedsTextures(this.layer.renderer)},
enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"elevationOffset",{get:function(){var a=null!=this.layer?this.layer.elevationInfo:null;if(null!=a&&"absolute-height"===a.mode){var b=v.getMetersPerVerticalUnitForSR(this.layer.spatialReference),d=w.getMetersPerUnit(a.unit);return(a.offset||0)*d/b}return 0},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"uncompressedTextureDownsamplingEnabled",{get:function(){return this.view.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled&&
!this._useCompressedTextures},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"_useCompressedTextures",{get:function(){return this.view.has("s3tc")&&!0},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"_enableMipMaps",{get:function(){return!this.uncompressedTextureDownsamplingEnabled},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"_enableAtlasMipMaps",{get:function(){return this._enableMipMaps&&this.view.has("standardDerivatives")},enumerable:!0,
configurable:!0});Object.defineProperty(q.prototype,"_atlasBiasCompensationEnabled",{get:function(){return!this.view.has("shaderTextureLOD")&&this._enableAtlasMipMaps},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"_disableAtlasAnisotropy",{get:function(){return this._atlasBiasCompensationEnabled},enumerable:!0,configurable:!0});q.prototype.initialize=function(){var a=this;I.checkSceneLayerValid(this.layer);I.checkSceneLayerCompatibleWithView(this.layer,this.view);this._initGraphicsController();
this.maxGpuMemory=1E3;this.geoMemoryEstimate=this.texMemoryEstimate=this.gpuMemoryEstimate=0;this._stage=this.view._stage;this._matId2Meta={};this._texId2Meta={};this._nodeId2Meta={};this._addThisLayerToStage();this._elevationProvider=new K({layerView:this,stageLayer:this._stageLayer});this.handles.add([n.init(this.view,"clippingArea",function(){return a._clippingAreaChanged()}),n.init(this.layer,"renderer",function(b){return a._rendererChange(b)}),n.init(this.layer,"objectIdFilter",function(){return a._filterChange()}),
n.init(this.layer,"elevationInfo",function(){return a._elevationInfoChanged()}),n.init(this,"_controller.parsedDefinitionExpression",function(){return a._filterChange()}),n.watch(this,"fullOpacity",function(b){return a._opacityChange(b)}),n.watch(this,["elevationOffset","rendererNeedsTextures"],function(){return a._reloadAll()}),n.watch(this,"uncompressedTextureDownsamplingEnabled",function(){return a._reloadAll()}),n.init(this,"suspended",function(b){return a.setVisibility(!b)})],"sceneLayerHandles");
this._idbCache.init();this._cacheKeySuffix=I.getCacheKeySuffix(this.layer.spatialReference,this.view.renderSpatialReference)};q.prototype.destroy=function(){this.handles.remove("sceneLayerHandles");this._removeThisLayerFromStage();this._stage=null;this._idbCache&&(this._idbCache.destroy(),this._idbCache=null);null!=this._controller&&(this._controller.destroy(),this._controller=null);this._highlights.destroy();this._nodeId2Meta=this._texId2Meta=this._matId2Meta=null;this.emit("visible-geometry-changed");
this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)};q.prototype.canResume=function(){return this.inherited(arguments)&&(!this._controller||this._controller.rootNodeVisible)};q.prototype.isUpdating=function(){return this._controllerCreated?!(!this._controller||!this._controller.updating):!0};q.prototype.memEstimateTextureAdded=function(a){a=a.getEstimatedTexMemRequiredMB();this.gpuMemoryEstimate+=a;this.texMemoryEstimate+=
a};q.prototype.memEstimateTextureRemoved=function(a){a=a.getEstimatedTexMemRequiredMB();this.gpuMemoryEstimate-=a;this.texMemoryEstimate-=a};q.prototype.memEstimateGeometryAdded=function(a){a=a.estimateGpuMemoryUsage()/1E6;this.gpuMemoryEstimate+=a;this.geoMemoryEstimate+=a};q.prototype.memEstimateGeometryRemoved=function(a){a=a.estimateGpuMemoryUsage()/1E6;this.gpuMemoryEstimate-=a;this.geoMemoryEstimate-=a};q.prototype.isBundleAlreadyAddedToStage=function(a,b){return null!=this._nodeId2Meta[a.id]&&
null!=this._nodeId2Meta[a.id].engineObjectsPerBundle&&null!=this._nodeId2Meta[a.id].engineObjectsPerBundle[b]};q.prototype._initGraphicsController=function(){var a=this;this.layer.createGraphicsController({layerView:this,layerViewRequiredFunctions:{addBundle:function(b,d,c){return a._addBundle(b,d,c)},isBundleAlreadyAddedToStage:function(b,d){return a.isBundleAlreadyAddedToStage(b,d)},isOverMemory:function(){return a._isOverMemory()},removeNodeData:function(b){return a._removeNodeDataFromStage(b.id)},
getAddedNodeIDs:function(){return a._getAddedNodeIDs()},areAllBundlesLoaded:function(b){return a._areAllBundlesLoaded(b)}},layerViewOptionalFunctions:{setPolygonOffset:function(b,d){return a._setPolygonOffset(b,d?1:0)},traversalOptions:{initDepthFirst:!1,neighborhood:!0,perLevelTraversal:!1,allowPartialOverlaps:!1},textureOptions:{useCompressedTextures:this._useCompressedTextures},getLoadedAttributes:function(b){return a._getLoadedAttributes(b)},setAttributeData:function(b,d,c){return a._setAttributeData(b,
d,c)},additionalCancelNodeLoadingHandler:function(){return a._cancel()},loadCachedBundle:function(b,d,c){return a._loadCachedBundle(b,d,c)},addCachedBundle:function(b,d,c,e){return a._addCachedBundle(b,d,c,e)}}}).then(function(b){a._controller=b;b.watch("rootNodeVisible",function(){a.notifyChange("suspended")})}).always(function(){a._controllerCreated=!0;a.notifyChange("updating")})};q.prototype.setMaxGpuMemory=function(a){this.maxGpuMemory=a};q.prototype.setVisibility=function(a){if(this._stage&&
this._stageLayer){var b=this._stageLayer.getId(),d=0<=this._stage.getViewContent().indexOf(b);!!a!==d&&(b=[b],a?(this._stage.addToViewContent(b),a=this._isIntegratedMesh()?"im":"scene",this.view.elevationProvider.register(a,this._elevationProvider),this.visibleGeometryChanged()):(this._stage.removeFromViewContent(b),this.visibleGeometryChanged(),this.view.elevationProvider.unregister(this._elevationProvider)))}};q.prototype.getStats=function(){var a={nodesInIndex:0,knownFeatures:0,activeMaterials:0,
"Total GPU Memory Estimate":this.gpuMemoryEstimate+"MB","Geometry Memory Estimate":this.geoMemoryEstimate+"MB","Texture Memory Estimate":this.texMemoryEstimate+"MB"};if(!this._controller)return a;a.nodesInIndex=Object.keys(this._controller.nodeIndex).length;a.activeMaterials=Object.keys(this._matId2Meta).length;return a};q.prototype._addThisLayerToStage=function(){for(var a=this._stage,b=new Uint8Array(256),d=0;d<b.length;d++)b[d]=255;this._whiteTexture=new g(b,"white",{width:8,height:8});a.add(fa.TEXTURE,
this._whiteTexture);b=this.layer.id;this._stageLayer=b=new ca(b,{},b);a.add(fa.LAYER,b)};q.prototype._removeThisLayerFromStage=function(){if(null!=this._stageLayer){var a=this._stage;a.remove(fa.TEXTURE,this._whiteTexture.getId());this._removeAllNodeDataFromStage();C.assert(C.objectEmpty(this._nodeId2Meta));C.assert(C.objectEmpty(this._matId2Meta));C.assert(C.objectEmpty(this._texId2Meta));a.remove(fa.LAYER,this._stageLayer.getId());this._matId2Meta={};this._texId2Meta={};this._nodeId2Meta={};this._stageLayer=
void 0;this.gpuMemoryEstimate=0}};q.prototype._getLoadedAttributes=function(a){if((a=this._nodeId2Meta[a.id])&&1===a.engineObjects.length)return a.engineObjects[0].getMetadata().loadedAttributes};q.prototype._setAttributeData=function(a,b,d){var c=this._nodeId2Meta[a.id];if(c&&1===c.engineObjects.length){var c=c.engineObjects[0],e=c.getMetadata();e.loadedAttributes=b;e.attributeData=d;this._setObjectSymbology(c);this._applyFilters(a);this.visibleGeometryChanged(c)}};q.prototype._isOverMemory=function(){if(this.gpuMemoryEstimate>
this.maxGpuMemory&&this.gpuMemoryEstimate!==this.warnGpuMemoryEstimate){this.warnGpuMemoryEstimate=this.gpuMemoryEstimate;var a=function(a){return a.toLocaleString(void 0,{maximumFractionDigits:1})+" Mb"};aa.warn("GPU Memory Limit exceeded!\nLimit: "+a(this.maxGpuMemory)+" Current: "+a(this.gpuMemoryEstimate)+"\n(Textures: "+a(this.texMemoryEstimate)+" Geometry: "+a(this.geoMemoryEstimate)+")")}return this.gpuMemoryEstimate>this.maxGpuMemory};q.prototype._getAddedNodeIDs=function(){return Object.keys(this._nodeId2Meta)};
q.prototype._calcEngineMaterialTransparencyParams=function(a,b,d){var c=this.fullOpacity,e=1-C.clamp(C.fallbackIfUndefined(b.transparency,0),0,1);a=1>e||1>c||a&&B.endsWith(a.channels,"a")||!0===b.useVertexColorAlpha||d;return{opacity:e,layerOpacity:c,transparent:a}};q.prototype._calcEngineMaterialDoubleSidedParams=function(a){return null!=a.doubleSided?a.doubleSided:!0};q.prototype._calcEngineMaterialCullFaceParams=function(a){return a.cullFace?a.cullFace:null!=a.doubleSided?a.doubleSided?"none":
"back":"none"};q.prototype._getMaterialParameters=function(a,b,d){var c;null!=a&&(c=(c=this._texId2Meta[b])&&c.engineTex?c.engineTex.getId():this._whiteTexture.getId());b=d.params;var e=C.fallbackIfUndefined(b.diffuse,ja);"standard"!==d.type&&aa.warn("Unknown material type '"+d.type+"', must be 'standard'");void 0===b.reflectivity&&aa.warn("Material parameter 'reflectivity' is missing.");d=this._isIntegratedMesh();c={ambient:e,diffuse:e,specular:C.fallbackIfUndefined(b.specular,ga),shininess:C.fallbackIfUndefined(b.shininess,
64),atlasRegions:b.vertexRegions,textureId:c,vertexColors:this._hasVertexColors(),symbolColors:this._hasSymbolColors(),flipV:!1,doubleSided:this._calcEngineMaterialDoubleSidedParams(b),cullFace:this._calcEngineMaterialCullFaceParams(b),writeStencil:d,receiveSSAO:!d,groundNormalShading:d};d||(a=this._calcEngineMaterialTransparencyParams(a,b),D.mixin(c,a));return c};q.prototype._createEngineMaterial=function(a,b,d,c,e){var f=null!=a?this._getI3STexEncoding(a):null,h=this._getMaterialParameters(a,b,
d),h=new m(h,c);h.metadata={i3sMatId:c,i3sTexId:b,i3sTex:a,i3sMatParams:d.params};if(null!=a){(d=this._texId2Meta[b])?d.usedByEngineMats.push(h):(d={id:b,usedByEngineMats:[h],images:a.images,encoding:f,atlas:!0===a.atlas,wrap:"none"!==a.wrap[0]||"none"!==a.wrap[1]},this._texId2Meta[b]=d);a:{for(a=0;a<e.length;a++)if(f=e[a],f.i3sTexId===b){e=f.data;break a}e=null}null!=e&&null==d.engineTex&&(a=Y(e,d,this._enableMipMaps,this._enableAtlasMipMaps,this._disableAtlasAnisotropy),d.engineTex=new g(e,d.id,
a),this._stage.add(fa.TEXTURE,d.engineTex),this.memEstimateTextureAdded(d.engineTex));if(null!=d.engineTex)for(e=d.engineTex.getId(),a=0,d=d.usedByEngineMats;a<d.length;a++)d[a].setParameterValues({textureId:e})}this._matId2Meta[c]||(this._matId2Meta[c]={});this._matId2Meta[c][b]={engineMat:h,refCount:1};return h};q.prototype._getI3STexEncoding=function(a){var b=I.getAppropriateTextureEncoding(a.encoding,this._useCompressedTextures);return-1<b?a.encoding[b]:a.encoding};q.prototype._hasNonWhiteColors=
function(a){var b=a.data,d=a.size,c=a.strideIdx;for(a=a.offsetIdx;a<b.length;a+=c)for(var e=0;e<d;e++)if(255!==b[a+e])return!0;return!1};q.prototype._getVertexBufferLayout=function(a,b){var d=a.params.materialID,c=b.materialDefinitions[d];C.assert(void 0!==c,"geometry wants unknown material "+d);a=a.params.textureID||"none";var e;"none"!==a&&(null!=b.textureDefinitions&&null!=b.textureDefinitions[a]||aa.warn("textureDefinitions missing in shared resource"),e=b.textureDefinitions[a]);b=this._getMaterialParameters(e,
a,c);return m.getVertexBufferLayout(b)};q.prototype._createEngineMat=function(a,b,d){var c=a.params.materialID,e=b.materialDefinitions[c];C.assert(void 0!==e,"geometry wants unknown material "+c);a=a.params.textureID||"none";var f;"none"!==a&&(null!=b.textureDefinitions&&null!=b.textureDefinitions[a]||aa.warn("textureDefinitions missing in shared resource"),f=b.textureDefinitions[a]);this._matId2Meta[c]&&this._matId2Meta[c][a]?(d=this._matId2Meta[c][a],b=d.engineMat,d.refCount++):b=this._createEngineMaterial(f,
a,e,c,d);return b};q.prototype._areAllBundlesLoaded=function(a){if(null==this._nodeId2Meta[a.id]||null==this._nodeId2Meta[a.id].engineObjectsPerBundle)return!1;for(var b=0;b<a.featureData.length;b++)if(null==this._nodeId2Meta[a.id].engineObjectsPerBundle[b])return!1;return!0};q.prototype._getObjectIdField=function(){return this.layer.objectIdField||"OBJECTID"};q.prototype._findGraphicNodeAndIndex=function(a){a=u.attributeLookup(a.attributes,this._getObjectIdField());for(var b=0,d=Object.keys(this._nodeId2Meta);b<
d.length;b++)for(var c=d[b],e=this._nodeId2Meta[c].engineObjects,f=0;f<e.length;f++){var g=e[f].getMetadata().featureIds.indexOf(a);if(-1!==g)return{node:this._controller.nodeIndex[c],nodeId:c,bundleNr:f,index:g}}return null};q.prototype._getGraphicIndices=function(a,b,d){a=this._nodeId2Meta[a.id].engineObjects;if(!a||!a[b])return[];b=a[b].getMetadata();a=[];for(var c=this._getObjectIdField(),e=0;e<d.length;e++){var f=u.attributeLookup(d[e].attributes,c),f=b.featureIds.indexOf(f);-1!==f&&a.push(f)}return a};
q.prototype.whenGraphicBounds=function(a){a=this._findGraphicNodeAndIndex(a);if(null!=a&&(a=this._boundingBoxCornerPoints(a.index,this._nodeId2Meta[a.nodeId].engineObjects[a.bundleNr],new Float64Array(24)),T.bufferToBuffer(a,this.view.renderSpatialReference,0,a,this.view.spatialReference,0,8))){var b=V.create(V.NEGATIVE_INFINITY);V.expandBuffer(b,a,0,8);return f.resolve({boundingBox:b,screenSpaceObjects:[]})}return f.reject()};q.prototype.whenGraphicAttributes=function(a,b){var d=this;return I.whenGraphicAttributes(this.layer,
[a],this._getObjectIdField(),b,function(){var b=d._findGraphicNodeAndIndex(a);return{node:b.node,indices:[b.index]}},{ignoreUnavailableFields:!0,populateObjectId:!0}).then(function(a){return a[0]})};q.prototype.getGraphicsFromStageObject=function(a,b){if(this.layer instanceof c)return f.reject();var d=a.getMetadata();a=a.getComponentFromTriangleNr(0,b);return null!=a&&null!=d.featureIds&&a<d.featureIds.length?(d=this._createGraphic(a,d),f.resolve(d)):f.reject()};q.prototype._getCacheKey=function(a){return a.baseUrl+
this._cacheKeySuffix};q.prototype._cachingEnabled=function(){return!this._controller.disableCache&&0===this.elevationOffset&&null!=this._cacheKeySuffix};q.prototype._cancel=function(){this._cancelCount=this._cancelCount+1|0};q.prototype._handleCancelled=function(a){if(0<(this._cancelCount-a|0))throw new G;};q.prototype._loadCachedBundle=function(a,b,d){var c=this,e=this._cancelCount;return this._cachingEnabled()?this._idbCache.get(this._getCacheKey(a)).then(function(b){if(null==b)return null;c._handleCancelled(e);
if(b.nodeVersion!==a.version)return c._idbCache.remove(c._getCacheKey(a)),null;var f=function(a){if(null==a.data)return!0;var d=c._getI3STexEncoding(b.sharedResource.textureDefinitions[a.i3sTexId]);return a.encoding!==d};return c.rendererNeedsTextures&&b.textureData.some(f)?d(b.allGeometryData,b.sharedResource).then(function(d){b.textureData=d;d.every(W)&&c._idbCache.put(c._getCacheKey(a),b).otherwise(function(){return aa.warn("Failed to update node with textures in IndexedDB cache: "+a.id)});c._handleCancelled(e);
return b}):b}):f.resolve(null)};q.prototype._addBundle=function(a,b,d){var c=this;return this._transformBundle(a,b,d).then(function(e){if(c._cachingEnabled()){var f=e.allGeometryData,g=e.transformedGeometries,h=e.sharedResource,k=e.byteSize,l=e.textureData.map(function(a){return W(a)?a:{i3sTexId:a.i3sTexId,encoding:a.encoding,data:null}});c._idbCache.put(c._getCacheKey(a),{allGeometryData:f,transformedGeometries:g,textureData:l,sharedResource:h,nodeVersion:a.version,byteSize:k}).otherwise(function(){return aa.warn("Failed to store node in IndexedDB cache: "+
a.id)})}return c._addCachedBundle(a,b,e,d.attributeDataInfo)})};q.prototype._transformBundle=function(a,b,d){b=d.allGeometryData;var c=d.geometryBuffer,g=d.textureData,h=d.sharedResource,k=this._hasColors,l=[];for(d=0;d<b.length;d++)for(var m=b[d],n=m.componentOffsets,p=function(b){var d=q._getVertexBufferLayout(b,h);b=L.interleaveGeometryBuffer(b,c,d,[{name:C.VertexAttrConstants.NORMAL,byteValue:0},{name:C.VertexAttrConstants.COLOR,byteValue:255},{name:C.VertexAttrConstants.SYMBOLCOLOR,byteValue:0}]);
var f=new e(new Float32Array(b),d,n||e.DefaultOffsets),g=q._controller.crsIndex,m=q._controller.crsVertex,p=q.view.renderSpatialReference,t=M.vec4d.set(a.mbs,pa);t[2]+=q.elevationOffset;m=O.reprojectPoints(O.ReprojectionTypes.PER_VERTEX,f.getAttribute(C.VertexAttrConstants.POSITION),t,g,m,p);if(!q._isIntegratedMesh()&&q._controller.isMeshPyramid){var r={normals:f.getAttribute(C.VertexAttrConstants.NORMAL),positions:f.getAttribute(C.VertexAttrConstants.POSITION),normalInd:f.getIndices(C.VertexAttrConstants.NORMAL),
positionInd:f.getIndices(C.VertexAttrConstants.POSITION)};I.processNormals(r,q.layer.normalReferenceFrame||"none",function(a,b){return O.reprojectNormalsPerVertex(a,t,g,b,p)})}(f=f.getAttribute(C.VertexAttrConstants.COLOR))&&(k=k||q._hasNonWhiteColors(f));l.push({layout:d,interleavedVertexData:b,corMatrices:m,hasNonWhiteColors:k})},q=this,t=0,m=m.geometries;t<m.length;t++)p(m[t]);return f.resolve({allGeometryData:b,transformedGeometries:l,textureData:g,sharedResource:h,nodeVersion:a.version,byteSize:da(l,
g)})};q.prototype._addCachedBundle=function(a,b,c,g){if(this._isOverMemory())return f.reject();var h=c.allGeometryData,k=c.transformedGeometries,l=c.textureData,m=c.sharedResource;if(!this.rendererNeedsTextures)for(c=0;c<l.length;c++)l[c].data=null;c=this._stage;var n={};n[fa.OBJECT]={};n[fa.GEOMETRY]={};n[fa.MATERIAL]={};n[fa.TEXTURE]={};var p=this._stageLayer,q=p.getId();if(null!=this._nodeId2Meta[a.id]&&null!=this._nodeId2Meta[a.id].engineObjectsPerBundle&&this._nodeId2Meta[a.id].engineObjectsPerBundle[b])return this._applyFilters(a),
f.resolve();null==this._nodeId2Meta[a.id]&&(this._nodeId2Meta[a.id]={engineObjects:[],engineObjectsPerBundle:[]});this._nodeId2Meta[a.id].engineObjectsPerBundle[b]=[];for(var t=0,r=this._hasColors,v=0;v<h.length;v++){for(var u=h[v],y=u.componentOffsets,z=u.featureIds,w=a.id+"|"+z[0],B=[],A=[],x=[],D=void 0,C=0,u=u.geometries;C<u.length;C++){var F=u[C],E=this._createEngineMat(F,m,l),D=k[t++],r=r||D.hasNonWhiteColors,G=new e(new Float32Array(D.interleavedVertexData),D.layout,y||e.DefaultOffsets),D=
D.corMatrices,I=M.mat4d.create(D.localTrafo);null!=F.transformation&&M.mat4d.multiply(I,F.transformation,I);F=B.length;G=new Q(G,w+(0<F?"_"+F:""));B.push(G);A.push(I);x.push([E]);this.memEstimateGeometryAdded(G.getData());n[fa.MATERIAL][E.getId()]=E;n[fa.GEOMETRY][G.getId()]=G}y=new d({idHint:a.id,name:w,geometries:B,materials:x,transformations:A,castShadow:!0,metadata:{i3sNode:a.id,ceLayer:q,featureIds:z,attributeData:g?g.attributeData:null,loadedAttributes:g?g.loadedAttributes:null,layerUid:this.layer.uid}});
z=M.mat4d.create();M.mat4d.identity(z);M.mat4d.multiply(z,D.globalTrafo,z);y.setObjectTransformation(z);this._nodeId2Meta[a.id].engineObjectsPerBundle[b].push(y);this._nodeId2Meta[a.id].engineObjects.push(y);n[fa.OBJECT][y.getId()]=y;this._setObjectSymbology(y);this._applyFilters(a);this._highlights.objectCreated(y);this.visibleGeometryChanged(y)}c.beginMod();b=n[fa.OBJECT];for(var J in b)b.hasOwnProperty(J)&&p.addObject(b[J]);for(var K in n)if(n.hasOwnProperty(K)){J=n[K];for(var L in J)J.hasOwnProperty(L)&&
null==c.get(K,L)&&c.add(K,J[L])}c.endMod();!this._hasTextures&&null!=a.textureData&&0<a.textureData.length&&(this._hasTextures=!0);this._hasColors=r;this._hasData=!0;this.notifyChange("hasTexturesOrVertexColors");return f.resolve()};q.prototype._clippingAreaChanged=function(){var a=this,b=[];T.extentToBoundingBox(this.view.clippingArea,b,this.view.renderSpatialReference)?this._clippingArea=b:this._clippingArea=null;this._updateFilters();if(this._controller){var d=this._controller.nodeIndex;d&&Object.keys(this._nodeId2Meta).forEach(function(b){return a._applyFilters(d[b])});
this._controller.updateClippingArea(this.view.clippingArea)}};q.prototype._filterChange=function(){this._updateFilters();if(this._controller){var a=this._controller.nodeIndex;if(a)for(var b=0,d=Object.keys(this._nodeId2Meta);b<d.length;b++)this._applyFilters(a[d[b]])}};q.prototype._updateFilters=function(){var a=this,b=[];if(this.layer.objectIdFilter){var d=new Float64Array(this.layer.objectIdFilter.ids),c="include"===this.layer.objectIdFilter.method;d.sort();b.push(function(b,e){return a._objectIdFilter(d,
c,e)})}if(this._controller&&this._controller.parsedDefinitionExpression&&this._controller.definitionExpressionFields){this._definitionExpressionErrors=0;var e=this._controller.parsedDefinitionExpression,f=this._controller.definitionExpressionFields;b.push(function(b,d){return a._sqlFilter(b,e,f,d)})}this._clippingArea&&b.push(function(b,d){return a._boundingboxFilter(b,a._clippingArea,d)});this._filters=b};q.prototype._sqlFilter=function(a,b,d,c){var e={},f=new p(null,null,e);f.layer=this.layer;var g=
this.layer.objectIdField,h=0,k=0,l=function(a){var l=a.getMetadata();a=l.featureIds;for(var n=l.attributeData,l=d.every(function(a){return null!=n[a]||a===g}),p=0;p<a.length&&h<c.length;p++)if(c[h]===a[p]){var q=!0;if(l){e[g]=a[p];for(var q=0,t=d;q<t.length;q++){var r=t[q];r!==g&&(e[r]=I.getCachedAttributeValue(n[r],p))}q=m._evaluateClause(b,f)}q&&(c[k]=c[h],k++);h++}},m=this,n=0;for(a=this._nodeId2Meta[a.id].engineObjects;n<a.length;n++)l(a[n]);c.length=k};q.prototype._evaluateClause=function(a,
b){try{return a.testFeature(b)}catch(ya){return this._definitionExpressionErrors<this._maxDefinitionExpressionErrors&&aa.error("Error while evaluating definitionExpression: "+ya),this._definitionExpressionErrors++,this._definitionExpressionErrors===this._maxDefinitionExpressionErrors&&aa.error("Further errors are ignored"),!1}};q.prototype._objectIdFilter=function(a,b,d){for(var c=0,e=0;c<d.length;)0<=t.binaryIndexOf(a,d[c])===b&&(d[e]=d[c],e++),c++;d.length=e};q.prototype._boundingboxFilter=function(a,
b,d){var c=[0,0,0,0];T.mbsToMbs(a.mbs,this._controller.crsIndex,c,this.view.renderSpatialReference);c=null!=b?I.intersectBoundingBoxWithMbs(b,c):2;if(2!==c)if(0===c)d.length=0;else{var e=c=0,f=0;for(a=this._nodeId2Meta[a.id].engineObjects;f<a.length;f++){var g=a[f],h=g.getMetadata().featureIds,k=g.getObjectTransformation(),l=g.getGeometryRecords()[0].getShaderTransformation();M.mat4d.multiply(k,l);if(0===k[1]&&0===k[2]&&0===k[3]&&0===k[4]&&0===k[6]&&0===k[7]&&0===k[8]&&0===k[9]&&0===k[11]&&1===k[15]){l=
ia;l[0]=(b[0]-k[12])/k[0];l[1]=(b[1]-k[13])/k[5];l[2]=(b[2]-k[14])/k[10];l[3]=(b[3]-k[12])/k[0];l[4]=(b[4]-k[13])/k[5];l[5]=(b[5]-k[14])/k[10];for(var g=g.getGeometryRecords()[0].geometry,k=g.getComponentCount(),m=0;m<k&&c<d.length;m++)if(d[c]===h[m]){var n=g.getComponentAABB(m,Z);V.intersects(l,n)&&(d[e]=d[c],e++);c++}}}d.length=e}};q.prototype._applyFilters=function(a){if(this._nodeId2Meta[a.id]&&null!=this._nodeId2Meta[a.id].engineObjects){for(var b=this._nodeId2Meta[a.id].engineObjects,d=0;d<
b.length;d++){var c=b[d];c.unhideAllComponents()}if(0!==this._filters.length){for(var d=[],e=0;e<b.length;e++)c=b[e],d=d.concat(c.getMetadata().featureIds);c=d.length;for(e=0;e<this._filters.length;e++)this._filters[e](a,d);if(d.length!==c)for(e=a=0;e<b.length;e++)for(var c=b[e],f=c.getGeometryRecords()[0],g=c.getMetadata().featureIds,h=0;h<g.length;h++){var k=g[h];a>=d.length||d[a]!==k?c.setComponentVisibility(f,h,!1):a++}}}};q.prototype._removeAllNodeDataFromStage=function(){for(var a=0,b=Object.keys(this._nodeId2Meta);a<
b.length;a++)this._removeNodeDataFromStage(b[a])};q.prototype._removeNodeDataFromStage=function(a){if(null!=this._nodeId2Meta[a]&&null!=this._nodeId2Meta[a].engineObjects){for(var b=this._stage,d=this._stageLayer,c=this._nodeId2Meta[a].engineObjects,e=0;e<c.length;++e){var f=c[e];this._highlights.objectDeleted(f);this.visibleGeometryChanged(f);d.removeObject(f);for(var g=f.getGeometryRecords(),h=0;h<g.length;h++){var k=g[h];this.memEstimateGeometryRemoved(k.geometry.getData());b.remove(fa.GEOMETRY,
k.geometry.getId());for(var l=0;l<k.materials.length;l++){var m=k.materials[l],n=m.getId(),p=m.metadata.i3sMatId,q=m.metadata.i3sTexId||"none",t=this._matId2Meta[p][q];C.assert(0<t.refCount);t.refCount--;0===t.refCount&&this._removeMaterial(n,q,p,m,b)}}b.remove(fa.OBJECT,f.getId())}delete this._nodeId2Meta[a]}};q.prototype._removeMaterial=function(a,b,d,c,e){e.remove(fa.MATERIAL,a);if("none"!==b){a=this._texId2Meta[b];var f=a.usedByEngineMats;c=f.indexOf(c);C.assert(-1<c);f[c]=f[f.length-1];f.pop();
1>f.length&&((c=a.engineTex)&&c!==this._whiteTexture&&(this.memEstimateTextureRemoved(c),e.remove(fa.TEXTURE,a.engineTex.getId())),a.engineTex=void 0,delete this._texId2Meta[b])}delete this._matId2Meta[d][b];C.objectEmpty(this._matId2Meta[d])&&delete this._matId2Meta[d]};q.prototype._setPolygonOffset=function(a,b){if(null!=this._nodeId2Meta[a.id]&&null!=this._nodeId2Meta[a.id].engineObjectsPerBundle){b={polygonOffset:b};for(var d=0;d<this._nodeId2Meta[a.id].engineObjectsPerBundle.length;d++)for(var c=
this._nodeId2Meta[a.id].engineObjectsPerBundle[d],e=0;e<c.length;e++)for(var f=c[e].getGeometryRecords(),g=0;g<f.length;g++)for(var h=f[g].materials,k=0;k<h.length;k++)h[k].setParameterValues(b)}};q.prototype._rendererChange=function(a){(this._currentRenderer=a)&&(a.colorInfo||a.sizeInfo)&&aa.warn("renderer.colorInfo and renderer.sizeInfo are not supported for Scene Services. Use visualVariables instead.");if(a){var b=0;for(a=a.getSymbols();b<a.length;b++){var d=a[b];"mesh-3d"!==d.type&&aa.error("Symbols of type '"+
d.type+"' are not supported for 3D Object Scene Services.")}}};q.prototype._getRenderingInfo=function(a){var b=this._currentRenderer,d=b&&b.getSymbol(a);if(!(d instanceof z&&this._hasSymbolColors()))return null;var d={symbol:d},c,e;if(b&&b.visualVariables)for(a=b.getVisualVariableValues(a),b=0;b<a.length;b++){var f=a[b],g=f.variable.type;"color"===g?c=f.value:"opacity"===g&&(e=f.value)}c&&(d.color=[c.r/255,c.g/255,c.b/255]);null!=e?d.opacity=e:c&&null!=c.a&&(d.opacity=c.a);return d};q.prototype._getSymbolFillMaterial=
function(a,b){var d=0;for(a=a.symbolLayers.items;d<a.length;d++){var c=a[d];if("fill"===c.type){d=c.material;a=null!=d?d.color:null;null!=a?(ma[0]=a.r/255,ma[1]=a.g/255,ma[2]=a.b/255,ma[3]=a.a,b.color=ma):b.color=null;b.colorMixMode=null!=d?d.colorMixMode:null;return}}b.color=null;b.colorMixMode=null};q.prototype._hasSymbolColors=function(){if(this._isIntegratedMesh()||!this.layer.store.defaultGeometrySchema)return!1;var a=this.layer.store.defaultGeometrySchema.featureAttributes;return a&&a.faceRange&&
a.id};q.prototype._isIntegratedMesh=function(){return this.layer instanceof c};q.prototype._hasVertexColors=function(){return null!=this.layer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.layer.cachedDrawingInfo||!this.layer.cachedDrawingInfo.color)};q.prototype._setObjectSymbology=function(a){if(this._hasSymbolColors()){for(var b=a.getMetadata(),d=b.featureIds?b.featureIds.length:1,c=new p(null,null,{}),e=c.attributes,f=this.layer.objectIdField,g=this._currentRenderer&&this._currentRenderer.requiredFields,
h=a.geometryRecords[0].geometry,k=h.data.getAttribute(C.VertexAttrConstants.SYMBOLCOLOR),l=!1,m=new Uint8Array(4),n={color:null,colorMixMode:null},q=null,t=0;t<d;t++){null!=f&&null!=b.featureIds&&(e[f]=b.featureIds[t]);if(null!=g&&null!=b.attributeData)for(var r=0,v=g;r<v.length;r++){var u=v[r];null!=b.attributeData[u]&&(e[u]=I.getCachedAttributeValue(b.attributeData[u],t))}(v=this._getRenderingInfo(c))?(v.symbol!==q&&(q=v.symbol,this._getSymbolFillMaterial(v.symbol,n)),r=v.color,v=v.opacity,r=null==
r||null==v?R.overrideColor(r,v,n.color,n.color&&n.color[3],ea):R.overrideColor(r,v,null,null,ea),1>r[3]&&(l=!0),I.encodeSymbolColor(r,n.colorMixMode,m)):I.encodeSymbolColor(null,null,m);this._setComponentColor(h,t,k,m)}a.geometryColorAttrsUpdated(0);a=a.getGeometryRecords();for(b=0;b<a.length;b++)for(d=a[b],c=0;c<d.materials.length;c++)e=d.materials[c],f=e.getParams().transparent,g=e.getParams().opacity,e.metadata.symbolIsTransparent=l,h=this._calcEngineMaterialTransparencyParams(e.metadata.i3sTex,
e.metadata.i3sMatParams,e.metadata.symbolIsTransparent),f===h.transparent&&g===h.opacity||e.setParameterValues({transparent:h.transparent,opacity:h.opacity})}};q.prototype._setComponentColor=function(a,b,d,c){var e=d.data,f=d.offsetIdx,g=d.strideIdx;C.assert(4===d.size);d=f+a.data.componentOffsets[b+1]*g;for(a=f+a.data.componentOffsets[b]*g;a<d;a+=g)e[a]=c[0],e[a+1]=c[1],e[a+2]=c[2],e[a+3]=c[3]};q.prototype._elevationInfoChanged=function(){var a=this.layer.elevationInfo&&this.layer.elevationInfo.unit;
a&&!w.supportsUnit(a)&&aa.warn("elevationInfo.unit","'"+a+"' is not a valid unit")};q.prototype._reloadAll=function(){this._removeAllNodeDataFromStage();null!=this._controller&&this._controller.restartNodeLoading()};q.prototype._opacityChange=function(a){for(var b in this._matId2Meta)for(var d in this._matId2Meta[b]){a=this._matId2Meta[b][d].engineMat;var c=a.getParams(),e=this._calcEngineMaterialTransparencyParams(a.metadata.i3sTex,a.metadata.i3sMatParams,a.metadata.symbolIsTransparent);c.transparent===
e.transparent&&c.layerOpacity===e.layerOpacity||a.setParameterValues(e)}};q.prototype.queryExtent=function(a){return this._ensureQueryEngine().queryExtent(a)};q.prototype.queryFeatureCount=function(a){return this._ensureQueryEngine().queryFeatureCount(a)};q.prototype.queryFeatures=function(a){return this._ensureQueryEngine().queryFeatures(a)};q.prototype.queryObjectIds=function(a){return this._ensureQueryEngine().queryObjectIds(a)};q.prototype._ensureQueryEngine=function(){this._queryEngine||(this._queryEngine=
this._createQueryEngine());return this._queryEngine};q.prototype._createQueryEngine=function(){var a=this,b={id:0,index:0,object:null,bbCorners:new Float64Array(24)};return new P({forAll:function(d,c){a._forAllFeatures(function(c,e,f){b.id=c;b.index=e;b.object=f;a._boundingBoxCornerPoints(b.index,b.object,b.bbCorners);d(b)},c)},createGraphic:function(b){return a._createGraphic(b.index,b.object.getMetadata())},requestFields:function(b,d,c){return I.whenGraphicAttributes(a.layer,d,a._getObjectIdField(),
c,function(){var c=a._getGraphicIndices(b.node,b.bundleNr,d);return{node:b.node,indices:c}},{ignoreUnavailableFields:!1})},createExtentBuilder:function(){return a._createExtentBuilder()}},{enableObjectId:!0,enableOutFields:!!this.layer.objectIdField})};q.prototype._createExtentBuilder=function(){var a=this.view.renderSpatialReference,b=this.view.spatialReference,d=V.create(V.NEGATIVE_INFINITY),c=new Float64Array(24);return{add:function(e){T.bufferToBuffer(e.bbCorners,a,0,c,b,0,8)&&V.expandBuffer(d,
c,0,8)},getExtent:function(){return V.toExtent(d,b)}}};q.prototype._forAllFeatures=function(a,b,d){for(var c=0,e=Object.keys(this._nodeId2Meta);c<e.length;c++)for(var f=e[c],g=this._nodeId2Meta[f].engineObjects,h=0;h<g.length;h++)this._forAllFeaturesOfObject(g[h],a,d),b&&b({node:this._controller.nodeIndex[f],bundleNr:h})};q.prototype._forAllFeaturesOfObject=function(a,b,d){for(var c=a.getMetadata().featureIds,e=a.getGeometryRecords()[0],f=0;f<c.length;f++)(d||a.getComponentVisibility(e,f))&&b(c[f],
f,a,e)};q.prototype._createGraphic=function(a,b){var d={};null!=b.featureIds&&(d[this._getObjectIdField()]=b.featureIds[a]);if(null!=b.attributeData)for(var c=0,e=Object.keys(b.attributeData);c<e.length;c++){var f=e[c];d[f]=I.getCachedAttributeValue(b.attributeData[f],a)}a=new p(null,null,d);a.layer=this.layer;return a};q.prototype._boundingBoxCornerPoints=function(a,b,d){a=b.geometries[0].getComponentAABB(a,ia);for(var c=0;8>c;++c)la[0]=c&1?a[0]:a[3],la[1]=c&2?a[1]:a[4],la[2]=c&4?a[2]:a[5],M.mat4d.multiplyVec3(b.objectTransformation,
la),d[3*c]=la[0],d[3*c+1]=la[1],d[3*c+2]=la[2];return d};q.prototype.highlight=function(a,b){var d=this,c=this._highlights;if(a instanceof A){b=c.acquireSet(b);var e=b.set,f=b.handle;this.queryObjectIds(a).then(function(a){return c.setFeatureIds(e,a)});return f}if("number"===typeof a||a instanceof p)return this.highlight([a],b);a instanceof l&&(a=a.toArray());if(Array.isArray(a)&&0<a.length){if(a[0]instanceof p)return a=a.map(function(a){return u.attributeLookup(a.attributes,d._getObjectIdField())}),
f=c.acquireSet(b),b=f.set,f=f.handle,c.setFeatureIds(b,a),f;if("number"===typeof a[0])return f=c.acquireSet(b),b=f.set,f=f.handle,c.setFeatureIds(b,a),f}return{remove:function(){}}};q.prototype.visibleGeometryChanged=function(a){var b=this;a?this._elevationProvider.objectChanged(a):this._elevationProvider.layerChanged();null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=y.schedule(function(){b.emit("visible-geometry-changed");b._visibleGeometryChangedSchedulerHandle=
null}))};a([b.property()],q.prototype,"layer",void 0);a([b.property()],q.prototype,"_controller",void 0);a([b.property({dependsOn:["_controller.updating"]})],q.prototype,"updating",void 0);a([b.property({readOnly:!0,aliasOf:"_controller.updatingPercentage"})],q.prototype,"updatingPercentageValue",void 0);a([b.property({readOnly:!0})],q.prototype,"hasTexturesOrVertexColors",null);a([b.property({readOnly:!0,dependsOn:["layer.renderer"]})],q.prototype,"rendererNeedsTextures",null);a([b.property({readOnly:!0,
dependsOn:["layer.elevationInfo"]})],q.prototype,"elevationOffset",null);a([b.property()],q.prototype,"alwaysLoadEverythingModeEnabled",void 0);a([b.property({dependsOn:["view.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled","_useCompressedTextures"]})],q.prototype,"uncompressedTextureDownsamplingEnabled",null);a([b.property({dependsOn:["layer.version"]})],q.prototype,"_useCompressedTextures",null);return q=a([b.subclass("esri.views.3d.layers.SceneLayerView3D")],q)}(b.declared(J,
S));var la=M.vec3d.create(),ia=V.create(),Z=V.create(),pa=M.vec4d.create(),ma=[0,0,0,0];return x})},"esri/layers/IntegratedMeshLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./Layer ./mixins/SceneService ../symbols/support/ElevationInfo ../core/Error dojo/_base/lang".split(" "),function(x,r,k,a,b,c,t,n,f,q){return function(c){function l(a,b){a=c.call(this)||this;a.geometryType="mesh";a.operationalLayerType=
"IntegratedMeshLayer";a.type="integrated-mesh";a.profile="mesh-pyramids";a.elevationInfo=null;return a}k(l,c);l.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?q.mixin({},{url:a},b):a};l.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Scene Service"]}).always(function(){return a._fetchService()}).then(function(){return a._verifyRootNodeAndUpdateExtent()});this.addResolvingPromise(b);return this.when()};l.prototype._validateLayer=function(a){if(a.layerType&&
"IntegratedMesh"!==a.layerType)throw new f("integratedmeshlayer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:a.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new f("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(1<this.version.major)throw new f("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,
supportedVersions:"1.x"});};a([b.shared("esri.layers.IntegratedMeshLayer")],l.prototype,"declaredClass",void 0);a([b.shared({"3d":"../views/3d/layers/SceneLayerView3D"})],l.prototype,"viewModulePaths",void 0);a([b.property({type:String,readOnly:!0})],l.prototype,"geometryType",void 0);a([b.property()],l.prototype,"operationalLayerType",void 0);a([b.property({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0);a([b.property({type:n,json:{origins:{service:{read:{source:"elevationInfo"}}},read:{source:"layerDefinition.elevationInfo"},
write:{target:"layerDefinition.elevationInfo"}}})],l.prototype,"elevationInfo",void 0);return l=a([b.subclass()],l)}(b.declared(c,t))})},"esri/layers/mixins/SceneService":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../../request ../../core/MultiOriginJSONSupport ../../core/Error ../../core/urlUtils ../../core/promiseUtils ../../core/requireUtils ../../core/Logger ../../geometry/Extent ../../geometry/HeightModelInfo ../../geometry/SpatialReference ../Layer ../support/arcgisLayerUrl ./ArcGISService ./OperationalLayer ./PortalLayer".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z){var A=y.getLogger("esri.layers.mixins.SceneService");return function(p){function t(){var a=null!==p&&p.apply(this,arguments)||this;a.blendMode=null;a.spatialReference=null;a.fullExtent=null;a.heightModelInfo=null;a.version={major:Number.NaN,minor:Number.NaN,versionString:""};a.copyright=null;a.sublayerTitleMode="item-title";a.title=null;a.layerId=null;return a}k(t,p);t.prototype.readSpatialReference=function(a,b){return this._readSpatialReference(b)};
t.prototype._readSpatialReference=function(a){if(null!=a.spatialReference)return w.fromJSON(a.spatialReference);a=a.store;a=(a=a.indexCRS||a.geographicCRS)&&parseInt(a.substring(a.lastIndexOf("/")+1,a.length),10);return null!=a?new w(a):null};t.prototype.readFullExtent=function(a,b){a=b.store;b=this._readSpatialReference(b);return null==b||null==a||null==a.extent?null:new B({xmin:a.extent[0],ymin:a.extent[1],xmax:a.extent[2],ymax:a.extent[3],spatialReference:b})};t.prototype.readVersion=function(a,
b){a=b.store;b=null!=a.version?a.version.toString():"";a={major:Number.NaN,minor:Number.NaN,versionString:b};b=b.split(".");2<=b.length&&(a.major=parseInt(b[0],10),a.minor=parseInt(b[1],10));return a};t.prototype.readCopyright=function(a,b){return b.copyrightText};t.prototype.readTitlePortalItem=function(a,b){return"item-title"!==this.sublayerTitleMode?void 0:a};t.prototype.readTitleService=function(a,b){a=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return F.titleFromUrlAndName(this.url,
b.name);b=b.name||F.parse(this.url).title;"item-title-and-service-name"===this.sublayerTitleMode&&a&&(b=a+" - "+b);return F.cleanTitle(b)};t.prototype.readLayerId=function(a,b){return b.id};Object.defineProperty(t.prototype,"url",{set:function(a){a=F.sanitizeUrlWithLayerId(this,a,A);this._set("url",a.url);null!=a.layerId&&this._set("layerId",a.layerId)},enumerable:!0,configurable:!0});t.prototype.writeUrl=function(a,b){F.writeUrlWithLayerId(this,a,"layers",b)};Object.defineProperty(t.prototype,"parsedUrl",
{get:function(){var a=this._get("url");if(!a)return null;a=f.urlToObject(a);null!=this.layerId&&F.match.test(a.path)&&(a.path=a.path+"/layers/"+this.layerId);return a},enumerable:!0,configurable:!0});t.prototype.readRootNode=function(a,b){return b.store.rootNode};t.prototype._verifyRootNodeAndUpdateExtent=function(){var a=this;return this._fetchRootNode().then(function(b){return a._updateExtentFromRootNode(b)})};t.prototype._updateExtentFromRootNode=function(a){if(null!=this.fullExtent&&!this.fullExtent.hasZ&&
null!=a&&Array.isArray(a.mbs)&&4===a.mbs.length){var b=a.mbs[2];a=a.mbs[3];this.fullExtent.zmin=b-a;this.fullExtent.zmax=b+a}};t.prototype._fetchRootNode=function(){if(!this.rootNode)return q.resolve();var a=f.join(this.parsedUrl.path,this.rootNode);return c(a,{query:{f:"json"},responseType:"json"}).then(function(a){return a.data}).otherwise(function(b){throw new n("sceneservice:root-node-missing","Root node missing.",{error:b,url:a});})};t.prototype._fetchService=function(){var a=this;return(null==
this.layerId&&/SceneServer\/*$/i.test(this.url)?this._fetchFirstLayerId().then(function(b){null!=b&&(a.layerId=b)}):q.resolve()).then(function(){return a._fetchServiceLayer()})};t.prototype._fetchFirstLayerId=function(){return c(this.url,{query:{f:"json"},callbackParamName:"callback",responseType:"json"}).then(function(a){if(a.data&&Array.isArray(a.data.layers)&&0<a.data.layers.length)return a.data.layers[0].id})};t.prototype._fetchServiceLayer=function(){var a=this;return c(this.parsedUrl.path,{query:{f:"json"},
responseType:"json"}).then(function(b){b.ssl&&(a.url=a.url.replace(/^http:/i,"https:"));b=b.data;a.read(b,{origin:"service",url:a.parsedUrl});a._validateLayer(b)})};t.prototype._validateLayer=function(a){};t.prototype.createGraphicsController=function(a){var b=this;a.layer=this;var c=l.when(x,"../graphics/controllers/I3SOnDemandController").then(function(b){return new b(a)});c.then(function(a){b.emit("graphics-controller-create",{graphicsController:a})});return c};a([b.shared({id:{json:{origins:{service:{read:!1},
"portal-item":{read:!1}}}}})],t.prototype,"properties",void 0);a([b.property({type:w})],t.prototype,"spatialReference",void 0);a([b.reader("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null);a([b.property({type:B})],t.prototype,"fullExtent",void 0);a([b.reader("fullExtent",["store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null);a([b.property({readOnly:!0,type:v})],t.prototype,
"heightModelInfo",void 0);a([b.property({readOnly:!0})],t.prototype,"version",void 0);a([b.reader("version",["store.version"])],t.prototype,"readVersion",null);a([b.property({type:String})],t.prototype,"copyright",void 0);a([b.reader("copyright",["copyrightText"])],t.prototype,"readCopyright",null);a([b.property({type:String})],t.prototype,"sublayerTitleMode",void 0);a([b.property({type:String})],t.prototype,"title",void 0);a([b.reader("portal-item","title")],t.prototype,"readTitlePortalItem",null);
a([b.reader("service","title",["name"])],t.prototype,"readTitleService",null);a([b.property({type:Number})],t.prototype,"layerId",void 0);a([b.reader("service","layerId",["id"])],t.prototype,"readLayerId",null);a([b.property()],t.prototype,"url",null);a([b.writer("url")],t.prototype,"writeUrl",null);a([b.property({dependsOn:["layerId"]})],t.prototype,"parsedUrl",null);a([b.property()],t.prototype,"store",void 0);a([b.property({type:String})],t.prototype,"rootNode",void 0);a([b.reader("rootNode",["store.rootNode"])],
t.prototype,"readRootNode",null);return t=a([b.subclass("esri.layers.mixins.SceneService")],t)}(b.declared(D,G,t,p,z))})},"esri/views/3d/layers/LayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/promiseUtils ../../../core/watchUtils ../../../geometry/support/heightModelInfoUtils ../../layers/LayerView".split(" "),function(x,r,k,a,b,c,t,n,f){return function(f){function l(){var a=
null!==f&&f.apply(this,arguments)||this;a.supportsHeightUnitConversion=!1;return a}k(l,f);l.prototype.postscript=function(a){this.inherited(arguments);n.mayHaveHeightModelInfo(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())};l.prototype._validateHeightModelInfo=function(){var a=this;return c.create(function(b,c){t.whenFalseOnce(a.view.defaultsFromMap,"isHeightModelInfoSearching",function(){var f=n.rejectLayerError(a.layer,a.view.heightModelInfo,a.supportsHeightUnitConversion);
f?c(f):b()})})};a([b.property()],l.prototype,"view",void 0);return l=a([b.subclass("esri.views.3d.layers.LayerView3D")],l)}(b.declared(f))})},"esri/views/3d/layers/i3s/I3SUtil":function(){define("require exports ../../../../request ../../../../core/promiseUtils ../../../../core/Error ../../../../core/urlUtils ../../../../geometry/SpatialReference ../../../../geometry/support/webMercatorUtils ../../../../tasks/QueryTask ../../../../tasks/support/Query ../../support/projectionUtils ../../lib/glMatrix ../../webgl-engine/lib/Util ./I3SBinaryReader".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v){function w(a){return a&&parseInt(a.substring(a.lastIndexOf("/")+1,a.length),10)}function D(a,b,c,e,d,f){if(null!=c){var g=S;l.mbsToMbs(c.mbs,e,g,b);if(0!==F(a,g)){f.push(c);for(var g=null!=c.children?c.children.length:0,h=0;h<g;h++)D(a,b,d[c.children[h].id],e,d,f)}}}function F(a,b){var c=b[0],e=b[1],d=b[2];b=b[3];var f=0;if(c<a[0])var h=a[0]-c,f=f+h*h;e<a[1]&&(h=a[1]-e,f+=h*h);d<a[2]&&(h=a[2]-d,f+=h*h);c>a[3]&&(h=c-a[3],f+=h*h);e>a[4]&&(h=e-a[4],f+=h*h);d>a[5]&&
(h=d-a[5],f+=h*h);if(f>b*b)return 0;if(0<f)return 1;f=Infinity;c-a[0]<f&&(f=c-a[0]);e-a[1]<f&&(f=e-a[1]);d-a[2]<f&&(f=d-a[2]);a[3]-c<f&&(f=a[3]-c);a[4]-e<f&&(f=a[4]-e);a[5]-d<f&&(f=a[5]-d);return f>b?2:1}function G(a,b,c){var e=[],d=c&&c.missingFields;c=c&&c.originalFields;for(var f=0;f<a.length;f++){for(var h=a[f],k=h.toLowerCase(),l=!1,n=0,p=b;n<p.length;n++){var q=p[n];if(k===q.name.toLowerCase()){e.push(q.name);l=!0;c&&c.push(h);break}}!l&&d&&d.push(h)}return e}function p(a,b){return a.filter(function(a){return a.toLowerCase()!==
b.toLowerCase()}).concat([b])}function z(a,b,c,e){b.sort(function(a,b){return a.attributes[c]-b.attributes[c]});var d=b.map(function(a){return a.attributes[c]}),f=[],h=G(e,a.fields,{originalFields:f});return J(a,d,h).then(function(a){for(var d=0;d<b.length;d++){var c=b[d],e=a[d];c.attributes={};for(var g=0;g<f.length;g++)c.attributes[f[g]]=e[h[g]]}return b})}function A(a,b){for(var c=[],e=0;e<a.length;e++){var d=a[e];d in b.attributes||c.push(d)}return c}function J(c,k,l){if(null!=c.maxRecordCount&&
k.length>c.maxRecordCount){var e=L(k,c.maxRecordCount);return a.all(e.map(function(a){return J(c,a,l)})).then(O)}e=new q({objectIds:k,outFields:l,orderByFields:[c.objectIdField]});return(new f(c.parsedUrl.path)).execute(e).then(function(d){return d&&d.features&&d.features.length===k.length?d.features.map(function(a){return a.attributes}):a.reject(new b("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer"))})}function I(f,l,n,e,d){for(var g=[],h=0;h<l.attributeData.length;h++){var p=
l.attributeData[h],q=f[h];q&&-1!==e.indexOf(q.name)&&(p=c.makeAbsolute(p.href,l.baseUrl),g.push({url:p,storageInfo:q}))}return a.eachAlways(g.map(function(a){return k(a.url,{responseType:"array-buffer"}).then(function(b){return v.readBinaryAttribute(a.storageInfo,b.data)})})).then(function(c){var e=[];if(!d.ignoreUnavailableFields&&c.some(function(a){return null==a.value})){for(var e=[],f=0;f<c.length;f++)null==c[f].value&&e.push({name:g[f].storageInfo.name,error:c[f].error});return a.reject(new b("scenelayer:attribute-request-failed",
"Request for scene layer attributes failed",{failedAttributes:e}))}for(var h=0;h<n.length;h++){for(var k=n[h],l={},f=0;f<c.length;f++)null!=c[f].value&&(l[g[f].storageInfo.name]=K(c[f].value,k));e.push(l)}return e})}function K(a,b){b=a[b];return a instanceof Int16Array?b===T?null:b:a instanceof Int32Array?b===V?null:b:b!==b?null:b}function L(a,b){var c=a.length;b=Math.ceil(c/b);for(var e=[],d=0;d<b;d++)e.push(a.slice(Math.floor(c*d/b),Math.floor(c*(d+1)/b)));return e}function O(a){for(var b=[],c=
0;c<a.length;c++)b=b.concat(a[c]);return b}function P(a){var b=new t(w(a.store.indexCRS||a.store.geographicCRS));return b.equals(a.spatialReference)?a.spatialReference:b}function U(a){var b=new t(w(a.store.vertexCRS||a.store.projectedCRS));return b.equals(a.spatialReference)?a.spatialReference:b}function N(a,c,f){if(!n.canProject(a,c))throw new b("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===
f&&a.isGeographic)throw new b("layerview:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes",{});}function R(a,b,c){var e=P(a);a=U(a);N(e,b,c);N(a,b,c)}Object.defineProperty(r,"__esModule",{value:!0});r.DDS_ENCODING_STRING="image/vnd-ms.dds";r.BROWSER_SUPPORTED_IMAGE_ENCODING_STRINGS=["image/jpeg","image/png"];r.extractWkid=w;r.processNormals=function(a,b,c){switch(b){case "none":var e=a.normals,d=a.positions;b=a.normalInd;c=a.positionInd;B.assert(a.normalInd.length===
a.positionInd.length);a=y.vec3d.create();for(var f=y.vec3d.create(),h=d.data,k=d.offsetIdx,d=d.strideIdx,n=e.data,p=e.offsetIdx,e=e.strideIdx,q=0;q<c.length;q+=3){var t=c[q],t=k+d*t,r=h[t],v=h[t+1],z=h[t+2],t=c[q+1],t=k+d*t;a[0]=h[t]-r;a[1]=h[t+1]-v;a[2]=h[t+2]-z;t=c[q+2];t=k+d*t;f[0]=h[t]-r;f[1]=h[t+1]-v;f[2]=h[t+2]-z;y.vec3d.cross(a,f,a);y.vec3d.normalize(a);for(r=0;3>r;r++)v=p+e*b[q+r],n[v]=a[0],n[v+1]=a[1],n[v+2]=a[2]}break;case "east-north-up":break;case "earth-centered":c(a.normals,l.SphericalECEFSpatialReference);
break;case "vertex-reference-frame":break;default:throw Error("Received unexpected normalReferenceFrame: "+b);}};r.getAppropriateTextureEncoding=function(a,b){if(Array.isArray(a)){if(b&&(b=a.indexOf(r.DDS_ENCODING_STRING),-1<b))return b;for(b=0;b<a.length;b++)if(-1<r.BROWSER_SUPPORTED_IMAGE_ENCODING_STRINGS.indexOf(a[b]))return b;throw Error("Could not find appropriate texture encoding (among "+a.toString()+")");}return-1};r.findIntersectingNodes=D;var S=y.vec4d.create();r.intersectBoundingBoxWithMbs=
F;r.findFieldsCaseInsensitive=G;r.whenGraphicAttributes=function(c,f,k,e,d,g){var h=!0===(g&&g.populateObjectId),l=g.ignoreUnavailableFields?void 0:[],n=1===e.length&&"*"===e[0];!n&&h&&(e=p(e,k));e=n?e:G(e,c.fields,{missingFields:l});if(l&&0!==l.length)return a.reject(new b("scenelayer:unknown-fields","This scene layer does not have the requested fields",{unknownFields:l}));if(0===f.length)return a.resolve(f);var h=c.associatedLayer,l=c.attributeStorageInfo,q=n?c.fields.map(function(a){return a.name}):
e;if(h)return z(h,f,k,q);c=A(q,f[0]);return 0===c.length?a.resolve(f):l?(d=d(),null==d?a.reject(new b("scenelayer:feature-not-loaded","Tried to query attributes for unloaded features")):I(l,d.node,d.indices,c,g).then(function(a){for(var b=0;b<f.length;b++){for(var d=0,c=q;d<c.length;d++){var e=c[d];e in a[b]||(a[b][e]=f[b].attributes[e])}f[b].attributes=a[b]}return f})):a.reject(new b("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available"))};var T=-Math.pow(2,
15),V=-Math.pow(2,31);r.getCachedAttributeValue=K;r.convertFlatRangesToOffsets=function(a,c,f){void 0===f&&(f=2);c=null!=c?c:a.length/f;for(var e=new Uint32Array(c+1),d=0;d<c;d++){var g=a[d*f];e[d]=3*g;var h=(d-1)*f+1;if(0<=h&&g-1!==a[h])throw new b("Face ranges are not continuous");}e[e.length-1]=3*(a[(c-1)*f+1]+1);return e};r.getIndexCrs=P;r.getVertexCrs=U;r.getCacheKeySuffix=function(a,b){return b===l.SphericalECEFSpatialReference?"@ECEF":a.equals(b)?"":null!=b.wkid?"@"+b.wkid:null};r.checkSpatialReference=
N;r.checkSpatialReferences=R;r.checkSceneLayerValid=function(a){var c;(c=null==a.store||null==a.store.defaultGeometrySchema)||(a=a.store.defaultGeometrySchema,c=!!(null!=a.geometryType&&"triangles"!==a.geometryType||null!=a.topology&&"PerAttributeArray"!==a.topology||null==a.vertexAttributes||null==a.vertexAttributes.position));if(c)throw new b("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{});};r.checkSceneLayerCompatibleWithView=function(a,
b){R(a,b.spatialReference,b.viewingMode)};r.checkPointCloudLayerValid=function(a){var c;(c=null==a.store||null==a.store.defaultGeometrySchema)||(a=a.store.defaultGeometrySchema,c=!!(null==a.geometryType||"points"!==a.geometryType||null!=a.topology&&"PerAttributeArray"!==a.topology||null!=a.encoding&&""!==a.encoding&&"lepcc-xyz"!==a.encoding||null==a.vertexAttributes||null==a.vertexAttributes.position));if(c)throw new b("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",
{});};r.checkPointCloudLayerCompatibleWithView=function(a,b){N(a.spatialReference,b.spatialReference,b.viewingMode)};r.encodeSymbolColor=function(a,b,c){null==a||"ignore"===b?(c[0]=255,c[1]=255,c[2]=255,c[3]=255):(c[0]=Math.floor(255*a[0]),c[1]=Math.floor(255*a[1]),c[2]=Math.floor(255*a[2]),a=Math.floor(85*a[3]),c[3]=0===a?0:"tint"===b?a:"replace"===b?a+85:a+170)};r.rendererNeedsTextures=function(a){if(null==a||"simple"!==a.type&&"class-breaks"!==a.type&&"unique-value"!==a.type||("unique-value"===
a.type||"class-breaks"===a.type)&&null==a.defaultSymbol)return!0;a=a.getSymbols();if(0===a.length)return!0;for(var b=0;b<a.length;b++){var c=a[b];if("mesh-3d"!==c.type||0===c.symbolLayers.length)return!0;for(var e=0,c=c.symbolLayers.items;e<c.length;e++){var d=c[e];if("fill"!==d.type||null==d.material||"replace"!==d.material.colorMixMode)return!0}}return!1}})},"esri/views/3d/layers/i3s/I3SBinaryReader":function(){define("require exports dojo/_base/lang ../../../../core/Logger ../../../../core/Error ./LEPCC".split(" "),
function(x,r,k,a,b,c){function t(a,c,f){for(var k="",l=0;l<f;){var n=a[c+l];if(128>n)k+=String.fromCharCode(n),l++;else if(192<=n&&224>n){if(l+1>=f)throw new b("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");var p=a[c+l+1],n=(n&31)<<6|p&63,k=k+String.fromCharCode(n),l=l+2}else if(224<=n&&240>n){if(l+2>=f)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");var p=a[c+l+1],q=a[c+l+2],n=(n&15)<<12|(p&63)<<6|q&63,k=k+String.fromCharCode(n),
l=l+3}else if(240<=n&&248>n){if(l+3>=f)throw new b("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");p=a[c+l+1];q=a[c+l+2];n=(n&7)<<18|(p&63)<<12|(q&63)<<6|a[c+l+3]&63;k=65536<=n?k+String.fromCharCode((n-65536>>10)+55296,(n&1023)+56320):k+String.fromCharCode(n);l+=4}else throw new b("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");}return k}function n(a,b){for(var c={byteOffset:0,byteCount:0,fields:Object.create(null)},f=0,k=0;k<b.length;k++){var l=
b[k],n=l.valueType||l.type;c.fields[l.property]=(0,r.valueType2ArrayBufferReader[n])(a,f);f+=r.valueType2TypedArrayClassMap[n].BYTES_PER_ELEMENT}c.byteCount=f;return c}function f(a,c,f){var k=[],l,n=0,p;for(p=0;p<a;p+=1){l=c[p];if(0<l){if(k.push(t(f,n,l-1)),0!==f[n+l-1])throw new b("string-array-error","Invalid string array: missing null termination.");}else k.push(null);n+=l}return k}function q(a,b){return new r.valueType2TypedArrayClassMap[b.valueType](a,b.byteOffset,b.count*b.valuesPerElement)}
function l(a,b){return new Uint8Array(a,b.byteOffset,b.byteCount)}function y(a,c,f){a=null!=c.header?n(a,c.header):{byteOffset:0,byteCount:0,fields:{count:f}};f={header:a,byteOffset:a.byteCount,byteCount:0,entries:Object.create(null)};for(var l=a.byteCount,p=0;p<c.ordering.length;p++){var q=c.ordering[p],t=k.clone(c[q]);t.count=a.fields.count;if("String"===t.valueType){if(t.byteOffset=l,t.byteCount=a.fields[q+"ByteCount"],"UTF-8"!==t.encoding)throw new b("unsupported-encoding","Unsupported String encoding.",
{encoding:t.encoding});}else if(v(t.valueType)){var r=w(t.valueType),l=l+(0!==l%r?r-l%r:0);t.byteOffset=l;t.byteCount=r*t.valuesPerElement*t.count}else throw new b("unsupported-value-type","Unsupported binary valueType",{valueType:t.valueType});l+=t.byteCount;f.entries[q]=t}f.byteCount=l-f.byteOffset;return f}function B(a,c,f){c!==a&&D.error("Invalid "+f+" buffer size\n expected: "+a+", actual: "+c+")");if(c<a)throw new b("buffer-too-small","Binary buffer is too small",{expectedSize:a,actualSize:c});
}function v(a){return r.valueType2TypedArrayClassMap.hasOwnProperty(a)}function w(a){return v(a)&&r.valueType2TypedArrayClassMap[a].BYTES_PER_ELEMENT}Object.defineProperty(r,"__esModule",{value:!0});var D=a.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");r.readHeader=n;r.readStringArray=f;r.createTypedView=q;r.createRawView=l;r.createAttributeDataIndex=y;r.createGeometryDataIndex=function(a,b,c){var f=n(a,b.header),l=f.byteCount,p={header:f,byteOffset:f.byteCount,byteCount:0,vertexAttributes:k.clone(b.vertexAttributes)},
q=p.vertexAttributes;c||null==q.region||delete q.region;var f=f.fields,t=null!=f.vertexCount?f.vertexCount:f.count;for(c=0;c<b.ordering.length;c++){var r=b.ordering[c];null!=q[r]&&(q[r].byteOffset=l,q[r].count=t,l+=w(q[r].valueType)*q[r].valuesPerElement*t)}q=f.faceCount;if(b.faces&&q)for(p.faces=k.clone(b.faces),t=p.faces,c=0;c<b.ordering.length;c++)r=b.ordering[c],null!=t[r]&&(t[r].byteOffset=l,t[r].count=q,l+=w(t[r].valueType)*t[r].valuesPerElement*q);f=f.featureCount;if(b.featureAttributes&&b.featureAttributeOrder&&
f)for(p.featureAttributes=k.clone(b.featureAttributes),q=p.featureAttributes,c=0;c<b.featureAttributeOrder.length;c++)t=b.featureAttributeOrder[c],q[t].byteOffset=l,q[t].count=f,r=w(q[t].valueType),"UInt64"===q[t].valueType&&(r=8),l+=r*q[t].valuesPerElement*f;B(l,a.byteLength,"geometry");p.byteCount=l-p.byteOffset;return p};r.readBinaryAttribute=function(a,k,n){if("lepcc-rgb"===a.encoding)return c.decodeRGB(k);if("lepcc-intensity"===a.encoding)return c.decodeIntensity(k);if(null!=a.encoding&&""!==
a.encoding)throw new b("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");a["attributeByteCounts "]&&!a.attributeByteCounts&&(D.warn("Warning: Trailing space in 'attributeByteCounts '."),a.attributeByteCounts=a["attributeByteCounts "]);"ObjectIds"===a.ordering[0]&&a.hasOwnProperty("objectIds")&&(D.warn("Warning: Case error in objectIds"),a.ordering[0]="objectIds");n=y(k,a,n);B(n.byteOffset+n.byteCount,k.byteLength,"attribute");if(a=n.entries.attributeValues||n.entries.objectIds){if("String"===
a.valueType){n=n.entries.attributeByteCounts;var p=q(k,n);k=l(k,a);return f(n.count,p,k)}return q(k,a)}throw new b("bad-attribute-storage-info","Bad attributeStorageInfo specification.");};r.valueType2TypedArrayClassMap={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array};r.valueType2ArrayBufferReader={Float32:function(a,b){return(new DataView(a,0)).getFloat32(b,!0)},Float64:function(a,b){return(new DataView(a,
0)).getFloat64(b,!0)},UInt8:function(a,b){return(new DataView(a,0)).getUint8(b)},Int8:function(a,b){return(new DataView(a,0)).getInt8(b)},UInt16:function(a,b){return(new DataView(a,0)).getUint16(b,!0)},Int16:function(a,b){return(new DataView(a,0)).getInt16(b,!0)},UInt32:function(a,b){return(new DataView(a,0)).getUint32(b,!0)},Int32:function(a,b){return(new DataView(a,0)).getInt32(b,!0)}};r.isValueType=v;r.getBytesPerValue=w})},"esri/views/3d/layers/i3s/LEPCC":function(){define(["require","exports",
"../../../../core/Error"],function(x,r,k){function a(a,b,c){return{identifier:String.fromCharCode.apply(null,new Uint8Array(a,c+t.identifierOffset,t.identifierLength)),version:b.getUint16(c+t.versionOffset,!0),checksum:b.getUint32(c+t.checksumOffset,!0)}}function b(a,b,k){var f=[];b=c(a,b,f);for(var n=[],q=0;q<f.length;q++){n.length=0;b=c(a,b,n);for(var t=0;t<n.length;t++)k.push(n[t]+f[q])}return b}function c(a,b,c){var f=new DataView(a,b),n=f.getUint8(0),q=n&31,t=!!(n&32),r=(n&192)>>6,n=0;if(0===
r)n=f.getUint32(1,!0),b+=5;else if(1===r)n=f.getUint16(1,!0),b+=3;else if(2===r)n=f.getUint8(1),b+=2;else throw new k("lepcc-decode-error","Bad count type");if(t)throw new k("lepcc-decode-error","LUT not implemented");a=new Uint8Array(a,b,Math.ceil(n*q/8));for(var r=t=f=0,x=-1>>>32-q,F=0;F<n;F++){for(;t<q;)f|=a[r]<<t,t+=8,r+=1;c[F]=f&x;f>>>=q;t-=q;32<t+q&&(f|=a[r-1]>>8-t)}return b+r}Object.defineProperty(r,"__esModule",{value:!0});var t={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,
byteCount:16};r.decodeXYZ=function(c){var f,n,l,r,B,v,w,x,F,G,p,z,A=new DataView(c,0),J=0;r=a(c,A,J);l=r.identifier;r=r.version;J+=t.byteCount;if("LEPCC "!==l)throw new k("lepcc-decode-error","Bad identifier");if(1<r)throw new k("lepcc-decode-error","Unknown version");var I=J;f=A.getUint32(I+0,!0);n=A.getUint32(I+4,!0);l=A.getFloat64(I+8,!0);r=A.getFloat64(I+16,!0);B=A.getFloat64(I+24,!0);v=A.getFloat64(I+32,!0);w=A.getFloat64(I+40,!0);x=A.getFloat64(I+48,!0);F=A.getFloat64(I+56,!0);G=A.getFloat64(I+
64,!0);p=A.getFloat64(I+72,!0);z=A.getUint32(I+80,!0);A.getUint32(I+84,!0);J+=88;if(n*Math.pow(2,32)+f!==c.byteLength)throw new k("lepcc-decode-error","Bad size");A=new Float64Array(3*z);f=[];n=[];z=[];I=[];J=b(c,J,f);J=b(c,J,n);J=b(c,J,z);J=b(c,J,I);if(J!==c.byteLength)throw new k("lepcc-decode-error","Bad length");for(var K=J=c=0;K<f.length;K++)for(var J=J+f[K],L=0,O=0;O<n[K];O++){var L=L+z[c],P=I[c];A[3*c]=Math.min(v,l+2*F*L);A[3*c+1]=Math.min(w,r+2*G*J);A[3*c+2]=Math.min(x,B+2*p*P);c++}return{errorX:F,
errorY:G,errorZ:p,result:A}};r.decodeRGB=function(b){var c,n,l,r,B,v,w=new DataView(b,0),x=0;r=a(b,w,x);l=r.identifier;r=r.version;x+=t.byteCount;if("ClusterRGB"!==l)throw new k("lepcc-decode-error","Bad identifier");if(1<r)throw new k("lepcc-decode-error","Unknown version");v=x;c=w.getUint32(v+0,!0);n=w.getUint32(v+4,!0);l=w.getUint32(v+8,!0);r=w.getUint16(v+12,!0);B=w.getUint8(v+14);v=w.getUint8(v+15);x+=16;if(n*Math.pow(2,32)+c!==b.byteLength)throw new k("lepcc-decode-error","Bad size");if(2!==
B&&1!==B||0!==v){if(0===B&&0===v){if(3*l+x!==b.byteLength||0!==r)throw new k("lepcc-decode-error","Bad count");return(new Uint8Array(b,x)).slice()}if(2>=B&&1===v){if(x+3!==b.byteLength||1!==r)throw new k("lepcc-decode-error","Bad count");r=w.getUint8(x);c=w.getUint8(x+1);w=w.getUint8(x+2);x=new Uint8Array(3*l);for(b=0;b<l;b++)x[3*b]=r,x[3*b+1]=c,x[3*b+2]=w;return x}throw new k("lepcc-decode-error","Bad method "+B+","+v);}if(3*r+l+x!==b.byteLength||256<r)throw new k("lepcc-decode-error","Bad count");
w=new Uint8Array(b,x,3*r);r=new Uint8Array(b,x+3*r,l);x=new Uint8Array(3*l);for(b=0;b<l;b++)c=r[b],x[3*b]=w[3*c],x[3*b+1]=w[3*c+1],x[3*b+2]=w[3*c+2];return x};r.decodeIntensity=function(b){var f,n,l,r,B,v=new DataView(b,0),w=0;r=a(b,v,w);l=r.identifier;r=r.version;w+=t.byteCount;if("Intensity "!==l)throw new k("lepcc-decode-error","Bad identifier");if(1<r)throw new k("lepcc-decode-error","Unknown version");var x=w;f=v.getUint32(x+0,!0);n=v.getUint32(x+4,!0);l=v.getUint32(x+8,!0);r=v.getUint16(x+12,
!0);B=v.getUint8(x+14);v.getUint8(x+15);w+=16;if(n*Math.pow(2,32)+f!==b.byteLength)throw new k("lepcc-decode-error","Bad size");v=new Uint16Array(l);if(8===B){if(l+w!==b.byteLength)throw new k("lepcc-decode-error","Bad size");B=new Uint8Array(b,w,l)}else if(16===B){if(2*l+w!==b.byteLength)throw new k("lepcc-decode-error","Bad size");B=new Uint16Array(b,w,l)}else if(B=[],c(b,w,B)!==b.byteLength)throw new k("lepcc-decode-error","Bad size");for(b=0;b<l;b++)v[b]=B[b]*r;return v}})},"esri/views/3d/layers/i3s/I3SElevationProvider":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/accessorSupport/decorators ../../../../core/Accessor ../../../../core/Logger ../../../../geometry/Point ../../webgl-engine/lib/Selector ../../support/Evented ../../support/aaBoundingRect ../../lib/glMatrix".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y){var B=l.create(l.NEGATIVE_INFINITY),v={spatialReference:null,extent:B},w=y.vec3d.create(),D=y.vec3d.create(),F=y.vec3d.create(),G=t.getLogger("esri.views.3d.layers.i3s.I3SElevationProvider");return function(c){function p(a){return c.call(this)||this}k(p,c);p.prototype.initialize=function(){this.renderCoordsHelper=this.layerView.view.renderCoordsHelper;this.intersectLayers=[this.stageLayer];this.selector=new f(this.layerView.view.viewingMode);var a=this.layerView.layer.fullExtent;
this.zmin=a.zmin;this.zmax=a.zmax};p.prototype.getElevation=function(a){if(a instanceof n){if(!this.renderCoordsHelper.toRenderCoords(a,w))return G.error("could not project point for elevation alignment"),-Infinity}else if(!this.renderCoordsHelper.toRenderCoords(a,this.spatialReference,w))return G.error("could not project point for elevation alignment"),-Infinity;var b=this.layerView.elevationOffset;a=this.zmin+b;b=this.zmax+b;y.vec3d.set(w,D);y.vec3d.set(w,F);this.renderCoordsHelper.setAltitude(b,
D);this.renderCoordsHelper.setAltitude(a,F);this.selector.init(this.intersectLayers,D,F,null,null,1,!1);return this.selector.getMinResult().getIntersectionPoint(w)?this.renderCoordsHelper.getAltitude(w):-Infinity};p.prototype.layerChanged=function(){this.spatialReference&&(v.extent=this.computeLayerExtent(this.intersectLayers[0]),v.spatialReference=this.spatialReference,this.emit("elevation-change",v))};p.prototype.objectChanged=function(a){this.spatialReference&&(v.extent=this.computeObjectExtent(a),
v.spatialReference=this.spatialReference,this.emit("elevation-change",v))};p.prototype.computeObjectExtent=function(a){l.set(B,l.NEGATIVE_INFINITY);this.expandExtent(a,B);return B};p.prototype.computeLayerExtent=function(a){l.set(B,l.NEGATIVE_INFINITY);var b=0;for(a=a.getObjects();b<a.length;b++)this.expandExtent(a[b],B);return B};p.prototype.expandExtent=function(a,b){for(var c=a.getBBMin(!0),f=a.getBBMax(!0),k=0;8>k;++k)w[0]=k&1?c[0]:f[0],w[1]=k&2?c[1]:f[1],w[2]=k&4?c[2]:f[2],y.mat4d.multiplyVec3(a.objectTransformation,
w),this.renderCoordsHelper.fromRenderCoords(w,w,this.spatialReference),l.expand(b,w);return b};a([b.property({constructOnly:!0})],p.prototype,"layerView",void 0);a([b.property({constructOnly:!0})],p.prototype,"stageLayer",void 0);a([b.property({readOnly:!0,aliasOf:"layerView.view.elevationProvider.spatialReference"})],p.prototype,"spatialReference",void 0);return p=a([b.subclass("esri.views.3d.layers.i3s.I3SElevationProvider")],p)}(b.declared(c,q.Evented))})},"esri/views/3d/layers/i3s/I3SGeometryUtil":function(){define(["require",
"exports"],function(x,r){function k(a,b,c,f,k,t,r){switch(c){case 1:for(c=0;c<r;c++)f[k]=a[b],b+=1,k+=t;break;case 2:for(c=0;c<r;c++)f[k]=a[b],f[k+1]=a[b+1],b+=2,k+=t;break;case 3:for(c=0;c<r;c++)f[k]=a[b],f[k+1]=a[b+1],f[k+2]=a[b+2],b+=3,k+=t;break;case 4:for(c=0;c<r;c++)f[k]=a[b],f[k+1]=a[b+1],f[k+2]=a[b+2],f[k+3]=a[b+3],b+=4,k+=t;break;default:throw n("Unhandled stride size "+c);}}function a(a,b,c,f,k,t){switch(b){case 1:for(b=0;b<t;b++)c[f]=a[0],f+=k;break;case 2:for(b=0;b<t;b++)c[f]=a[0],c[f+
1]=a[0],f+=k;break;case 3:for(b=0;b<t;b++)c[f]=a[0],c[f+1]=a[0],c[f+2]=a[0],f+=k;break;case 4:for(b=0;b<t;b++)c[f]=a[0],c[f+1]=a[0],c[f+2]=a[0],c[f+3]=a[0],f+=k;break;default:throw n("Unhandled stride size "+b);}}function b(a){switch(a){case 5120:return Int8Array;case 5126:return Float32Array;case 5124:return Int32Array;case 5122:return Int16Array;case 5121:return Uint8Array;case 5125:return Uint32Array;case 5123:return Uint16Array}throw Error("Unhandled data type: "+a);}function c(a){switch(a){case 5120:return"Int8";
case 5126:return"Float32";case 5124:return"Int32";case 5122:return"Int16";case 5121:return"UInt8";case 5125:return"UInt32";case 5123:return"UInt16"}throw Error("Unhandled data type: "+a);}function t(a){return 0<a&&0===a%Uint32Array.BYTES_PER_ELEMENT}function n(a){return Error("I3SGeometryUtil processing failed: "+a)}Object.defineProperty(r,"__esModule",{value:!0});var f=new Uint8Array(64);r.interleaveGeometryBuffer=function(q,l,r,B){void 0===B&&(B=[]);var v=q.params.vertexAttributes,w=v.position.count;
if(!t(r[0].stride))throw n("Layout stride must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");var y=new Uint32Array(r[0].stride/Uint32Array.BYTES_PER_ELEMENT*w);r=r.slice(0).sort(function(a,b){return a.offset-b.offset});q=function(q){var p=v[q.name],r=b(q.type),A=void 0,x=!1;if(null==p)if(x=B.filter(function(a){return a.name===q.name})[0]){p={valueType:c(q.type),byteOffset:0,count:w,valuesPerElement:q.count};for(A=0;A<f.length;A++)f[A]=x.byteValue;A=f.buffer;x=!0}else throw n("Geometry definition is missing attribute");
else A=l;if(c(q.type)!==p.valueType)throw n("Geometry definition type must match attribute type");if(0!==p.byteOffset%Uint32Array.BYTES_PER_ELEMENT||0!==q.offset%Uint32Array.BYTES_PER_ELEMENT)throw n(q.name+" offset must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");if(!t(p.valuesPerElement*r.BYTES_PER_ELEMENT)||!t(q.count*r.BYTES_PER_ELEMENT))throw n(q.name+" data must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");var A=new Uint32Array(A),D=p.byteOffset/Uint32Array.BYTES_PER_ELEMENT,p=
p.valuesPerElement*r.BYTES_PER_ELEMENT/Uint32Array.BYTES_PER_ELEMENT,r=q.offset/Uint32Array.BYTES_PER_ELEMENT,F=q.stride/Uint32Array.BYTES_PER_ELEMENT;x?a(A,p,y,r,F,w):k(A,D,p,y,r,F,w)};for(var x=0;x<r.length;x++)q(r[x]);return y.buffer}})},"esri/views/3d/layers/i3s/I3SProjectionUtil":function(){define(["require","exports","../../support/projectionUtils","../../lib/glMatrix","../../webgl-engine/lib/Util"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});r.ReprojectionTypes={PER_VERTEX:"perVertex",
NO_REPROJECTION:"noReprojection"};var c=new Float64Array(3E3);r.reprojectPoints=function(b,n,f,q,l,y){if(b===r.ReprojectionTypes.PER_VERTEX){b=n.data;var t=n.offsetIdx;n=n.strideIdx;var v=a.mat4d.create();k.computeLinearTransformation(q,f,v,y);var w=a.mat4d.create();a.mat4d.inverse(v,w);var x=a.mat4d.create();a.mat4d.identity(x);var F=[0,0,0],G=b.length/n;k.vectorToVector(f,q,F,l);for(f=0;f<G;f+=1E3){q=Math.min(1E3,G-f);for(var p=0;p<q;p++){var z=t+n*(f+p);c[3*p]=b[z]+F[0];c[3*p+1]=b[z+1]+F[1];c[3*
p+2]=b[z+2]+F[2]}k.bufferToBuffer(c,l,0,c,y,0,q);for(p=0;p<q;p++){var A=c[3*p],J=c[3*p+1],I=c[3*p+2],z=t+n*(f+p);b[z]=w[0]*A+w[4]*J+w[8]*I+w[12];b[z+1]=w[1]*A+w[5]*J+w[9]*I+w[13];b[z+2]=w[2]*A+w[6]*J+w[10]*I+w[14]}}y={localTrafo:x,globalTrafo:v}}else l=a.mat4d.create(),a.mat4d.identity(l),b=a.mat4d.create(),k.computeLinearTransformation(q,f,b,y),y={localTrafo:l,globalTrafo:b};return y};r.reprojectNormalsPerVertex=function(c,n,f,q,l){b.assert(q.equals(k.SphericalECEFSpatialReference));q=a.mat4d.create();
k.computeLinearTransformation(f,n,q,l);n=a.mat4d.create();a.mat4d.inverse(q,n);f=c.data;l=c.offsetIdx;c=c.strideIdx;q=f.length/c;for(var t=0;t<q;t++){var r=l+c*t,v=f[r],w=f[r+1],x=f[r+2];f[r]=n[0]*v+n[4]*w+n[8]*x;f[r+1]=n[1]*v+n[5]*w+n[9]*x;f[r+2]=n[2]*v+n[6]*w+n[10]*x}}})},"esri/views/3d/layers/i3s/I3SQueryEngine":function(){define("require exports dojo/promise/all ../../../../core/promiseUtils ../../../../core/Error ../../../../tasks/support/FeatureSet".split(" "),function(x,r,k,a,b,c){return function(){function t(a,
b){this._support=a;this._options=b}t.prototype.queryExtent=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0,f=b._support.createExtentBuilder();b._forAllQueried(a,function(a){c++;f.add(a)});return{count:c,extent:0===c?null:f.getExtent()}})};t.prototype.queryFeatureCount=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0;b._forAllQueried(a,function(){return c++});return c})};t.prototype.queryFeatures=function(b){var f=this;return this._rejectUnsupported(b).then(function(){var c=
[],l=b&&b.outFields,n=[];f._forAllQueried(b,function(a){return n.push(f._support.createGraphic(a))},function(a){l&&(c.push(f._support.requestFields(a,n,l)),n=[])});l||c.push(a.resolve(n));return k(c)}).then(function(a){a=a.reduce(function(a,b){return a.concat(b)},[]);var b=new c;b.features=a;return b})};t.prototype.queryObjectIds=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=[];b._forAllQueried(a,function(a){return c.push(a.id)});return c})};t.defaultExtentBuilder=
function(a){var b=null;return{add:function(c){(c=a(c))&&(b=null!=b?b.union(c):c.clone())},getExtent:function(){return b}}};t.prototype._forAllQueried=function(a,b,c){var f=[];if(a&&a.objectIds){var k=a.objectIds;f.push(function(a){return 0<=k.indexOf(a.id)})}this._support.forAll(function(a){for(var c=0;c<f.length;c++)if(!(0,f[c])(a))return;b(a)},c)};t.prototype._rejectUnsupported=function(c){if(null==c)return a.resolve();var f=function(c){return a.reject(new b("Unsupported Query","Unsupported property '"+
c+"'"))};return null!=c.distance?f("distance"):null!=c.geometryPrecision?f("geometryPrecision"):c.groupByFieldsForStatistics&&c.groupByFieldsForStatistics.length?f("groupByFieldsForStatistics"):null!=c.maxAllowableOffset?f("maxAllowableOffset"):c.multipatchOption?f("multipatchOption"):null!=c.num?f("num"):c.orderByFields&&c.orderByFields.length?f("orderByFields"):c.outSpatialReference?f("outSpatialReference"):c.outStatistics&&c.outStatistics.length?f("outStatistics"):c.pixelSize?f("pixelSize"):c.quantizationParameters?
f("quantizationParameters"):c.relationParameter?f("relationParameter"):c.returnDistinctValues?f("returnDistinctValues"):null!=c.start?f("start"):c.text?f("text"):c.timeExtent?f("timeExtent"):c.where?f("where"):c.geometry?f("geometry"):!this._options.enableOutFields&&c.outFields&&c.outFields.length?f("outFields"):!this._options.enableObjectId&&c.objectIds&&c.objectIds.length?f("objectIds"):a.resolve()};return t}()})},"esri/views/3d/layers/i3s/Highlights":function(){define(["require","exports","../../webgl-engine/lib/HighlightSet"],
function(x,r,k){var a=function(){return function(a){this.highlightSet=new k;this.ids=new Set;this.options=a}}();return function(){function b(a){this.highlights=[];this.layerView=a}b.prototype.destroy=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()});this.highlights=null};b.prototype.acquireSet=function(b){var c=this,k=new a(b);this.highlights.push(k);return{set:k,handle:{remove:function(){return c.releaseSet(k)}}}};b.prototype.releaseSet=function(a){a.highlightSet.removeAll();
a=this.highlights?this.highlights.indexOf(a):-1;-1!==a&&this.highlights.splice(a,1)};b.prototype.setFeatureIds=function(a,b){b.forEach(function(b){return a.ids.add(b)});this.layerView._forAllFeatures(function(b,c,k,l){a.ids.has(b)&&(b=k.setComponentHighlight(l,c,a.options),a.highlightSet.addObject(k,b))},null,!0)};b.prototype.objectCreated=function(a){var b=this;this.highlights.forEach(function(c){b.layerView._forAllFeaturesOfObject(a,function(a,b,k,n){c.ids.has(a)&&(a=k.setComponentHighlight(n,b,
c.options),c.highlightSet.addObject(k,a))},!0)})};b.prototype.objectDeleted=function(a){this.highlights.forEach(function(b){b.highlightSet.removeObject(a)})};b.prototype.allObjectsDeleted=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()})};return b}()})},"esri/views/3d/webgl-engine/lib/HighlightSet":function(){define(["require","exports"],function(x,r){return function(){function k(){this.items=[]}k.prototype.addObject=function(a,b){this.items.push({type:"object",highlightId:b,
object:a})};k.prototype.addRenderGeometry=function(a,b,c){this.items.push({type:"renderGeometry",highlightId:c,renderGeometry:a,renderer:b})};k.prototype.removeObject=function(a){for(var b=this.items.length-1;0<=b;--b){var c=this.items[b];"object"===c.type&&c.object===a&&(c.object.removeHighlights(c.highlightId),this.items.splice(b,1))}};k.prototype.removeRenderGeometry=function(a){for(var b=this.items.length-1;0<=b;--b){var c=this.items[b];"renderGeometry"===c.type&&c.renderGeometry===a&&(c.renderer.removeRenderGeometryHighlight(c.renderGeometry,
c.highlightId),this.items.splice(b,1))}};k.prototype.removeAll=function(){this.items.forEach(function(a){"object"===a.type?a.object.removeHighlights(a.highlightId):"renderGeometry"===a.type&&a.renderer.removeRenderGeometryHighlight(a.renderGeometry,a.highlightId)});this.items=[]};return k}()})},"esri/views/3d/layers/i3s/IDBCache":function(){define(["require","exports","../../../../core/Error","../../../../core/promiseUtils"],function(x,r,k,a){function b(b){return a.create(function(a,c){b.oncomplete=
function(){return a()};b.onerror=function(){return c(b.error)};b.onabort=function(){return c(b.error)}})}function c(b){return a.create(function(a,c){"done"===b.readyState?null!=b.error?c(b.error):a(b.result):(b.onsuccess=function(){return a(b.result)},b.onerror=function(){return c(b.error)})})}Object.defineProperty(r,"__esModule",{value:!0});x=function(){function t(a,b,c){this._quotaReductionPromise=this._db=null;this._gcCounter=0;this.gcFrequency=50;this.maxByteSize=1073741824;this.quotaReductionFactor=
.2;this._dbName=a;this._storeName=b;this._version=c}t.prototype.init=function(){var b=this;return a.resolve().then(function(){var a=indexedDB.open(b._dbName,b._version);a.onupgradeneeded=function(c){var f=a.result,k=a.transaction,n=f.objectStoreNames.contains(b._storeName)?k.objectStore(b._storeName):f.createObjectStore(b._storeName),f=f.objectStoreNames.contains("last_access")?k.objectStore("last_access"):f.createObjectStore("last_access");f.indexNames.contains("date")||f.createIndex("date","date",
{unique:!1});f.indexNames.contains("byteSize")||f.createIndex("byteSize","byteSize",{unique:!1});c.oldVersion<b._version&&(n.clear(),f.clear())};return c(a)}).then(function(a){b._db=a})};t.prototype.destroy=function(){this._db&&(this._db.close(),this._db=null)};t.prototype.put=function(b,c){var f=this;return null==this._db?a.reject(new k("indexedb:not-initialized","IndexedDB Cache is not initialized")):(null!=this._quotaReductionPromise?this._quotaReductionPromise:a.resolve()).then(function(){return f._put(b,
c)}).otherwise(function(a){if("QuotaExceededError"===a.name)return null==f._quotaReductionPromise&&(f._quotaReductionPromise=f._getCacheSize().then(function(a){return f._removeLeastRecentlyAccessed(c.byteSize+Math.ceil(a*f.quotaReductionFactor))}),f._quotaReductionPromise.always(function(){f._quotaReductionPromise=null})),f._quotaReductionPromise.then(function(){return f._put(b,c)});throw a;}).then(function(){f._gcCounter--;0>f._gcCounter&&(f._gcCounter=f.gcFrequency,f._getCacheSize().then(function(a){return f._removeLeastRecentlyAccessed(a-
f.maxByteSize)}))})};t.prototype.get=function(b){var f=this;return null==this._db?a.resolve(null):a.resolve().then(function(){var a=f._db.transaction(f._storeName,"readonly").objectStore(f._storeName).get(b);return c(a)}).then(function(a){null!=a&&f._db.transaction("last_access","readwrite").objectStore("last_access").put({date:(new Date).getTime(),byteSize:a.byteSize},b);return a}).otherwise(function(a){return null})};t.prototype.remove=function(c){var f=this;return null==this._db?a.resolve():a.resolve().then(function(){var a=
f._db.transaction([f._storeName,"last_access"],"readwrite"),k=a.objectStore(f._storeName),n=a.objectStore("last_access");k.delete(c);n.delete(c);return b(a)})};t.prototype._put=function(a,c){var f=this._db.transaction([this._storeName,"last_access"],"readwrite");f.objectStore(this._storeName).put(c,a);f.objectStore("last_access").put({date:(new Date).getTime(),byteSize:c.byteSize},a);return b(f)};t.prototype._removeLeastRecentlyAccessed=function(a){if(!(0>=a)){var c=this._db.transaction([this._storeName,
"last_access"],"readwrite"),k=c.objectStore(this._storeName),l=c.objectStore("last_access"),n=0,t=l.index("date").openCursor(null,"next");t.onsuccess=function(b){b=t.result;null!=b&&(null!=b.value.byteSize&&(n+=b.value.byteSize),k.delete(b.primaryKey),l.delete(b.primaryKey),n<a&&b.continue())};return b(c)}};t.prototype._getCacheSize=function(){var a=this._db.transaction("last_access"),c=0,k=a.objectStore("last_access").index("byteSize").openKeyCursor();k.onsuccess=function(a){if(a=k.result){var b=
a.key;null!=b&&(c+=b);a.continue()}};return b(a).then(function(){return c})};return t}();r.IDBCache=x;r.whenTransaction=b;r.whenRequest=c})},"esri/views/3d/layers/support/LayerViewUpdatingPercentage":function(){define(["../../../../core/Accessor"],function(x){return x.createSubclass([],{properties:{updating:{readOnly:!0},updatingPercentageValue:{value:100,readOnly:!0},updatingPercentage:{dependsOn:["updating","updatingPercentageValue"],readOnly:!0,value:0,get:function(){return this.updating?this.updatingPercentageValue:
0}}},constructor:function(){}})})},"esri/views/3d/webgl-engine/lib/PreinterleavedGeometryData":function(){define(["require","exports","../../../webgl/Util","./ComponentUtils","./geometryDataUtils"],function(x,r,k,a,b){function c(a){switch(a){case 5120:return Int8Array;case 5126:return Float32Array;case 5124:return Int32Array;case 5122:return Int16Array;case 5121:return Uint8Array;case 5125:return Uint32Array;case 5123:return Uint16Array}throw Error("Unhandled data type: "+a);}return function(){function t(n,
f,q){void 0===q&&(q=t.DefaultOffsets);this.preinterleaved=!0;this.primitiveType="triangle";for(var l=k.getStride(f)/4,l=b.generateDefaultIndexArray(n.length/l),r={},B=0;B<f.length;B++){var v=f[B],w=new (c(v.type))(n.buffer),x=k.getBytesPerElement(v.type);r[v.name]={data:w,size:v.count,offsetIdx:v.offset/x,strideIdx:v.stride/x}}this._id=b.getNewId();this._vertexData=n;this._vertexAttributes=r;this._layout=f;this._indexData=l;this._componentOffsets=a.createOffsets(q)}Object.defineProperty(t.prototype,
"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"vertexData",{get:function(){return this._vertexData},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"indexData",{get:function(){return this._indexData},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"componentOffsets",{get:function(){return this._componentOffsets},
enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"indexCount",{get:function(){return this._indexData.length},enumerable:!0,configurable:!0});t.prototype.getId=function(){return this.id};t.prototype.toRenderData=function(){return{id:this._id.toString(),preinterleaved:!0,indexCount:this.indexCount,vertexData:this._vertexData,layout:this._layout}};t.prototype.getIndices=function(a){return this._indexData};t.prototype.getAttribute=function(a){return this._vertexAttributes[a]};t.prototype.estimateGpuMemoryUsage=
function(){return this._vertexData.byteLength};t.DefaultOffsets=new Uint32Array(0);return t}()})},"esri/views/3d/layers/support/attributeUtils":function(){define(["require","exports"],function(x,r){Object.defineProperty(r,"__esModule",{value:!0});r.attributeLookup=function(k,a){a=a.toLowerCase();for(var b=0,c=Object.keys(k);b<c.length;b++){var t=c[b];if(t.toLowerCase()===a)return k[t]}return null}})},"esri/views/3d/layers/i3s/I3SNodeLoader":function(){define("require exports dojo/_base/lang dojo/Deferred dojo/errors/CancelError ../../webgl-engine/lib/Util ./I3SUtil ./I3SBinaryReader ../../../../core/promiseUtils ../../../../core/urlUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){x=function(){function l(a,b,c,k,n){this.logger=b;this.defaultGeometrySchema=c;this.requiredAttributes=k;this.options=n;this.loadShared=function(a){if(null==a.sharedResource)return f.resolve({});var b=q.makeAbsolute(a.sharedResource.href,a.baseUrl);return this.loadJSON(b).then(function(a){l.fixTextureEncodings(a);l.addAbsoluteHrefTexture(a,b);return a})};this.loader=a;this.cancelled=!1}l.prototype.cancel=function(){this.cancelled=!0};l.prototype.loadJSON=function(b){var c=
this.loader.request(b,"json"),f=new a;c.then(function(a,b){f.resolve(b)},function(a){f.reject(Error("Failed to load: "+b))});return f.promise};l.prototype.loadBinary=function(b){var c=this.loader.request(b,"binary"),f=new a;c.then(function(a,b){f.resolve(b)},function(a){f.reject(Error("Failed to load: "+b))});return f.promise};l.prototype.loadImage=function(b){var c=this.loader.request(b,"image"),f=new a;c.then(function(a,b){f.resolve(b)},function(a){f.reject(Error("Failed to load: "+b))});return f.promise};
l.prototype.loadAttribute=function(a,b,c){a=q.makeAbsolute(c,a);return this.loadBinary(a).then(function(a){return n.readBinaryAttribute(b,a)})};l.prototype.loadAttributes=function(a,b,c){var k=this,l=c.map(function(c){return null==a.attributeData||null==a.attributeData[c.index]?(k.logger.error("Missing attributeData for '"+c.name+"' on node '"+a.id+"'"),f.resolve(null)):k.loadAttribute(b,c.attributeStorageInfo,a.attributeData[c.index].href).otherwise(function(b){k.logger.error("Failed to load attributeData for '"+
c.name+"' on node '"+a.id+"'");return null})});return f.all(l).then(function(a){for(var b={},f=0;f<c.length;++f)a[f]&&(b[c[f].name]=a[f]);return b})};l.prototype.prepareBinaryGeometryData=function(a,b,c,f){k.mixin(a.geometries[0].params,c);f||null!=c.vertexAttributes.region||delete c.vertexAttributes.region;if(null!=c.featureAttributes){f=c.featureAttributes;if(f.faceRange){var l=n.createTypedView(b,f.faceRange);a.componentOffsets=t.convertFlatRangesToOffsets(l,c.header.fields.featureCount,f.faceRange.valuesPerElement)}if(f.id){a.featureIds=
[];var l=1,q=n.valueType2TypedArrayClassMap[f.id.valueType];"UInt64"===f.id.valueType&&(q=Uint32Array,l=2);b=new q(b,f.id.byteOffset,f.id.count*f.id.valuesPerElement*l);for(q=0;q<c.header.fields.featureCount;q++)if(a.featureIds[q]=b[q*f.id.valuesPerElement*l],2===l){var r=b[q*f.id.valuesPerElement*l+1];if(2097150<=r)throw Error("ID exceeded maximum range supported by javascript (max \x3d 53bit-1 \x3d 9007199254740991)");a.featureIds[q]+=4294967296*r}}}};l.prototype.loadBundleData=function(a,b){var c=
this,k=a.baseUrl,l=null,t=this.loadShared(a),r=null;null!=this.requiredAttributes&&(r=this.loadAttributes(a,k,this.requiredAttributes));var p=null;null!=a.geometryData&&(k=q.makeAbsolute(a.geometryData[b].href,k),p=this.loadBinary(k));return t.then(function(k){c.handleCancelled();return(c.options.loadFeatureData?c.loadFeatureData(a,b):f.resolve(null)).then(function(b){c.handleCancelled();var q=c.options.loadFeatureData?c.collectGeometries(a,b,k):c.meshPyramidGeometryData(a,k);b=null!=p?p.then(function(a){l=
a;var b=Object.keys(k.materialDefinitions)[0],b=k.materialDefinitions[b].params.vertexRegions,f=n.createGeometryDataIndex(a,c.defaultGeometrySchema,b);c.prepareBinaryGeometryData(q[0],a,f,b);return q}):f.resolve(q);var t=c.loadTextures(q,k);return f.all([t,b,r])}).then(function(a){var b=a[0],f=a[1];a=a[2];c.handleCancelled();var n=null;a&&(n={attributeData:a,loadedAttributes:c.requiredAttributes});return{allGeometryData:f,attributeDataInfo:n,geometryBuffer:l,sharedResource:k,textureData:b}})})};l.addAbsoluteHrefTexture=
function(a,b){a=a.textureDefinitions;if(null!=a)for(var c=0,f=Object.keys(a);c<f.length;c++)for(var k=0,l=a[f[c]].images;k<l.length;k++){var n=l[k];Array.isArray(n.href)?n.hrefConcat=n.href.map(function(a){return q.makeAbsolute(a,b)}):n.hrefConcat=q.makeAbsolute(n.href,b)}};l.fixTextureEncodings=function(a){a=a.textureDefinitions;if(null!=a)for(var b in a){var c=a[b];if(Array.isArray(c.encoding))for(var f=0;f<c.encoding.length;f++){var k=c.encoding[f];"data:"===k.substring(0,5)&&(c.encoding[f]=k.substring(5))}else k=
c.encoding,"data:"===k.substring(0,5)&&(c.encoding=k.substring(5))}};l.prototype.loadTexture=function(a,b,c,f){var k=this;return f===t.DDS_ENCODING_STRING?this.loadBinary(a).then(function(a){k.handleCancelled();return{i3sTexId:b,data:a,encoding:f}}):this.loadImage(a).then(function(a){var l=a;k.handleCancelled();if(c&&4096<=a.width*a.height){var l=Math.ceil(a.width/2),n=Math.ceil(a.height/2),q=document.createElement("canvas");q.width=l;q.height=n;q.getContext("2d").drawImage(a,0,0,l,n);l=q}return{i3sTexId:b,
data:l,encoding:f}})};l.prototype.loadTextures=function(a,b){for(var k=[],n=0;n<a.length;n++){var q=a[n].geometries;if(null!=q)for(var r=0;r<q.length;r++){var y=q[r].params.textureID||"none";if("none"!==y){null!=b.textureDefinitions&&null!=b.textureDefinitions[y]||this.logger.warn("textureDefinitions missing in shared resource. i3sTexId: "+y);var p=b.textureDefinitions[y];c.assert(void 0!==p,"geometry wants unknown texture "+y);if(0!==p.images.length){var z=p.images[p.images.length-1],A=this.options.textureFormat===
l.TextureFormat.Downsampled,B=t.getAppropriateTextureEncoding(p.encoding,this.options.textureFormat===l.TextureFormat.Compressed),p=-1<B?p.encoding[B]:p.encoding,z=-1<B?z.hrefConcat[B]:z.hrefConcat;this.options.loadTextureData?k.push(this.loadTexture(z,y,A,p)):k.push({i3sTexId:y,encoding:p,data:null})}}}}return f.all(k)};l.prototype.meshPyramidGeometryData=function(a,b){a=b.materialDefinitions?Object.keys(b.materialDefinitions)[0]:null;b=b.textureDefinitions?Object.keys(b.textureDefinitions)[0]:null;
return[{featureIds:[],geometries:[{type:"ArrayBufferView",params:{materialID:a,textureID:b}}],featureDataPosition:[0,0,0]}]};l.prototype.collectGeometries=function(a,b,c){a=[];c=0;for(b=b.featureData;c<b.length;c++){var f=b[c],k=f.geometries;if(null!=k)for(var l=0;l<k.length;l++)a.push({featureIds:[f.id],featureDataPosition:f.position,geometries:[f.geometries[l]]});else null!=f.position&&a.push({featureIds:[f.id],featureDataPosition:f.position,geometries:null})}return a};l.prototype.loadFeatureData=
function(a,b){a=q.makeAbsolute(a.featureData[b].href,a.baseUrl);return this.loadJSON(a)};l.prototype.handleCancelled=function(){if(this.cancelled)throw new b;};return l}();(function(a){a=a.TextureFormat||(a.TextureFormat={});a[a.Compressed=0]="Compressed";a[a.Normal=1]="Normal";a[a.Downsampled=2]="Downsampled"})(x||(x={}));return x})},"esri/views/3d/layers/i3s/I3SIndexTraversal":function(){define("require exports ./GoogPriorityQueue ../../support/PromiseLightweight ../../lib/glMatrix ../../../../core/urlUtils".split(" "),
function(x,r,k,a,b,c){var t=k.goog.structs.PriorityQueue;return function(){function k(a,k,l,n,t,r,w,x,F,G,p){void 0===p&&(p={initDepthFirst:!0,neighborhood:!0,perLevelTraversal:!1});var f=this;this.baseURL=a;this.startNodeUrl=k;this.rootId=l;this.poi=n;this.nodeIndex=t;this.streamDataSupplier=r;this.viewportQueries=w;this.processNodeIndexDocument=x;this.finishedLevelCallback=F;this.logger=G;this.traversalOptions=p;this.queues=[];this.knownNodes=new Set;this.dataLoadingPerLevel=[];this.numIndicesLoading=
this.currentLevel=0;this.cancelled=this.queueTraversalEnabled=!1;this.progressiveLoadPenalty=0;this.initQueryErrback=function(){f.initPromise.done()};this.initQueryCallback=function(a,b){if(f.cancelled)f.initPromise.done();else if(f.nodeTraversalState(b.id),f.enqueueConnected(a,b,0),f.isLeafNode(b))f.initPromise.done();else{for(var k=Infinity,l=null,n=0;n<b.children.length;++n){var p=b.children[n];if(f.nodeIsVisible(p)&&(!f.viewportQueries.hasLOD(b)||!f.viewportQueries.getLodLevel(b))){var q=f.viewportQueries.distToPOI(p,
f.poi);q<k&&(k=q,l=p)}}l?(a=c.makeAbsolute(l.href,a),f.getNode(a,l.id,f.initQueryCallback,f.initQueryErrback)):f.initPromise.done()}};this.poi=b.vec3d.create(n);this._maxLodLevel=this.viewportQueries.maxLodLevel}k.prototype.updatePointOfInterest=function(a){b.vec3d.set(a,this.poi);this.reprioritizeQueues()};k.prototype.start=function(){var b=this;this._nodeTraversalState={};this._nodeIsVisibleCached={};this.dataLoadingPerLevel=[];this.currentLevel=0;this.maxLevel=[];for(var k=0;k<this._maxLodLevel;k++)this.maxLevel[k]=
0;this.rootUrl=c.makeAbsolute(this.startNodeUrl,this.baseURL);this.traversalOptions.initDepthFirst?(this.initPromise=new a.Promise,this.getNode(this.rootUrl,this.rootId,this.initQueryCallback,this.initQueryErrback),this.initPromise.then(function(){b.cancelled||(b.queueTraversalEnabled=!0)})):(this.enqueue({id:this.rootId,hrefConcat:this.rootUrl,mbs:null},0),this.queueTraversalEnabled=!0)};k.prototype.continueTraversal=function(a){void 0===a&&(a=5);if(this.queueTraversalEnabled)for(var b=0;b<this.queues.length;b++)if(!this.traversalOptions.perLevelTraversal||
this.currentLevel===b){for(var c=this.queues[b];this.numIndicesLoading<a&&!c.isEmpty();)this.processQueueOne(b);this.traversalOptions.perLevelTraversal&&c.isEmpty()&&0===this.dataLoadingPerLevel[b]&&(this.finishedLevelCallback.call(null,this.currentLevel),this.currentLevel++)}};k.prototype.isQueueTraversalEnabled=function(){return this.queueTraversalEnabled};k.prototype.getQueueSize=function(){for(var a=0,b=0;b<this.queues.length;b++)a+=this.queues[b].getCount();return a};k.prototype.cancel=function(){this.queueTraversalEnabled=
!1;for(var a=0;a<this.queues.length;a++)this.queues[a].clear();this.cancelled=!0};k.prototype.isLoading=function(){return 0<this.numIndicesLoading||0<this.getQueueSize()};k.prototype.getNumLoading=function(){return this.numIndicesLoading+this.dataLoadingPerLevel[this.currentLevel]};k.prototype.getMaxLevel=function(a){return this.maxLevel[a]};k.prototype.nodeIsVisible=function(a){if(this.traversalOptions.loadEverything)return!0;if(null!=this._nodeIsVisibleCached[a.id])return this._nodeIsVisibleCached[a.id];
this._nodeIsVisibleCached[a.id]=this.viewportQueries.isNodeVisible(a);return this._nodeIsVisibleCached[a.id]};k.prototype.nodeTraversalState=function(a){if(null!=this._nodeTraversalState[a])return this._nodeTraversalState[a];var b=this.nodeIndex[a];if(null==b)return null;var c=null,f=0;if(null!=b.parentNode){c=this.nodeIndex[b.parentNode.id];if(null==c)return null;c=this._nodeTraversalState[c.id];null!=c&&(f=c.lodLevel)}var c=this.viewportQueries.hasLOD(b),k=this.viewportQueries.getLodLevel(b);this._nodeTraversalState[b.id]=
{visited:!0,nodeHasLOD:c,lodLevel:k,isChosen:!c||k>f};return this._nodeTraversalState[a]};k.prototype.reprioritizeQueues=function(){for(var a=0;a<this.queues.length;a++)this.queues[a]=this.reprioritizeQueue(this.queues[a])};k.prototype.reprioritizeQueue=function(a){for(var b=new t;!a.isEmpty();){var c=a.dequeue(),f=this.entryPriority(c);b.enqueue(f,c)}return b};k.prototype.processQueueOne=function(a){var b=this,c=this.queues[a].dequeue();this.dataLoadingPerLevel[a]++;var f=function(){return b.dataLoadingPerLevel[a]--},
k=function(k,l){b.nodeTraversalState(l.id);b.enqueueConnected(k,l,a);k=b.entryPriority(c);b.processNodeIndexDocument(l,k).then(f,f)};this.getNode(c.hrefConcat,c.id,function(a,c){if(b.traversalOptions.neighborhood&&null!=c.parentNode){var l=b.concatHref(c.parentNode,a);b.getNode(l,c.parentNode.id,function(){return k(a,c)},f)}else k(a,c)},f)};k.prototype.getNode=function(a,b,c,k){var f=this;this.numIndicesLoading++;this.nodeIndex[b]?(c(a,this.nodeIndex[b]),this.numIndicesLoading--):this.streamDataSupplier.request(a,
"json").then(function(a,b){f.nodeIndex[b.id]=b;b.baseUrl=a;c(a,b);f.numIndicesLoading--},function(b){null!=k&&k(b);f.loadErrorCallback(a);f.numIndicesLoading--})};k.prototype.isLeafNode=function(a){return null==a.children};k.prototype.concatHref=function(a,b){return c.makeAbsolute(a.href,b)};k.prototype.enqueue=function(a,b){this.traversalOptions.perLevelTraversal||(b=0);for(this.knownNodes.add(a.id);this.queues.length<=b;)this.queues.push(new t),this.dataLoadingPerLevel.push(0);var c=this.entryPriority(a);
this.queues[b].enqueue(c,a)};k.prototype.entryPriority=function(a){if(a.id===this.rootId)return 0;var b=0,c=this.nodeIndex[a.id];null!=c&&null!=c.parentNode&&(c=this._nodeTraversalState[c.parentNode.id],null!=c&&(b=c.lodLevel));a=this.viewportQueries.distToPOI(a,this.poi);return a+b*(a+this.progressiveLoadPenalty)};k.prototype.queueEntryFromNode=function(a,b){return{id:a.id,mbs:a.mbs,hrefConcat:b}};k.prototype.queueEntryFromNodeRef=function(a,b){return this.queueEntryFromNode(a,this.concatHref(a,
b))};k.prototype.enqueueConnected=function(a,b,c){if(!this.cancelled&&null!=b){b.id===this.rootId||null==b.parentNode||this.knownNodes.has(b.parentNode.id)?b.id===this.rootId&&!this.knownNodes.has(b.id)&&this.nodeIsVisible(b)&&this.enqueue(this.queueEntryFromNode(b,a),c):this.enqueue(this.queueEntryFromNodeRef(b.parentNode,a),c-1);var f=this.nodeTraversalState(b.id);if(!f.nodeHasLOD||f.lodLevel!==this._maxLodLevel){if(b.children)for(var k=0,l=b.children;k<l.length;k++){var n=l[k],q=this.nodeIsVisible(n);
!this.knownNodes.has(n.id)&&q&&(this.enqueue(this.queueEntryFromNodeRef(n,a),c+1),this.maxLevel[f.lodLevel]=Math.max(b.level+1,this.maxLevel[f.lodLevel]))}if(this.traversalOptions.neighborhood&&b.neighbors)for(f=0,b=b.neighbors;f<b.length;f++)k=b[f],l=this.nodeIsVisible(k),!this.knownNodes.has(k.id)&&l&&this.enqueue(this.queueEntryFromNodeRef(k,a),c)}}};k.prototype.loadErrorCallback=function(a){this.logger.warn("Error loading node: "+a)};return k}()})},"esri/views/3d/layers/i3s/GoogPriorityQueue":function(){define([],
function(){var x={};(function(){function r(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function k(a,b){a=a.split(".");var c=f;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var k;a.length&&(k=a.shift());)a.length||void 0===b?c=c[k]?c[k]:c[k]={}:c[k]=b}function a(a,b){this.d=a;this.b=b}function b(a){if("array"!=r(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function c(b){this.a=[];if(b)a:{var f,k;if(b instanceof c){f=b.a;k=[];
for(var n=f.length,q=0;q<n;q++)k.push(f[q].getKey());f=k;k=b.a;for(var n=[],q=k.length,r=0;r<q;r++)n.push(k[r].b);k=n;if(0>=b.a.length){b=this.a;for(n=0;n<f.length;n++)b.push(new a(f[n],k[n]));break a}}else{f=[];n=0;for(q in b)f[n++]=q;n=[];q=0;for(k in b)n[q++]=b[k];k=n}for(n=0;n<f.length;n++)t(this,f[n],k[n])}}function t(b,c,f){var k=b.a;k.push(new a(c,f));c=k.length-1;b=b.a;for(f=b[c];0<c;)if(k=c-1>>1,b[k].getKey()>f.getKey())b[c]=b[k],c=k;else break;b[c]=f}function n(){c.call(this)}var f=this;
a.prototype.getKey=function(){return this.d};a.prototype.c=function(){return new a(this.d,this.b)};c.prototype.remove=function(){var a=this.a,c=a.length,f=a[0];if(!(0>=c)){if(1==c)b(a);else{a[0]=a.pop();for(var a=0,c=this.a,k=c.length,n=c[a];a<k>>1;){var r=2*a+1,t=2*a+2,r=t<k&&c[t].getKey()<c[r].getKey()?t:r;if(c[r].getKey()>n.getKey())break;c[a]=c[r];a=r}c[a]=n}return f.b}};c.prototype.c=function(){return new c(this)};c.prototype.g=function(){return this.a.length};c.prototype.h=function(){return 0==
this.a.length};c.prototype.clear=function(){b(this.a)};(function(){function a(){}a.prototype=c.prototype;n.i=c.prototype;n.prototype=new a})();n.prototype.f=function(a,b){t(this,a,b)};n.prototype.e=function(){return this.remove()};k("goog.structs.PriorityQueue",n);k("goog.structs.PriorityQueue.prototype.enqueue",n.prototype.f);k("goog.structs.PriorityQueue.prototype.dequeue",n.prototype.e);k("goog.structs.PriorityQueue.prototype.isEmpty",n.prototype.h);k("goog.structs.PriorityQueue.prototype.clear",
n.prototype.clear);k("goog.structs.PriorityQueue.prototype.clone",n.prototype.c);k("goog.structs.PriorityQueue.prototype.getCount",n.prototype.g)}).call(x);return x})},"esri/views/3d/layers/i3s/I3SLodHandling":function(){define(["require","exports"],function(x,r){return function(){function k(a,b,c){this.layerViewRequiredFunctions=a;this.layerViewOptionalFunctions=b;this.lodGlobalDirtyChanged=c}k.prototype.startNodeLoading=function(a,b,c,k,n){this._lodGlobalDirty=!1;this._lodMode=n.mode;this._allowPartialOverlaps=
n.allowPartialOverlaps;this._maxLodLevel=n.maxLodLevel;this._nodeIndex=c;this._rootId=k;this._nodeTraversalState=b;this._nodeIsVisible=a;this.lodGlobalDirtyChanged(this._lodGlobalDirty)};k.prototype.shouldLoadNode=function(a){var b=this._nodeTraversalState(a.id);return"perLevel"!==this._lodMode?b.isChosen?b.lodLevel===this._maxLodLevel?!0:this._subtreeEmpty(a):!1:b.isChosen||!b.nodeHasLOD?!0:this._allowPartialOverlaps?!this._subtreeComplete(a):this._subtreeEmpty(a)};k.prototype.setLodGlobalDirty=
function(){this._lodGlobalDirty=!0;this.lodGlobalDirtyChanged(this._lodGlobalDirty)};k.prototype.finishedLevel=function(a){"perLevel"===this._lodMode&&this._removeUpToLevelRecursive(this._nodeIndex[this._rootId],a-1)};k.prototype.lodSwapBundleLoaded=function(a){if("perLevel"===this._lodMode){var b=this._nodeTraversalState(a.id).isChosen;b&&this._removeChildrenRecursive(a);null!=this.layerViewOptionalFunctions.setPolygonOffset&&this.layerViewOptionalFunctions.setPolygonOffset(a,!b)}else this.setLodGlobalDirty()};
Object.defineProperty(k.prototype,"requiresLODGlobalHandling",{get:function(){return"global"===this._lodMode&&null!=this._rootId&&(!0===this._lodGlobalDirty||this.layerViewRequiredFunctions.isOverMemory())},enumerable:!0,configurable:!0});k.prototype.lodGlobalHandling=function(){if(this.requiresLODGlobalHandling){var a=this._rootId,b=this.layerViewRequiredFunctions.isOverMemory();this._lodGlobalHandlingRecursion(a,!1,b);this._lodGlobalDirty=!1;this.lodGlobalDirtyChanged(this._lodGlobalDirty)}};k.prototype._lodGlobalHandlingRecursion=
function(a,b,c){var k=this._nodeIndex[a];if(null==k)return!1;a=this._nodeTraversalState(a);a=a.isChosen&&(!a.nodeHasLOD||a.lodLevel===this._maxLodLevel);var n=this.layerViewRequiredFunctions.isBundleAlreadyAddedToStage(k,0);n&&null!=this.layerViewOptionalFunctions.setPolygonOffset&&this.layerViewOptionalFunctions.setPolygonOffset(k,!a);if(a&&n)return this._removeChildrenRecursive(k),!0;var f=!1;if(null!=k.children&&0!==k.children.length)for(var f=!0,q=0,l=k.children;q<l.length;q++){var r=l[q];this._nodeIsVisible(r)&&
(r=this._lodGlobalHandlingRecursion(r.id,n||b,c),f=f&&r)}n&&!a&&(b||f||c)&&(this.layerViewRequiredFunctions.removeNodeData(k),n=!1);return f||n};k.prototype._removeChildrenRecursive=function(a){if(null!=a.children){var b=0;for(a=a.children;b<a.length;b++){var c=this._nodeIndex[a[b].id];null!=c&&(this._removeChildrenRecursive(c),this.layerViewRequiredFunctions.removeNodeData(c))}}};k.prototype._removeUpToLevelRecursive=function(a,b){if(!(null==a||0>b)&&(this._nodeTraversalState(a.id).isChosen||this.layerViewRequiredFunctions.removeNodeData(a),
null!=a.children)){var c=0;for(a=a.children;c<a.length;c++)this._removeUpToLevelRecursive(this._nodeIndex[a[c].id],b-1)}};k.prototype._subtreeEmpty=function(a){if(this.layerViewRequiredFunctions.areAllBundlesLoaded(a))return!1;if(null==a.children)return!0;var b=0;for(a=a.children;b<a.length;b++){var c=a[b];if(this._nodeIsVisible(c)&&(c=this._nodeIndex[c.id],null!=c&&!this._subtreeEmpty(c)))return!1}return!0};k.prototype._subtreeComplete=function(a){if(this.layerViewRequiredFunctions.areAllBundlesLoaded(a))return!0;
if(null==a.children||0===a.children.length)return!1;var b=0;for(a=a.children;b<a.length;b++){var c=a[b];if(this._nodeIsVisible(c)&&(c=this._nodeIndex[c.id],null==c||!this._subtreeComplete(c)))return!1}return!0};return k}()})},"esri/views/3d/layers/i3s/I3SViewportQueries":function(){define("require exports ../../lib/glMatrix ./I3SUtil ../../webgl-engine/lib/Util ../../support/projectionUtils ../graphics/featureExpressionInfoUtils ../graphics/ElevationContext ../graphics/Graphics3DSymbolCommonCode ../../../../geometry/Point".split(" "),
function(x,r,k,a,b,c,t,n,f,q){var l=k.vec3d,y=k.vec4d;return function(){function k(a,c,f,k,l,p,r,A,x){void 0===x&&(x={});this._computedMbs=a;this.indexSR=c;this._renderCoordsHelper=f;this.extent=l;this.errorMetricPreference=p;this.elevationProvider=r;this.options=x;this.fp=[];this.maxLodLevel=2;this._tmp1=[0,0,0];this._tmp2=[0,0,0];this._tmp3=[0,0,0];this._tmp0=[0,0,0];this.supportedMetrics=["screenSpaceRelative","maxScreenThreshold","removedFeatureDiameter","distanceRangeFromDefaultCamera"];this.screenspaceErrorBias=
x.screenspaceErrorBias||1;this.progressiveLoadFactor=x.progressiveLoadFactor||1;this.enableLoD=!x.disableLod;for(a=0;8>a;++a)this.fp[a]=y.create();b.matrix2frustumPlanes(k.viewMatrix,k.projectionMatrix,this.fp);this.engineSR=this._renderCoordsHelper.spatialReference;this._screenSizeFactor=1/k.perPixelRatio;this._camPos=k.eye;A?(this._elevationContext=new n,this._elevationContext.featureExpressionInfoContext=t.createContext(t.extractExpressionInfo(A,!1)),this._elevationContext.mixinApi(A)):this._elevationContext=
null;this.tmpPoint=new q({x:0,y:0,z:0,spatialReference:c})}k.prototype.computedMbs=function(a){var b=this._computedMbs[a.id];null==b&&(b=y.createFrom(0,0,0,-1),this._computedMbs[a.id]=b);0>b[3]&&(y.set(a.mbs,b),this._elevationContext&&1E5>a.mbs[3]&&(this.tmpPoint.x=b[0],this.tmpPoint.y=b[1],this.tmpPoint.z=b[2],b[2]=f.computeElevation(this.elevationProvider,this.tmpPoint,this._elevationContext,this._renderCoordsHelper,null)),c.mbsToMbs(b,this.indexSR,b,this.engineSR));return b};k.prototype.isNodeVisible=
function(a){a=this.computedMbs(a);return this.isMBSinExtent(a)&&this.isMBSVisible(a)};k.prototype.isMBSinExtent=function(b){return this.extent?0!==a.intersectBoundingBoxWithMbs(this.extent,b):!0};k.prototype.isMBSVisible=function(a){var b=a[0],c=a[1],f=a[2];a=a[3];var k=this.fp;return k[0][0]*b+k[0][1]*c+k[0][2]*f+k[0][3]<=a&&k[1][0]*b+k[1][1]*c+k[1][2]*f+k[1][3]<=a&&k[2][0]*b+k[2][1]*c+k[2][2]*f+k[2][3]<=a&&k[3][0]*b+k[3][1]*c+k[3][2]*f+k[3][3]<=a&&k[4][0]*b+k[4][1]*c+k[4][2]*f+k[4][3]<=a&&k[5][0]*
b+k[5][1]*c+k[5][2]*f+k[5][3]<=a};k.prototype.calcScreenSpaceSize=function(a,b){a=this.computedMbs(a);var c=a[3];a=l.dist2(a,this._camPos)-c*c;return 0>a?.5*Number.MAX_VALUE:b/Math.sqrt(a)*this._screenSizeFactor};k.prototype.calcCameraDistance=function(a){a=this.computedMbs(a);return Math.max(0,l.dist(a,this._camPos)-a[3])};k.prototype.calcAngleDependentLoD=function(a){a=this.computedMbs(a);var b=a[3];a=(Math.abs(a[0]*(a[0]-this._camPos[0])+a[1]*(a[1]-this._camPos[1])+a[2]*(a[2]-this._camPos[2]))/
l.length(a)+b)/l.dist(a,this._camPos);return Math.min(1,a)};k.prototype.hasLOD=function(a){return null!=a.lodSelection};k.prototype.hasFeatures=function(a){return null!=a.featureData};k.prototype.getDistancePlanarMode=function(a,b,c){var f=a[0]-b[0],k=a[1]-b[1];a=a[2]-b[2];f=f+f+k*k;if(f<=c*c)return Math.abs(a);c=Math.sqrt(f)-c;return Math.sqrt(a*a+c*c)};k.prototype.getDistanceGlobeMode=function(a,b,c){var f=l.length(b),k=l.length(a)-f;l.scale(a,l.dot(a,b)/l.length2(a),this._tmp0);if(l.dist2(b,this._tmp0)<=
c*c)return Math.abs(k);b=l.scale(b,1/f,this._tmp0);var f=l.scale(b,f-c*c/2/f,this._tmp1),n=l.subtract(a,f,this._tmp2),n=l.subtract(n,l.scale(b,l.dot(b,n),this._tmp3),this._tmp2),f=l.add(f,l.scale(n,c/l.length(n),this._tmp2),this._tmp2);c=l.dist(a,f);2E5<=k&&(a=l.subtract(a,f,this._tmp1),a=l.dot(a,b)/l.length(a),.08>a&&(a=1E-4),c/=a);return c};k.prototype.getDistance=function(a,b,f){return this.engineSR===c.SphericalECEFSpatialReference?this.getDistanceGlobeMode(a,b,f):this.getDistancePlanarMode(a,
b,f)};k.prototype._selectErrorMetric=function(a){if(this.errorMetricPreference)for(var b=0;b<this.errorMetricPreference.length;b++)for(var c=0;c<a.length;c++){if(a[c].metricType===this.errorMetricPreference[b])return a[c]}else for(b=0;b<a.length;b++)if(0<=this.supportedMetrics.indexOf(a[b].metricType))return a[b];return null};k.prototype.getLodLevel=function(a){if(a.lodSelection&&0<a.lodSelection.length){if(!1===this.hasFeatures(a))return 0;if(null==a.children||0===a.children.length)return this.maxLodLevel;
var b=this.enableLoD?this._selectErrorMetric(a.lodSelection):null;if(null!=b){if(1>this.progressiveLoadFactor){var c=this.screenspaceErrorBias;return this.evaluateLODmetric(a,this.progressiveLoadFactor*this.screenspaceErrorBias,b)?this.evaluateLODmetric(a,c,b)?2:1:0}return this.evaluateLODmetric(a,this.screenspaceErrorBias,b)?this.maxLodLevel:0}}return 0};k.prototype.evaluateLODmetric=function(a,b,c){return"screenSpaceRelative"===c.metricType?(a=this.computedMbs(a),a=2*this.getDistance(this._camPos,
a,a[3])/this._screenSizeFactor,c.maxError*b<=a):"maxScreenThreshold"===c.metricType?(b=this.calcScreenSpaceSize(a,a.mbs[3]*b),this.options.angleDependentLoD&&(b*=this.calcAngleDependentLoD(a)),b<c.maxError):"removedFeatureDiameter"===c.metricType?10>this.calcScreenSpaceSize(a,c.maxError)*b:"distanceRangeFromDefaultCamera"===c.metricType?this.calcCameraDistance(a)>c.maxError*b:!1};k.prototype.distToPOI=function(a,b){a=this.computedMbs(a);return l.dist(a,b)-a[3]};k.prototype.distCameraToPOI=function(a){return l.dist(this._camPos,
a)};return k}()})},"esri/views/3d/layers/i3s/IdleQueue":function(){define(["require","exports","dojo/Deferred"],function(x,r,k){Object.defineProperty(r,"__esModule",{value:!0});x=function(){function a(){this._deferreds=[];this._values=[]}a.prototype.push=function(a){var b=new k;this._deferreds.push(b);this._values.push(a);return b.promise};a.prototype.length=function(){return this._deferreds.length};a.prototype.process=function(){this._deferreds.shift().resolve(this._values.shift())};a.prototype.cancelAll=
function(){for(var a=0,c=this._deferreds;a<c.length;a++)c[a].cancel();this._deferreds.length=0;this._values.length=0};return a}();r.IdleQueue=x})},"esri/layers/SceneLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators ./Layer ./FeatureLayer ./support/Field ./support/fieldUtils ./support/LabelClass ../symbols/support/ElevationInfo ./support/labelingInfo ./support/FeatureReduction ./mixins/SceneService ./support/commonProperties ../PopupTemplate ../request ../core/requireUtils ../core/promiseUtils ../core/urlUtils ../core/Error ../core/Logger ../core/accessorSupport/PropertyOrigin ../core/accessorSupport/utils ../renderers/support/jsonUtils ../renderers/support/styleUtils ../renderers/support/typeUtils ../portal/PortalItem ../tasks/support/Query dojo/_base/lang dojo/promise/all".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S){function T(a,b,c){a&&((a=L.read(a,b,c)||void 0)||h.error("Failed to create renderer",{rendererDefinition:a,layer:this,context:c}));return a}var V=["3DObject","Point"],h=J.getLogger("esri.layers.SceneLayer"),ca={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},
Q={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"};return function(c){function d(a,b){a=c.call(this)||this;a.featureReduction=null;a.operationalLayerType="ArcGISSceneServiceLayer";a.type="scene";a.fields=[];a.definitionExpression=null;a.elevationInfo=null;a.labelsVisible=!1;a.labelingInfo=null;a.legendEnabled=!0;a.cachedDrawingInfo={color:!1};a.popupEnabled=!0;a.popupTemplate=null;a.objectIdField=null;a.objectIdFilter=null;a._fieldUsageInfo={};a.screenSizePerspectiveEnabled=
!0;return a}k(d,c);d.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?R.mixin({},{url:a},b):a};d.prototype.getField=function(a){return f.getField(a,this.fields)};Object.defineProperty(d.prototype,"geometryType",{get:function(){return Q[this.profile]||"mesh"},enumerable:!0,configurable:!0});d.prototype.readLabelsVisible=function(a,b){return b.showLabels};d.prototype.writeLabelsVisible=function(a,b){b.showLabels=!!a};Object.defineProperty(d.prototype,"renderer",{set:function(a){f.fixRendererFields(a,
this.fields);this._set("renderer",a)},enumerable:!0,configurable:!0});d.prototype.readCachedDrawingInfo=function(a,b){if(null==a||"object"!==typeof a)a={};null==a.color&&(a.color=!1);return a};d.prototype.readPopupEnabled=function(a,b){return null!=b.disablePopup?!b.disablePopup:void 0};d.prototype.writePopupEnabled=function(a,b){a||(b.disablePopup=!0)};d.prototype.readObjectIdField=function(a,b){!a&&b.fields&&b.fields.some(function(b){"esriFieldTypeOID"===b.type&&(a=b.name);return!!a});return a||
void 0};d.prototype.readProfile=function(a,b){a=b.store.profile;if(null!=a&&ca[a])return ca[a];h.error("Unknown or missing profile",{profile:a,layer:this});return"mesh-pyramids"};d.prototype.readNormalReferenceFrame=function(a,b){return b.store.normalReferenceFrame};d.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Scene Service"]}).always(function(){return a._fetchService()}).then(function(){return S([a._verifyRootNodeAndUpdateExtent(),a._setCompanionFeatureLayer()])}).then(function(){return a._applyCompanionOverrides()}).then(function(){return a._populateFieldUsageInfo()}).then(function(){return O.loadStyleRenderer(a,
{origin:"service"})}).then(function(){return f.fixRendererFields(a.renderer,a.fields)});this.addResolvingPromise(b);return this.when()};d.prototype.createLayerView=function(a){var b=this;return G.when(x,null==this.profile||"mesh-pyramids"===this.profile?"../views/3d/layers/SceneLayerView3D":"../views/3d/layers/SceneLayerGraphicsView3D").then(function(c){return new c({view:a,layer:b})})};d.prototype.createQuery=function(){var a=new N;"mesh"!==this.geometryType&&(a.returnGeometry=!0,a.returnZ=!0);a.where=
this.definitionExpression||"1\x3d1";a.sqlFormat="standard";return a};d.prototype.queryExtent=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryExtent(a||b.createQuery())})};d.prototype.queryFeatureCount=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryFeatureCount(a||b.createQuery())})};d.prototype.queryFeatures=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryFeatures(a||
b.createQuery())}).then(function(a){if(a&&a.features)for(var c=0,d=a.features;c<d.length;c++)d[c].layer=b;return a})};d.prototype.queryObjectIds=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryObjectIds(a||b.createQuery())})};d.prototype.getFieldUsageInfo=function(a){return this._fieldUsageInfo[a]||{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}};d.prototype._getAssociatedLayerForQuery=function(){var a=this;
if(!this.loaded)return this.load().then(function(){return a._getAssociatedLayerForQuery()});var b=this.associatedLayer;return null!=b?p.resolve(b):p.reject(new A("scenelayer:query-not-available","SceneLayer queries are not available without associated feature layer"))};d.prototype.hasCachedStatistics=function(a){return null!=this.statisticsInfo&&this.statisticsInfo.some(function(b){return b.name===a})};d.prototype.queryCachedStatistics=function(a){if(!this.hasCachedStatistics(a))return p.reject(new A("scenelayer:no-cached-statistics",
"Cached statistics for this attribute are not available"));for(var b=0,c=this.statisticsInfo;b<c.length;b++){var d=c[b];if(d.name===a)return a=z.join(this.parsedUrl.path,d.href),F(a,{query:{f:"json"},responseType:"json"}).then(function(a){return a.data})}};d.prototype.graphicChanged=function(a){this.emit("graphic-update",a)};d.prototype._validateLayer=function(a){if(a.layerType&&-1===V.indexOf(a.layerType))throw new A("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",
{layerType:a.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(1<this.version.major)throw new A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});a=this.normalReferenceFrame;var b=this.spatialReference,c=!1,d=!1;if(null==a)d=c=!0;else switch(b=
b&&b.isGeographic,a){case "east-north-up":case "earth-centered":c=!0;d=b;break;case "vertex-reference-frame":c=!0;d=!b;break;default:c=!1}if(!c)throw new A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!d)throw new A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.");};d.prototype._populateFieldUsageInfo=function(){this._fieldUsageInfo={};if(this.fields)for(var a=function(a){var c=!(!b.attributeStorageInfo||
!b.attributeStorageInfo.some(function(b){return b.name===a.name})),d=!!(b.associatedLayer&&b.associatedLayer.fields&&b.associatedLayer.fields.some(function(b){return b&&a.name===b.name}));b._fieldUsageInfo[a.name]={supportsLabelingInfo:c,supportsRenderer:c,supportsPopupTemplate:c||d,supportsLayerQuery:d}},b=this,c=0,d=this.fields;c<d.length;c++)a(d[c])};d.prototype._applyCompanionOverrides=function(){if(this.associatedLayer){if(this.associatedLayer.fields)for(var a=0,b=this.associatedLayer.fields;a<
b.length;a++){var c=b[a];this.getField(c.name)||this.fields.push(c.clone())}a=["popupTemplate","popupEnabled"];b=K.getProperties(this);for(c=0;c<a.length;c++){var d=a[c];this._buddyIsMoreImportant(d)&&(b.setDefaultOrigin(this.associatedLayer.originOf(d)),b.set(d,this.associatedLayer[d]),b.setDefaultOrigin("user"))}}};d.prototype._setCompanionFeatureLayer=function(){var a=this;return this._fetchCompanionFeatureLayer().then(function(b){a.associatedLayer=b})};d.prototype._fetchCompanionFeatureLayer=
function(){var a=this;return-1===["mesh-pyramids","points"].indexOf(this.profile)?p.resolve(null):(this.portalItem&&this.portalItem.isResolved()?this._fetchCompanionFeatureLayerFromRelatedItems(this.portalItem):this._fetchCompanionFeatureLayerFromUrl()).then(function(a){return a.load()}).otherwise(function(b){null==a.attributeStorageInfo?h.warn("Companion FeatureLayer could not be loaded and no binary attributes found. Popups will not work for this SceneLayer: "+a.title):h.info("Companion FeatureLayer could not be loaded. Falling back to binary attributes for Popups on this SceneLayer: "+
a.title);return null})};d.prototype._fetchCompanionFeatureLayerFromRelatedItems=function(a){var b=this;return a.fetchRelatedItems({relationshipType:"Service2Data",direction:"forward"}).then(function(a){return(a=a.filter(function(a){return"Feature Service"===a.type})[0])?b._fetchCompanionFeatureLayerFromPortalItem(new U({id:a.id,portal:a.portal})):p.reject()}).otherwise(function(){return b._fetchCompanionFeatureLayerFromUrl()})};d.prototype._fetchCompanionFeatureLayerFromPortalItem=function(a){var b=
this;return a.load().then(function(a){return b._findMatchingCompanionSublayerUrl(a.url)}).then(function(b){return p.resolve(new t({url:b,portalItem:a}))})};d.prototype._fetchCompanionFeatureLayerFromUrl=function(){return this._findMatchingCompanionSublayerUrl().then(function(a){return p.resolve(new t({url:a}))})};d.prototype._findMatchingCompanionSublayerUrl=function(a){var b=this.parsedUrl.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);if(!b)return p.reject();null==a&&(a=b[1]+"/FeatureServer");
var c=a.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1");a={query:{f:"json"},responseType:"json"};var d=b[1]+"/SceneServer",e=parseInt(b[2],10),b=F(d,a).otherwise(function(a){return{layers:null}});a=F(c,a);return S([a,b]).then(function(a){var b=a[0];a=a[1];a=a.data&&a.data.layers;b=b.data&&b.data.layers;if(!Array.isArray(b))throw Error("expected layers array");if(Array.isArray(a))for(var d=0;d<Math.min(a.length,b.length);d++){if(a[d].id===e)return c+"/"+b[d].id}else if(e<b.length)return c+"/"+b[e].id;
throw Error("could not find matching associated sublayer");})};d.prototype._buddyIsMoreImportant=function(a){if(!this.associatedLayer)return!1;var b=I.nameToId(this.originOf(a));a=I.nameToId(this.associatedLayer.originOf(a));return null!=a&&a<=I.OriginId.SERVICE?null==b||b<I.OriginId.SERVICE:null!=a&&a<=I.OriginId.PORTAL_ITEM?null==b||b<I.OriginId.PORTAL_ITEM:!1};a([b.shared("esri.layers.SceneLayer")],d.prototype,"declaredClass",void 0);a([b.property({types:{key:"type",base:B.FeatureReduction,typeMap:{selection:B.FeatureReductionSelection}},
json:{origins:{"web-scene":{read:{source:"layerDefinition.featureReduction"},write:{target:"layerDefinition.featureReduction"}}}}})],d.prototype,"featureReduction",void 0);a([b.property()],d.prototype,"associatedLayer",void 0);a([b.property()],d.prototype,"operationalLayerType",void 0);a([b.property({json:{read:!1},readOnly:!0})],d.prototype,"type",void 0);a([b.property({type:[n]})],d.prototype,"fields",void 0);a([b.property({readOnly:!0})],d.prototype,"attributeStorageInfo",void 0);a([b.property({readOnly:!0})],
d.prototype,"statisticsInfo",void 0);a([b.property({type:String,json:{origins:{service:{read:!1,write:!1}},read:{source:"layerDefinition.definitionExpression"},write:{target:"layerDefinition.definitionExpression"}}})],d.prototype,"definitionExpression",void 0);a([b.property({type:l,json:{origins:{service:{read:{source:"elevationInfo"}}},read:{source:"layerDefinition.elevationInfo"},write:{target:"layerDefinition.elevationInfo"}}})],d.prototype,"elevationInfo",void 0);a([b.property({type:String,dependsOn:["profile"]})],
d.prototype,"geometryType",null);a([b.property({type:Boolean})],d.prototype,"labelsVisible",void 0);a([b.reader("labelsVisible",["showLabels"])],d.prototype,"readLabelsVisible",null);a([b.writer("labelsVisible")],d.prototype,"writeLabelsVisible",null);a([b.property({type:[q],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:y.reader},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:y.reader},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],
d.prototype,"labelingInfo",void 0);a([b.property({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],d.prototype,"legendEnabled",void 0);a([b.property({types:P.types,json:{origins:{service:{read:{source:"drawingInfo.renderer",reader:T}}},read:{source:"layerDefinition.drawingInfo.renderer",reader:T},write:{target:"layerDefinition.drawingInfo.renderer"}},value:null})],d.prototype,"renderer",null);a([b.property({json:{read:!1}})],d.prototype,
"cachedDrawingInfo",void 0);a([b.reader("service","cachedDrawingInfo")],d.prototype,"readCachedDrawingInfo",null);a([b.property({type:Boolean})],d.prototype,"popupEnabled",void 0);a([b.reader("popupEnabled",["disablePopup"])],d.prototype,"readPopupEnabled",null);a([b.writer("popupEnabled")],d.prototype,"writePopupEnabled",null);a([b.property({type:D,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],d.prototype,"popupTemplate",void 0);a([b.property({type:String,json:{read:!1}})],d.prototype,
"objectIdField",void 0);a([b.reader("service","objectIdField",["objectIdField","fields"])],d.prototype,"readObjectIdField",null);a([b.property()],d.prototype,"objectIdFilter",void 0);a([b.property({type:String,json:{read:!1}})],d.prototype,"profile",void 0);a([b.reader("service","profile",["store.profile"])],d.prototype,"readProfile",null);a([b.property({readOnly:!0,type:String,json:{read:!1}})],d.prototype,"normalReferenceFrame",void 0);a([b.reader("service","normalReferenceFrame",["store.normalReferenceFrame"])],
d.prototype,"readNormalReferenceFrame",null);a([b.property(w.screenSizePerspectiveEnabled)],d.prototype,"screenSizePerspectiveEnabled",void 0);return d=a([b.subclass()],d)}(b.declared(c,v))})},"esri/views/3d/layers/ElevationLayerView3D":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ./TiledLayerView3D ./support/tiledLayerUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q){return function(f){function l(){return null!==f&&f.apply(this,arguments)||this}k(l,f);l.prototype.initialize=function(){var a=this,b=this.get("view.map.ground.layers"),f=this.get("view.map.allLayers"),f=f&&f.includes(this.layer),b=b&&b.includes(this.layer);f&&!b&&(b=new c("layerview:elevation-layer-only","3D elevation layer '"+this.layer.id+"' can only be added in the map ground"),this.addResolvingPromise(t.reject(b)));(b=this._getTileInfoSupportError(this.tileInfo,this.layer.fullExtent))?
this.addResolvingPromise(t.reject(b)):(b=n.whenTrueOnce(this.view,"basemapTerrain.tilingSchemeLocked").then(function(){q.throwIfError(a._getTileInfoCompatibilityError(a.tileInfo,a.view.basemapTerrain.tilingScheme))}),this.addResolvingPromise(b));this.addResolvingPromise(q.checkArcGISServiceVersionCompatibility(this.layer));this._updateMinMaxDataLevel()};a([b.property({aliasOf:"layer.fullExtent"})],l.prototype,"fullExtent",void 0);a([b.property()],l.prototype,"layer",void 0);a([b.property({aliasOf:"layer.tileInfo"})],
l.prototype,"tileInfo",void 0);return l=a([b.subclass("esri.views.3d.layers.ElevationLayerView3D")],l)}(b.declared(f))})},"esri/views/3d/layers/TiledLayerView3D":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../core/Error ./LayerView3D ./support/LayerViewUpdatingPercentage ../terrain/terrainUtils".split(" "),function(x,r,k,a,b,c,t,n,f){return function(n){function l(){var a=null!==n&&n.apply(this,
arguments)||this;a.minDataLevel=0;a.maxDataLevel=Infinity;a._numUpdating=0;a._maxNumUpdating=0;a._isUpdating=!1;return a}k(l,n);Object.defineProperty(l.prototype,"formatIsTransparent",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"isTransparent",{get:function(){return 1>this.fullOpacity||this.formatIsTransparent},enumerable:!0,configurable:!0});l.prototype.getTileUrl=function(a,b,c){return this.layer.getTileUrl(a,b,c)};l.prototype._evaluateUpdatingState=
function(a){this._isUpdating=a;this.notifyChange("updating")};l.prototype.isUpdating=function(){return this._isUpdating};l.prototype._getTileInfoSupportError=function(a,b){if(a=f.checkIfTileInfoSupportedForView(a,b,this.view.spatialReference,this.view.basemapTerrain.manifold)){b={layer:this.layer,error:a};var k=void 0;switch(a.name){case "tilingscheme:local-gcs-not-supported":k=new c("layerview:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes",b);break;case "tilingscheme:spatial-reference-mismatch":case "tilingscheme:global-unsupported-spatial-reference":k=
new c("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",b);break;default:k=new c("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",b)}return k}return null};l.prototype._getTileInfoCompatibilityError=function(a,b){return b.compatibleWith(a)?null:new c("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")};
l.prototype._updateMinMaxDataLevel=function(){var a=Infinity,b=0;this.tileInfo.lods.forEach(function(c){a=Math.min(c.level,a);b=Math.max(c.level,b)});c=[a,b];this.minDataLevel=c[0];this.maxDataLevel=c[1];var c};a([b.property({readOnly:!0})],l.prototype,"formatIsTransparent",null);a([b.property()],l.prototype,"fullExtent",void 0);a([b.property({readOnly:!0,dependsOn:["fullOpacity","formatIsTransparent"]})],l.prototype,"isTransparent",null);a([b.property()],l.prototype,"layer",void 0);a([b.property()],
l.prototype,"minDataLevel",void 0);a([b.property()],l.prototype,"maxDataLevel",void 0);a([b.property()],l.prototype,"tileInfo",void 0);return l=a([b.subclass("esri.views.3d.layers.TiledLayerView3D")],l)}(b.declared(t,n))})},"esri/views/3d/layers/support/tiledLayerUtils":function(){define("require exports dojo/request/xhr ../../../../core/Error ../../../../core/promiseUtils ../../../../layers/support/arcgisLayerUrl".split(" "),function(x,r,k,a,b,c){function t(a){var b=null,c=a.search(/\/rest\/services\//i);
0<c&&(b=a.substring(0,c+6));return b}Object.defineProperty(r,"__esModule",{value:!0});r.checkArcGISServiceVersionCompatibility=function(n){if(!c.isHostedAgolService(n.url)){if(10.22>n.version)return n=new a("layerview:service-version-too-old","Tiled Map Layers on servers prior to 10.2.2 are not supported. Detected version: "+n.version,{minVersion:10.22,detectedVersion:n.version}),b.reject(n);if(10.22!==n.version||c.isHostedSecuredProxyService(n.url,n.get("portalItem.id")))return b.resolve();n=t(n.url);
var f=new a("tiledlayerview3d:service-missing-cors-patch","Tiled Map Layers from 10.2.2 servers are only supported if all server updates have been applied.");return k(n+"self?f\x3djson",{headers:{"X-Requested-With":null},timeout:1E4,handleAs:"json"}).then(function(a){if(!a||a.error)throw f;}).otherwise(function(){throw f;})}};r.throwIfError=function(a){if(a)throw a;}})},"esri/views/3d/layers/FeatureLayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../../../layers/FeatureLayer ./GraphicLayerView3DBase ../../../layers/graphics/controllers/SnapshotController ../../../core/watchUtils ../../../core/Error ../../../core/promiseUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l){return function(r){function t(a){var b=r.call(this)||this;b.labelingEnabled=a.layer instanceof c;return b}k(t,r);v=t;t.prototype.initialize=function(){this.addResolvingPromise(this.validateMaximumFeatureCount())};t.prototype.createController=function(){var a=this;return this.layer.createGraphicsController({layerView:this,options:{maxPageSize:300,extent:this.view.clippingArea}}).then(function(b){b instanceof n&&a._eventHandles.push(f.whenFalseOnce(a,"suspended",function(){b.startup()}));
return b}).otherwise(function(a){return l.reject(new q("featurelayerview3d:create-controller",a.message,{error:a}))})};t.prototype.validateMaximumFeatureCount=function(){return 0>v.maximumFeatureCount||!this.layer.url?l.resolve():this.layer.queryFeatureCount().then(function(a){if(a>v.maximumFeatureCount)throw new q("featurelayerview3d:maximum-feature-count-exceeded","The maximum number of allowed features (${maximumFeatureCount}) has been exceeded (layer has ${numberOfFeatures} features)",{maximumFeatureCount:v.maximumFeatureCount,
numberOfFeatures:a});})};t.maximumFeatureCount=-1;a([b.property()],t.prototype,"controller",void 0);return t=v=a([b.subclass("esri.views.3d.layers.FeatureLayerView3D")],t);var v}(b.declared(t))})},"esri/views/3d/layers/GraphicLayerView3DBase":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators dojo/promise/all ./graphics/Graphics3DLayerViewCore ./graphics/graphicUtils ./support/LayerViewUpdatingPercentage ../../../renderers/support/renderingInfoUtils ../support/PromiseLightweight ../../../core/watchUtils ./LayerView3D ./support/projectExtentUtils ../../../core/Error ../../../core/promiseUtils ../../../layers/graphics/QueryEngine".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F){return function(f){function p(a){a=f.call(this)||this;a.supportsHeightUnitConversion=!0;a.controller=null;a.supportsDraping=!0;a._overlayUpdating=null;a._progressMaxNumNodes=0;a._eventHandles=[];a._controllerClientSideFiltering=!1;a._suspendResumeExtent=null;a.fullExtentInViewSpatialReference=null;a._isUpdating=!1;a._controllerCreated=!1;return a}k(p,f);Object.defineProperty(p.prototype,"drawingOrder",{set:function(a){this._layerViewCore.graphicsCore.setDrawingOrder(a);
this._set("drawingOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"hasDraped",{get:function(){return this._layerViewCore.graphicsCore.hasDraped},enumerable:!0,configurable:!0});p.prototype.initialize=function(){var a=this;this._layerViewCore=new t({owner:this,layer:this.layer,spatialIndexRequired:!0,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,labelingEnabled:this.labelingEnabled,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,verticalScaleEnabled:this.supportsHeightUnitConversion,
highlightsEnabled:!0,updateSuspendResumeExtent:function(){return a.updateSuspendResumeExtent()},updateClippingExtent:function(b){return a.updateClippingExtent(b)}});this.addResolvingPromise(this._layerViewCore.initialize());this.drawingOrder=this.view.getDrawingOrder(this.layer.uid);this.initializeController();this.addResolvingPromise(this.validateGeometryType());var b=v.toView(this).then(function(b){a.fullExtentInViewSpatialReference=b});b&&this.addResolvingPromise(b);this._evaluateUpdatingState()};
p.prototype.destroy=function(){this._eventHandles.forEach(function(a){return a.remove()});this._eventHandles=null;this.controller&&(this.controller.destroy(),this.controller=null);this._layerViewCore&&(this._layerViewCore.destroy(),this._layerViewCore=null);this.loadedGraphics=null};p.prototype.getRenderingInfo=function(a){if((a=q.getRenderingInfo(a,{renderer:this.layer.renderer}))&&a.color){var b=a.color;b[0]/=255;b[1]/=255;b[2]/=255}return a};p.prototype.getGraphicsFromStageObject=function(a,b){var c=
a.getMetadata().graphicId,f=null;this.loadedGraphics&&this.loadedGraphics.some(function(a){return a.uid===c?(f=a,!0):!1});a=new l.Promise;null!==f?a.done(f):a.reject();return a};p.prototype.getGraphics3DGraphics=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphics()};p.prototype.getGraphics3DGraphicsKeys=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphicsKeys()};p.prototype.getSymbolUpdateType=function(){return this._layerViewCore.graphicsCore.getSymbolUpdateType()};
p.prototype.queryGraphics=function(){return this._queryEngine?this._queryEngine.queryFeatures():this._rejectQuery()};p.prototype.queryFeatures=function(a){return this._queryEngine?this._queryEngine.queryFeatures(a):this._rejectQuery()};p.prototype.queryObjectIds=function(a){return this._queryEngine?this._queryEngine.queryObjectIds(a):this._rejectQuery()};p.prototype.queryFeatureCount=function(a){return this._queryEngine?this._queryEngine.queryFeatureCount(a):this._rejectQuery()};p.prototype.queryExtent=
function(a){return this._queryEngine?this._queryEngine.queryExtent(a):this._rejectQuery()};p.prototype.whenGraphicBounds=function(a){return this._layerViewCore.graphicsCore.whenGraphicBounds(a)};p.prototype.highlight=function(a,b){return this._layerViewCore.highlight(a,b,this.layer.objectIdField)};p.prototype._rejectQuery=function(){return D.reject(new w("FeatureLayerView3D","Not ready to execute query"))};p.prototype._notifySuspendedChange=function(){this.notifyChange("suspended")};p.prototype._notifyDrapedDataChange=
function(){this.notifyChange("hasDraped");this.emit("draped-data-change")};p.prototype.canResume=function(){return this.inherited(arguments)&&this._layerViewCore&&this._layerViewCore.canResume()};p.prototype._evaluateUpdatingState=function(){if(this._layerViewCore.elevationAlignment){var a;a=0+this._layerViewCore.elevationAlignment.numNodesUpdating();a+=this._layerViewCore.graphicsCore.numNodesUpdating();var b;b=(b=(b=(b=(b=!this._controllerCreated)||this.controller&&this.controller.updating)||this._overlayUpdating)||
this._layerViewCore.graphicsCore.needsIdleUpdate())||!(this.view.basemapTerrain&&this.view.basemapTerrain.ready);var c;c=(c=0<a||b||this._layerViewCore.spatialIndex.isUpdating())||this._layerViewCore.elevationAlignment.isUpdating();this._progressMaxNumNodes=Math.max(a,this._progressMaxNumNodes);0===a&&(this._progressMaxNumNodes=1);this._isUpdating=c;this.notifyChange("updating");this._set("updatingPercentageValue",b?100:100*a/this._progressMaxNumNodes)}else this._isUpdating=!1,this.notifyChange("updating"),
this._set("updatingPercentageValue",100)};p.prototype.isUpdating=function(){return this._isUpdating};p.prototype.initializeController=function(){var a=this,b=null,f=this.createController().then(function(a){b=a}),k=y.whenTrueOnce(this.view,"basemapTerrain.ready");c([this.when(),k]).then(function(){a.controller=b;a._eventHandles.push(a.controller.watch("updating",function(){return a._evaluateUpdatingState()}));a.loadedGraphics=b.graphics;a._queryEngine=new F({features:a.loadedGraphics,objectIdField:a.layer.objectIdField});
a._evaluateUpdatingState()}).always(function(){a._controllerCreated=!0;a._evaluateUpdatingState()});this.addResolvingPromise(f)};p.prototype.updateClippingExtent=function(a){if(this.controller){if(this._controllerClientSideFiltering)return!1;this.controller.extent?(this.controller.extent=null,this._controllerClientSideFiltering=!0):this.controller.extent=a;return!0}return!1};p.prototype.updateSuspendResumeExtent=function(){return this._suspendResumeExtent=n.enlargeExtent(this._layerViewCore.graphicsCore.computedExtent,
this._suspendResumeExtent,1.2)};p.prototype.validateGeometryType=function(){var a=this.layer;switch(a.geometryType){case "multipatch":case "multipoint":return D.reject(new w("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:a.geometryType}))}};p.prototype.getStats=function(){var a=this._layerViewCore.graphicsCore.getGraphics3DGraphics(),b="null",c=this._suspendResumeExtent;c&&(b=[c[0],c[1],c[2],c[3]].map(function(a){return a.toPrecision(4)}).join(", "));
var c="null",f=this._layerViewCore.graphicsCore.computedExtent;f&&(c=[f.xmin,f.ymin,f.xmax,f.ymax].map(function(a){return a.toPrecision(4)}).join(", "));return{numCollection:this.loadedGraphics.length,numGraphics:Object.keys(a).length,numElevationUpdating:this._layerViewCore.elevationAlignment.numNodesUpdating(),numSpatialIndexUpdating:this._layerViewCore.spatialIndex.numNodesUpdating(),numGraphicsUpdating:this._layerViewCore.graphicsCore.numNodesUpdating(),visibilityFrustum:this._layerViewCore.frustumVisibility.canResume(),
visibilityScale:this._layerViewCore.scaleVisibility.canResume(),resumeExtent:b,computedExtent:c,updating:this.updating,suspended:this.suspended}};p.maximumFeatureCount=-1;a([b.property()],p.prototype,"drawingOrder",null);a([b.property()],p.prototype,"loadedGraphics",void 0);a([b.property()],p.prototype,"symbolsUpdating",void 0);a([b.property()],p.prototype,"hasDraped",null);a([b.property()],p.prototype,"controller",void 0);return p=a([b.subclass("esri.views.3d.layers.GraphicsLayerView3DBase")],p)}(b.declared(B,
f))})},"esri/views/3d/layers/graphics/Graphics3DLayerViewCore":function(){define("require exports ../../../../core/HandleRegistry ../../../../core/watchUtils ../../../../core/promiseUtils ../../../../core/Collection ../../../../tasks/support/Query ../../../../Graphic ./Graphics3DCore ./Graphics3DLabeling ./Graphics3DScaleVisibility ./Graphics3DFrustumVisibility ./Graphics3DElevationAlignment ./Graphics3DSpatialIndex ./Graphics3DVerticalScale ./Graphics3DHighlights ../support/attributeUtils".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F){return function(){function r(b){var c=this;this._handles=new k;this.layer=b.layer;this.owner=b.owner;this.updateClippingExtent=b.updateClippingExtent;this.updateSuspendResumeExtent=b.updateSuspendResumeExtent;this.getGraphicsInExtent=b.getGraphicsInExtent;this.graphicsCore=new f(b.elevationFeatureExpressionEnabled);b.spatialIndexRequired&&(this.spatialIndex=new v);if(b.frustumVisibilityEnabled){this.frustumVisibility=new y;var n=this.owner.view.basemapTerrain;
this._handles.add([this.owner.view.on("resize",function(){return c.frustumVisibility.viewChange()}),this.owner.view.state.watch("camera",function(){return c.frustumVisibility.viewChange()},!0),n.on("elevation-bounds-change",function(){return c.frustumVisibility.elevationBoundsChange()})]);"local"===this.owner.view.viewingMode?this.frustumVisibility.isVisibleBelowSurface=!0:this._handles.add(a.init(n,["opacity","wireframe"],function(){return c.frustumVisibility.isVisibleBelowSurface=n.isSeeThrough()}))}b.scaleVisibilityEnabled&&
(b.spatialIndexRequired?(this.scaleVisibility=new l,this._handles.add(this.layer.watch("minScale,maxScale",function(){return c.scaleVisibility.layerMinMaxScaleChangeHandler()}))):console.warn("scaleVisibility requires a spatialIndex"));b.elevationAlignmentEnabled&&(this.elevationAlignment=new B,this._handles.add(this.layer.watch("elevationInfo",function(){return c.graphicsCore.elevationInfoChange()})));b.labelingEnabled&&(this.labeling=new q,this._handles.add(this.layer.watch("labelsVisible",function(){return c.labeling.labelVisibilityChanged()})),
this._handles.add(this.layer.watch("labelingInfo",function(){return c.labeling.updateLabelingInfo()})));b.verticalScaleEnabled&&(this.verticalScale=new w({sourceSpatialReference:this.layer.spatialReference,destSpatialReference:this.owner.view.spatialReference}));b.highlightsEnabled&&(this.highlights=new D)}r.prototype.initialize=function(){var a=this;return this.whenSpatialIndexLoaded().then(function(){return a.deferredInitialize()})};r.prototype.whenSpatialIndexLoaded=function(){return this.spatialIndex?
this.spatialIndex.whenLoaded():b.resolve()};r.prototype.deferredInitialize=function(){var a=this;this.spatialIndex&&this.spatialIndex.initialize(this.owner,this.layer,this.owner.view.spatialReference,this.graphicsCore);this.frustumVisibility&&this.frustumVisibility.initialize(this.owner);var b=this.owner.view.basemapTerrain,c=this.owner.view.elevationProvider;this.scaleVisibility&&this.scaleVisibility.initialize(this.owner,this.layer,this.spatialIndex,this.graphicsCore,b);this.elevationAlignment&&
this.elevationAlignment.initialize(this.owner,function(b,c,f){return a._getGraphicsInExtent(b,c,f)},this.graphicsCore,c);this.labeling&&this.labeling.initialize(this.owner,this.layer,this.spatialIndex,this.graphicsCore,this.scaleVisibility);this.highlights&&this.highlights.initialize(this.graphicsCore);this.graphicsCore.initialize(this.owner,this.layer,this.elevationAlignment,this.scaleVisibility,this.spatialIndex,this.labeling,this.highlights,function(){a.updateSuspendResumeExtent&&a._updateSuspendResumeExtent(a.updateSuspendResumeExtent())},
function(b){return a.verticalScale?a.verticalScale.adjust(b):b},b);this._handles.add([this.layer.watch("renderer",function(b){return a.graphicsCore.rendererChange(b)}),this.owner.watch("fullOpacity",function(){return a.graphicsCore.opacityChange()})]);this._handles.add(this.layer.on("graphic-update",function(b){return a.graphicsCore.graphicUpdateHandler(b)}));this.owner.view.resourceController.registerIdleFrameWorker(this,{needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate});this.updateClippingExtent&&
(this._handles.add(this.owner.view.watch("clippingArea",function(){return a._updateClippingExtent()})),this._updateClippingExtent());if(this.labeling)return this.labeling.updateLabelingInfo()};r.prototype.destroy=function(){this.owner&&this.owner.view.resourceController.deregisterIdleFrameWorker(this);this._handles&&(this._handles.destroy(),this._handles=null);this.frustumVisibility&&(this.frustumVisibility.destroy(),this.frustumVisibility=null);this.scaleVisibility&&(this.scaleVisibility.destroy(),
this.scaleVisibility=null);this.elevationAlignment&&(this.elevationAlignment.destroy(),this.elevationAlignment=null);this.labeling&&(this.labeling.destroy(),this.labeling=null);this.graphicsCore&&(this.graphicsCore.destroy(),this.graphicsCore=null);this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.highlights&&(this.highlights.destroy(),this.highlights=null);this.owner=this.layer=null};r.prototype.highlight=function(a,b,f){var k=this;if(a instanceof t){b=this.highlights.acquireSet(b,
f);var l=b.set,p=b.handle;this.owner.queryObjectIds(a).then(function(a){return k.highlights.setObjectIds(l,a)});return p}if("number"===typeof a||a instanceof n)return this.highlight([a],b,f);a instanceof c&&(a=a.toArray());if(Array.isArray(a)&&0<a.length){if(a[0]instanceof n)if(p=a,f&&p[0].attributes&&null!==F.attributeLookup(p[0].attributes,f))a=p.map(function(a){return F.attributeLookup(a.attributes,f)});else return a=p.map(function(a){return a.uid}),p=this.highlights.acquireSet(b,null),b=p.set,
p=p.handle,this.highlights.setUids(b,a),p;if("number"===typeof a[0])return p=this.highlights.acquireSet(b,f),b=p.set,p=p.handle,this.highlights.setObjectIds(b,a),p}return{remove:function(){}}};r.prototype.canResume=function(){return(!this.frustumVisibility||this.frustumVisibility.canResume())&&(!this.scaleVisibility||this.scaleVisibility.canResume())};r.prototype._needsIdleUpdate=function(){return this.frustumVisibility&&this.frustumVisibility.needsIdleUpdate()||this.scaleVisibility&&this.scaleVisibility.needsIdleUpdate()||
this.elevationAlignment&&this.elevationAlignment.needsIdleUpdate()||this.graphicsCore&&this.graphicsCore.needsIdleUpdate()?!0:!1};r.prototype._idleUpdate=function(a){this.frustumVisibility&&this.frustumVisibility.idleUpdate(a);this.scaleVisibility&&this.scaleVisibility.idleUpdate(a);this.elevationAlignment&&this.elevationAlignment.idleUpdate(a);this.graphicsCore&&this.graphicsCore.idleUpdate(a)};r.prototype._updateSuspendResumeExtent=function(a){this.frustumVisibility&&this.frustumVisibility.setExtent(a);
this.scaleVisibility&&this.scaleVisibility.setExtent(a)};r.prototype._updateClippingExtent=function(){var a=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(a,this.owner.view.spatialReference)&&(this.updateClippingExtent(a)||this.graphicsCore.recreateAllGraphics())};r.prototype._getGraphicsInExtent=function(a,b,c){this.getGraphicsInExtent?this.getGraphicsInExtent(a,b,c):this.spatialIndex?this.spatialIndex.intersects(a,b,c):c([],0)};return r}()})},"esri/views/3d/layers/graphics/Graphics3DLabeling":function(){define("require exports dojo/promise/all ../../../../core/HandleRegistry ../../../../core/watchUtils ../../../../layers/support/LabelClass ../../../../symbols/callouts/calloutUtils ../../webgl-engine/lib/TextTextureAtlas ../../webgl-engine/lib/MaterialCollection ./Graphics3DWebStyleSymbol ./Graphics3DCalloutSymbolLayerFactory ./labelPlacement ../../support/debugFlags".split(" "),
function(x,r,k,a,b,c,t,n,f,q,l,y,B){return function(){function r(){this.calloutMaterialCollection=this.hudMaterialCollection=this.textTextureAtlas=null;this.labelVisibilityDirty=!1;this.labelClasses=[];this.eventHandles=new a;this.graphicsCore=this.spatialIndex=this.layer=this.layerView=null}r.prototype.initialize=function(a,c,f,k,l){var n=this;this.layerView=a;this.layer=c;this.spatialIndex=f;this.graphicsCore=k;this.scaleVisibility=l;this.eventHandles.add(b.whenNot(this.layerView,"suspended",function(){return n.resume()}))};
r.prototype.destroy=function(){this.textTextureAtlas&&(this.textTextureAtlas.dispose(),this.textTextureAtlas=null);this.hudMaterialCollection&&(this.hudMaterialCollection.dispose(),this.hudMaterialCollection=null);this.calloutMaterialCollection&&(this.calloutMaterialCollection.dispose(),this.calloutMaterialCollection=null);this.labelClasses=null;this.eventHandles.destroy();this.graphicsCore=this.layer=this.layerView=this.eventHandles=null};r.prototype.clear=function(){this.layerView.view.deconflictor.setDirty();
this.textTextureAtlas&&(this.textTextureAtlas.dispose(),this.textTextureAtlas=null);this.hudMaterialCollection&&(this.hudMaterialCollection.dispose(),this.hudMaterialCollection=null);this.calloutMaterialCollection&&(this.calloutMaterialCollection.dispose(),this.calloutMaterialCollection=null)};r.prototype.updateLabelingInfo=function(){var a=this;this.removeLabels();return this.layer.when(function(){a.scaleVisibility&&a.scaleVisibility.updateScaleRangeActive();var b=a.layer.labelingInfo&&a.layer.labelingInfo.filter(function(a){return!!a.symbol});
if(b&&0<b.length){var c=Array(b.length),b=b.map(function(b,f){var k=b.symbol,n;n=a.graphicsCore.getOrCreateGraphics3DSymbol(k);n=n instanceof q?n.graphics3DSymbol:n;var p=null;t.isCalloutSupport(k)&&k.hasVisibleCallout()&&(p=l.make(k,a.graphicsCore.symbolCreationContext));c[f]={labelClass:b,graphics3DSymbol:n,graphics3DCalloutSymbolLayer:p,options:b.getOptions()};return n});return k(b).then(function(){return c})}return null}).then(function(b){a.labelClasses=b;a.labelVisibilityChanged()})};r.prototype.createLabelsForGraphic=
function(a,b){var k=!1;if(this.labelClasses&&0!==this.labelClasses.length&&b._graphics[0]){for(var l=this.layerLabelsEnabled(),p=0;p<this.labelClasses.length;p++){var q=this.labelClasses[p],r=q.labelClass;if(c.evaluateWhere(r.where,a.attributes)&&(r=r.getLabelExpression(),r.expression)){var t=c.buildLabelText(r.expression,a,this.layer.fields,q.options);if(t){r=null;q.graphics3DSymbol&&q.graphics3DSymbol.symbol&&"label-3d"===q.graphics3DSymbol.symbol.type&&(r=q.graphics3DSymbol.symbol);var v=q.graphics3DSymbol.childGraphics3DSymbols[0],
w=y.get({graphic:a,graphics3DGraphic:b,labelSymbol:r,labelClass:q.labelClass});if(v&&w.isValid){null==this.textTextureAtlas&&(this.textTextureAtlas=new n(this.layer.id,this.layerView.view._stage));null==this.hudMaterialCollection&&(this.hudMaterialCollection=new f(this.layerView.view._stage));p={text:t,centerOffset:w.centerOffset,translation:w.translation,elevationOffset:w.elevationOffset,screenOffset:w.screenOffset,anchor:w.anchor,needsOffsetAdjustment:w.needsOffsetAdjustment,centerOffsetUnits:w.centerOffsetUnits,
verticalOffset:w.verticalOffset,debugDrawBorder:B.LABELS_SHOW_BORDER};if(v=v.createGraphics3DGraphic(a,p,this.hudMaterialCollection,this.textTextureAtlas))v._labelClass=q.labelClass,b.addLabelGraphic(v,this.graphicsCore.labelStageLayer,this.graphicsCore.stage),this.spatialIndex&&!b.addedToSpatialIndex&&this.spatialIndex.shouldAddToSpatialIndex(a,b,this.scaleVisibility.scaleRangeActive())&&this.spatialIndex.addGraphicToSpatialIndex(a,b),b.setVisibilityFlag(0,l,1),b.setVisibilityFlag(1,void 0,1),this.layerView.view.deconflictor.initializeLabelVisibility(b),
k=!0,q.graphics3DCalloutSymbolLayer&&w.hasLabelVerticalOffset&&(null==this.calloutMaterialCollection&&(this.calloutMaterialCollection=new f(this.layerView.view._stage)),(l=q.graphics3DCalloutSymbolLayer.createGraphics3DGraphic(a,{symbol:r,needsOffsetAdjustment:w.needsOffsetAdjustment,translation:p.translation,elevationOffset:p.elevationOffset,screenOffset:p.screenOffset,centerOffset:p.centerOffset,centerOffsetUnits:p.centerOffsetUnits,materialCollection:this.calloutMaterialCollection}))&&b.addLabelGraphic(l,
this.graphicsCore.labelStageLayer,this.graphicsCore.stage));break}}}}k&&this.scaleVisibility&&this.scaleVisibility.updateGraphicLabelScaleVisibility(a,b)}};r.prototype.layerLabelsEnabled=function(){return this.layer.labelsVisible};r.prototype.getGraphics3DGraphics=function(){return this.graphicsCore.getGraphics3DGraphics()};r.prototype.getGraphics3DGraphicsKeys=function(){return this.graphicsCore.getGraphics3DGraphicsKeys()};r.prototype.labelVisibilityChanged=function(){var a=this;if(this.layerView.suspended)this.labelVisibilityDirty=
!0;else if(this.layerView.loadedGraphics){var b=this.layerLabelsEnabled();this.layerView.loadedGraphics.forEach(function(c){var f=a.graphicsCore.getGraphics3DGraphicById(c.uid);f&&(b&&0===f._labelGraphics.length&&a.createLabelsForGraphic(c,f),f.setVisibilityFlag(0,b,1))});this.layerView.view.deconflictor.setDirty();this.labelVisibilityDirty=!1}};r.prototype.elevationInfoChange=function(){this.labelClasses&&this.labelClasses.forEach(function(a){a.graphics3DSymbol.layerPropertyChanged("elevationInfo",
{})})};r.prototype.resume=function(){this.labelVisibilityDirty&&this.labelVisibilityChanged()};r.prototype.removeLabels=function(){var a=this;this.layerView.loadedGraphics&&(this.layerView.loadedGraphics.forEach(function(b){if(b=a.graphicsCore.getGraphics3DGraphicById(b.uid))b._labelGraphics&&b._labelGraphics.forEach(function(a){return a._labelClass=null}),b.clearLabelGraphics()}),this.labelClasses=null,this.layerView.view.deconflictor.setDirty())};return r}()})},"esri/views/3d/webgl-engine/lib/TextTextureAtlas":function(){define("require exports ./Texture ./TextTexture ./ModelContentType ../../../webgl/Texture ../../../webgl/enums".split(" "),
function(x,r,k,a,b,c,t){var n=a.preferredAtlasSize(),f=function(){function a(a){this.textTextures={};this.dirty=!1;this._glTexture=null;this.id=k.idGen.gen(a)}a.prototype.getId=function(){return this.id};a.prototype.dispose=function(){};a.prototype.deferredLoading=function(){return!1};a.prototype.getWidth=function(){return n};a.prototype.getHeight=function(){return n};a.prototype.initializeThroughRender=function(a,b){b.wrapMode=33071;b.samplingMode=9987;b.flipped=!0;b.preMultiplyAlpha=!0;b.hasMipmap=
!0;var f=this._drawToCanvas();this._glTexture=new c(a,b,f);this.dirty=!1;return this._glTexture};a.prototype.redraw=function(){if(this.dirty&&this._glTexture){var a=this._drawToCanvas();this._glTexture.setData(a);this.dirty=!1}};a.prototype.setUnloadFunc=function(a){this._unloadFunc=a};a.prototype.unload=function(){null!=this._unloadFunc&&(this._unloadFunc(this.id),this._unloadFunc=null)};a.prototype._drawToCanvas=function(){var b=a._create2Dcanvas(),c=b.getContext("2d");c.clearRect(0,0,n,n);for(var f in this.textTextures){var k=
this.textTextures[f];k.textTexture.renderText(k.placement.width,k.placement.height,c,k.placement.atlasOffX,k.placement.atlasOffY)}return b};a._create2Dcanvas=function(){a._textCanvas2D||(a._textCanvas2D=document.createElement("canvas"),a._textCanvas2D.setAttribute("id","canvas2d"),a._textCanvas2D.setAttribute("width",n.toString()),a._textCanvas2D.setAttribute("height",n.toString()),a._textCanvas2D.setAttribute("style","display:none"));return a._textCanvas2D};return a}();return function(){function a(a,
b){this._textureAtlasSubtextures=[];this._curLineHeight=this._curY=this._curX=0;this._idHint=a;this._stage=b}a.prototype.dispose=function(){for(var a=0;a<this._textureAtlasSubtextures.length;a++)this._stage.remove(b.TEXTURE,this._textureAtlasSubtextures[a].getId());this._textureAtlasSubtextures=[]};a.prototype.canHoldTextTexture=function(a){return a.getRenderedWidth()<=n&&a.getRenderedHeight()<=n};a.prototype.addTextTexture=function(a){for(var c=JSON.stringify(a.getParams())+"_"+a.getText(),k=0;k<
this._textureAtlasSubtextures.length;k++){var l=this._textureAtlasSubtextures[k].textTextures[c];if(null!=l)return l.placement}var q=null;0===this._textureAtlasSubtextures.length&&(q=new f(this._idHint),this._textureAtlasSubtextures.push(q));var k=a.getRenderedWidth(),l=a.getRenderedHeight(),r=k+2,t=l+2+2,x;this._curLineHeight=Math.max(this._curLineHeight,t);this._curX+r<n&&this._curY+this._curLineHeight<n||(this._curY+this._curLineHeight+t<n?(this._curX=0,this._curY+=this._curLineHeight):(q=new f(this._idHint),
this._textureAtlasSubtextures.push(q),this._curY=this._curX=0,this._curLineHeight=t));t=this._curX;x=this._curY;this._curX+=r;null!=q&&this._stage.add(b.TEXTURE,q);q=this._textureAtlasSubtextures[this._textureAtlasSubtextures.length-1];k={uvMinMax:[t/n,1-(x+l)/n,(t+k)/n,1-x/n],atlasOffX:t,atlasOffY:x,width:k,height:l,texture:q};q.textTextures[c]={placement:k,textTexture:a};q.dirty=!0;return k};return a}()})},"esri/views/3d/webgl-engine/lib/MaterialCollection":function(){define(["require","exports",
"./ModelContentType"],function(x,r,k){return function(){function a(a){this.materials={};this.stage=a}a.prototype.getMaterial=function(a){return this.materials[a]};a.prototype.addMaterial=function(a,c){this.materials[a]=c;this.stage.add(k.MATERIAL,c)};a.prototype.dispose=function(){for(var a in this.materials)this.stage.remove(k.MATERIAL,this.materials[a].getId());this.materials={}};return a}()})},"esri/views/3d/layers/graphics/labelPlacement":function(){define("require exports ../../../../core/Logger ../../../../core/Scheduler ../../lib/glMatrix ../../webgl-engine/materials/HUDMaterial ./Graphics3DWebStyleSymbol".split(" "),
function(x,r,k,a,b,c,t){function n(a,k){switch(k.graphic.geometry.type){case "polyline":case "polygon":case "extent":a.anchor="center";break;case "point":var l=k.graphics3DGraphic,n=f(l.graphics3DSymbol).symbol.symbolLayers.getItemAt(0),l=l.getCenterObjectSpace();b.vec3d.set(l,a.translation);switch(n.type){case "icon":case "text":l=k.graphics3DGraphic;n=l._graphics[0].getScreenSize();l.isDraped()?a.hasLabelVerticalOffset||(a.anchor="center"):(l=void 0,void 0===l&&(l=G),k=k.graphics3DGraphic._graphics[0].stageObject.getGeometryRecords()[0].materials[0],
k instanceof c?(k=k.getParams().anchorPos,l[0]=2*(k[0]-.5),l[1]=2*(k[1]-.5)):(l[0]=0,l[1]=0),k=l,F[0]=n[0]/2*(a.normalizedOffset[0]-k[0]),F[1]=n[1]/2*(a.normalizedOffset[1]-k[1]),a.screenOffset[0]=F[0],a.hasLabelVerticalOffset?(a.centerOffset[1]=F[1],a.centerOffsetUnits="screen"):a.screenOffset[1]=F[1]);break;case "object":k=k.graphics3DGraphic._graphics[0].getBoundingBoxObjectSpace(),k=[k[3]-k[0],k[4]-k[1],k[5]-k[2]],a.centerOffset[0]=1.1*Math.max(k[0],k[1])/2*a.normalizedOffset[0],n=k[2]/2*a.normalizedOffset[1]+
a.translation[2],a.translation[2]=n*(1.1-1),a.elevationOffset=n,k=b.vec3d.length(k),a.centerOffset[2]=1.1*k/2*a.normalizedOffset[2]}}}function f(a){return a instanceof t?a.graphics3DSymbol:a}function q(a,b){var c=b.labelSymbol;b=b.graphics3DGraphic;var k=f(b.graphics3DSymbol).symbol;if("point-3d"===k.type&&k.supportsCallout()&&k.hasVisibleVerticalOffset()&&!b.isDraped())a.verticalOffset=l(k.verticalOffset);else if(c&&c.hasVisibleVerticalOffset()&&("point-3d"!==k.type||!k.supportsCallout()||!k.verticalOffset||
b.isDraped())){a:switch(a.placement){case "above-center":b=!0;break a;default:b=!1}b?(a.verticalOffset=l(c.verticalOffset),a.anchor="bottom",a.normalizedOffset=[0,a.normalizedOffset[1],0],a.hasLabelVerticalOffset=!0):(y.error("verticalOffset","Callouts and vertical offset on labels are currently only supported with above-center label placement (not with "+a.placement+" placement)"),a.isValid=!1)}}function l(a){return{screenLength:a.screenLength,minWorldLength:a.minWorldLength,maxWorldLength:a.maxWorldLength}}
Object.defineProperty(r,"__esModule",{value:!0});var y=k.getLogger("esri.views.3d.layers.graphics.labelPlacement"),B=null;r.get=function(b){var c=b.labelClass.labelPlacement,f=v[c];f||(null!=c&&null==B&&(y.warn("labelPlacement","'"+c+"' is not a valid label placement"),B=a.schedule(function(){B.remove();B=null})),f=v["default"]);var c=b.graphics3DGraphic._graphics[0],k=c.graphics3DSymbolLayer.getGraphicElevationContext(b.graphics3DGraphic.graphic),f={placement:f.placement,anchor:f.anchor,normalizedOffset:f.normalizedOffset,
needsOffsetAdjustment:c.isDraped()?void 0:k.hasOffsetAdjustment,verticalOffset:null,screenOffset:[0,0],centerOffset:[0,0,0,-1],centerOffsetUnits:"world",translation:[0,0,0],elevationOffset:0,hasLabelVerticalOffset:!1,isValid:!0};q(f,b);n(f,b);return f};var v={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},
"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},w={"above-center":["default",
"esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};
x=function(a){var b=v[a];w[a].forEach(function(a){v[a]=b})};for(var D in w)x(D);Object.freeze&&(Object.freeze(v),Object.keys(v).forEach(function(a){Object.freeze(v[a]);Object.freeze(v[a].normalizedOffset)}));var F=[0,0],G=[0,0]})},"esri/views/3d/layers/graphics/Graphics3DScaleVisibility":function(){define(["require","exports"],function(x,r){function k(a,b){return null!==a&&0<a&&8E7>a||50<b}return function(){function a(){this._scaleRangeActive=!1;this.layerScaleRangeVisibilityDirty=this.layerScaleRangeVisibility=
!0;this.layerScaleRangeVisibilityQuery=!1;this.basemapTerrain=this.graphicsCore=this.extent=this.spatialIndex=this.layer=this.layerView=this.scaleChangeEventHandle=null}a.prototype.initialize=function(a,c,k,n,f){this.layerView=a;this.layer=c;this.spatialIndex=k;this.graphicsCore=n;this.basemapTerrain=f;this.updateScaleRangeActive()};a.prototype.destroy=function(){this.scaleChangeEventHandle&&(this.scaleChangeEventHandle.remove(),this.scaleChangeEventHandle=null);this.graphicsCore=this.spatialIndex=
this.extent=this.layerView=null};a.prototype.needsIdleUpdate=function(){return this.layerView.view.basemapTerrain&&this.layerScaleRangeVisibilityDirty};a.prototype.canResume=function(){return this.layerScaleRangeVisibility};a.prototype.setExtent=function(a){this.extent=a;this.layerScaleRangeVisibilityDirty=!0};a.prototype.idleUpdate=function(a){this.layerView.view.basemapTerrain&&!a.done()&&this.layerScaleRangeVisibilityDirty&&(this.updateSuspendScaleVisible(),this.layerScaleRangeVisibilityDirty=
!1)};a.prototype.scaleRangeActive=function(){return this._scaleRangeActive};a.prototype.updateScaleRangeActive=function(){var a=this;if(!this.spatialIndex)return this._scaleRangeActive=!1;var c=this.layer,r=!1;c.labelingInfo&&(r=r||c.labelingInfo.some(function(a){return a&&k(a.minScale,a.maxScale)}));r=r||k(c.minScale,c.maxScale);c=this._scaleRangeActive!==r;(this._scaleRangeActive=r)&&!this.scaleChangeEventHandle&&this.basemapTerrain?this.scaleChangeEventHandle=this.basemapTerrain.on("scale-change",
function(b){return a.scaleUpdateHandler(b)}):!r&&this.scaleChangeEventHandle&&(this.scaleChangeEventHandle.remove(),this.scaleChangeEventHandle=null);return c};a.prototype.updateSuspendScaleVisibleFinish=function(a){this.layerScaleRangeVisibilityQuery=!1;this.layerScaleRangeVisibility!==a&&(this.layerScaleRangeVisibility=a,this.layerView._notifySuspendedChange())};a.prototype.updateSuspendScaleVisible=function(){var a=this,c=this.layerView.view.basemapTerrain;this.extent&&c&&this._scaleRangeActive?
this.layerScaleRangeVisibilityQuery||(this.layerScaleRangeVisibilityQuery=!0,c.queryVisibleScaleRange(this.extent,this.layer.minScale,this.layer.maxScale,function(b){return a.updateSuspendScaleVisibleFinish(b)})):this.updateSuspendScaleVisibleFinish(!0)};a.prototype.visibleAtScale=function(a,c,k){return null==a?!0:a>k&&(!c||a<c)};a.prototype.visibleAtLayerScale=function(a){return this.visibleAtScale(a,this.layer.minScale,this.layer.maxScale)};a.prototype.visibleAtLabelScale=function(a,c){return this.visibleAtScale(a,
c.minScale,c.maxScale)};a.prototype.graphicScale=function(a,c){var b;c.centroid?b=c.centroid:"point"===a.geometry.type&&(b=a.geometry);return b?this.layerView.view.basemapTerrain?this.layerView.view.basemapTerrain.getScale(b):1:null};a.prototype.graphicVisible=function(a,c){a=this.graphicScale(a,c);return this.visibleAtLayerScale(a)};a.prototype.updateGraphicScaleVisibility=function(a,c){return this._scaleRangeActive?(c.addedToSpatialIndex||this.spatialIndex.addGraphicToSpatialIndex(a,c),a=this.graphicVisible(a,
c),c.setVisibilityFlag(1,a)):!1};a.prototype.updateGraphicLabelScaleVisibility=function(a,c){if(!this._scaleRangeActive||!c._labelGraphics||0===c._labelGraphics.length)return!1;c.addedToSpatialIndex||this.spatialIndex.addGraphicToSpatialIndex(a,c);a=this.graphicScale(a,c);(c=this.updateLabelScaleVisibility(c,a))&&this.layerView.view.deconflictor.setDirty();return c};a.prototype.updateLabelScaleVisibility=function(a,c){if(!a._labelGraphics||0===a._labelGraphics.length)return!1;1<a._labelGraphics.length&&
console.warn("Multiple label classes are not supported");var b=a._labelGraphics[0]._labelClass;return b&&null!=b.minScale&&null!=b.maxScale&&(c=this.visibleAtLabelScale(c,b),a.setVisibilityFlag(1,c,1))?!0:!1};a.prototype.scaleUpdateHandler=function(a){var b=this;if(!this.layerView.suspended&&this.spatialIndex.hasGraphics()){var k=a.extent,n=a.scale;this.spatialIndex.intersects(k,a.spatialReference,function(a,c){for(var f=b.visibleAtLayerScale(n),q=!1,r=!1,t=0;t<c;t++){var w=b.graphicsCore.getGraphics3DGraphicById(a[t]);
if(w){var x=w.centroid;x&&(k[0]>x.x||k[1]>x.y||k[2]<x.x||k[3]<x.y)||(x=!1,w.setVisibilityFlag(1,f)&&(x=!0),b.updateLabelScaleVisibility(w,n)&&(x=!0),x&&(r=!0,w.isDraped()&&(q=!0)))}}r&&b.layerView.view.deconflictor.setDirty();q&&b.layerView._notifyDrapedDataChange()})}this.layerScaleRangeVisibilityDirty=!0};a.prototype.layerMinMaxScaleChangeHandler=function(){this.updateScaleRangeActive()&&(this._scaleRangeActive?this.graphicsCore.updateAllGraphicsVisibility():this.graphicsCore.forEachGraphics3DGraphic(function(a){return a.setVisibilityFlag(1,
void 0)}));this.layerScaleRangeVisibilityDirty=!0};return a}()})},"esri/views/3d/layers/graphics/Graphics3DFrustumVisibility":function(){define("require exports ../../support/earthUtils ../../support/projectionUtils ../../support/intersectionUtils ../../support/mathUtils ../../support/aaBoundingBox ../../support/aaBoundingRect ../../lib/glMatrix".split(" "),function(x,r,k,a,b,c,t,n,f){var q=-.3*k.earthRadius;x=.5*Math.PI;var l=x/Math.PI*180,y=x*k.earthRadius,B=.9*k.earthRadius,v=function(){function k(){this.extent=
Array(4);this.planes=Array(4);this.maxSpan=0;this.center={origin:f.vec3d.create(),direction:f.vec3d.create()};for(var a=0;4>a;a++)this.extent[a]={origin:f.vec3d.create(),originLength:0,direction:f.vec3d.create(),cap:{next:null,direction:f.vec3d.create()}},this.planes[a]=f.vec4d.create();this.planes[4]=f.vec4d.create()}k.prototype.toRenderBoundingExtent=function(b,k,l,q){n.center(b,D);D[2]=q;a.computeLinearTransformation(l,D,F,k);f.mat4d.inverse(F,G);t.set(p,t.NEGATIVE_INFINITY);for(var r=0,v=w;r<
v.length;r++)for(var z=v[r],x=z.x0,y=z.x1,A=z.y0,z=z.y1,B=0;5>B;B++){var I=B/4;D[0]=c.lerp(b[x],b[y],I);D[1]=c.lerp(b[A],b[z],I);D[2]=q;a.vectorToVector(D,l,D,k);f.mat4d.multiplyVec3(G,D);t.expand(p,D)}f.mat4d.multiplyVec3(F,f.vec3d.set3(p[0],p[1],p[2],this.extent[0].origin));f.mat4d.multiplyVec3(F,f.vec3d.set3(p[3],p[1],p[2],this.extent[1].origin));f.mat4d.multiplyVec3(F,f.vec3d.set3(p[3],p[4],p[2],this.extent[2].origin));f.mat4d.multiplyVec3(F,f.vec3d.set3(p[0],p[4],p[2],this.extent[3].origin))};
k.prototype.update=function(a,b,c,k,l,n){l=this.extent;this.toRenderBoundingExtent(a,c,k,n);f.vec3d.add(l[0].origin,l[2].origin,this.center.origin);f.vec3d.scale(this.center.origin,.5);b(this.center.origin,this.center.direction);for(c=0;4>c;c++)k=l[c],b(k.origin,k.direction),k.originLength=f.vec3d.length(k.origin),n=l[3===c?0:c+1],k.cap.next=n.origin,f.vec3d.direction(n.origin,k.origin,k.cap.direction),this._computePlane(k.cap.direction,k.direction,k.origin,this.planes[c]);this._computePlane(l[1].cap.direction,
l[0].cap.direction,l[0].origin,this.planes[4]);this.maxSpan=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]))};k.prototype.isVisibleInFrustumGlobal=function(a){if(0>f.vec3d.dot(this.center.direction,a.direction))return!0;for(var b=0;4>b;b++)if(0>f.vec3d.dot(this.extent[b].direction,a.direction))return!0;return!1};k.prototype.isVisibleInFrustum=function(a,c,f){if("global"===a.viewingMode){if(this.maxSpan>(a.spatialReference.isWGS84?l:y))return!0;if(c.altitude>=B)return this.isVisibleInFrustumGlobal(c)}for(a=
0;a<this.extent.length;a++)if(f=this.extent[a],b.frustumRay(c.planes,f.origin,null,f.direction)||b.frustumLineSegment(c.planes,f.origin,f.cap.next,f.cap.direction))return!0;for(a=0;a<c.lines.length;a++)if(f=c.lines[a],b.frustumLineSegment(this.planes,f.origin,f.endpoint,f.direction))return!0;return!1};k.prototype._computePlane=function(a,b,c,k){f.vec3d.cross(a,b,k);k[3]=-f.vec3d.dot(k,c)};return k}();k=function(){function a(){this.frustumVisibilityDirty=this.frustumVisibility=!0;this.extent=null;
this.extentEngine=new v;this.extentEngineDirty=!0;this.renderSREqualsViewSR=null;this._isVisibleBelowSurface=!1;this.layerView=null}a.prototype.initialize=function(a){this.layerView=a;this.renderSREqualsViewSR=a.view.renderSpatialReference.equals(a.view.spatialReference)};a.prototype.destroy=function(){this.extentEngine=this.extent=this.layerView=null};a.prototype.needsIdleUpdate=function(){return this.frustumVisibilityDirty};a.prototype.canResume=function(){return this.frustumVisibility};a.prototype.setExtent=
function(a){this.extent=a;this.frustumVisibilityDirty=this.extentEngineDirty=!0};a.prototype.viewChange=function(){this.frustumVisibilityDirty=!0};a.prototype.elevationBoundsChange=function(){this.extentEngineDirty=this.frustumVisibilityDirty=!0};Object.defineProperty(a.prototype,"isVisibleBelowSurface",{set:function(a){this._isVisibleBelowSurface=a;this.extentEngineDirty=this.frustumVisibilityDirty=!0},enumerable:!0,configurable:!0});a.prototype.idleUpdate=function(a){!a.done()&&this.frustumVisibilityDirty&&
(this.updateSuspendFrustumVisible(),this.frustumVisibilityDirty=!1)};a.prototype.updateExtentEngine=function(){if(this.extentEngineDirty){this.extentEngineDirty=!1;var a=this.layerView.view,b=a.renderCoordsHelper.worldUpAtPosition.bind(a.renderCoordsHelper),c;if(this._isVisibleBelowSurface)c=q;else{c=a.basemapTerrain.getElevationBounds();var f=c[0];c=f-Math.max(1,(c[1]-f)*(1.2-1))}this.extentEngine.update(this.extent,b,a.renderSpatialReference,a.spatialReference,this.renderSREqualsViewSR,c)}};a.prototype.updateSuspendFrustumVisible=
function(){if(this.extent){this.updateExtentEngine();var a=this.extentEngine.isVisibleInFrustum(this.layerView.view,this.layerView.view.frustum,this._isVisibleBelowSurface);a!==this.frustumVisibility&&(this.frustumVisibility=a,this.layerView._notifySuspendedChange())}else this.frustumVisibility=!0};return a}();var w=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],D=f.vec3d.create(),F=f.mat4d.create(),G=f.mat4d.create(),p=t.create();return k})},"esri/views/3d/layers/graphics/Graphics3DVerticalScale":function(){define(["require",
"exports","../../../../geometry/support/scaleUtils"],function(x,r,k){return function(){function a(a){this.sourceSpatialReference=a.sourceSpatialReference;this.destSpatialReference=a.destSpatialReference}a.prototype.adjust=function(a){var b=this._getVerticalUnitScale();1!==b&&(a=a.slice(),this._scaleVerticalUnits(a,b));return a};a.prototype._getVerticalUnitScale=function(){if(this.sourceSpatialReference&&!this.sourceSpatialReference.equals(this.destSpatialReference)){var a=k.getMetersPerVerticalUnitForSR(this.sourceSpatialReference),
c=k.getMetersPerVerticalUnitForSR(this.destSpatialReference);return a/c}return 1};a.prototype._vertexListsScaleZ=function(a,c){for(var b=0;b<a.length;++b)for(var k=a[b],f=0;f<k.length;++f)k[f][2]*=c};a.prototype._scaleVerticalUnits=function(a,c){for(var b=0;b<a.length;++b){var k=a[b].geometry;if(k.hasZ)this._geometryIsPoint(k)?null!==k.z&&(k.z*=c):this._geometryIsPolyline(k)?this._vertexListsScaleZ(k.paths,c):this._geometryIsPolygon(k)&&this._vertexListsScaleZ(k.rings,c);else break}};a.prototype._geometryIsPoint=
function(a){return"point"===a.type};a.prototype._geometryIsPolygon=function(a){return"polygon"===a.type};a.prototype._geometryIsPolyline=function(a){return"polyline"===a.type};return a}()})},"esri/views/3d/layers/graphics/Graphics3DHighlights":function(){define(["require","exports","./Graphics3DHighlightSet"],function(x,r,k){return function(){function a(){this.graphicsCore=null;this.highlights=[]}a.prototype.destroy=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()});
this.highlights=null};a.prototype.initialize=function(a){this.graphicsCore=a};a.prototype.acquireSet=function(a,c){var b=this,n=new k(a,c);this.highlights.push(n);return{set:n,handle:{remove:function(){return b.releaseSet(n)}}}};a.prototype.releaseSet=function(a){a.highlightSet.removeAll();a=this.highlights?this.highlights.indexOf(a):-1;-1!==a&&this.highlights.splice(a,1)};a.prototype.setUids=function(a,c){var b=this.graphicsCore.graphics;c.forEach(function(c){a.ids.add(c);(c=b[c])&&c.addHighlight(a.highlightSet,
a.options)})};a.prototype.setObjectIds=function(a,c){var b=this.graphicsCore.graphics;c.forEach(function(b){return a.ids.add(b)});for(var k in b)(c=b[k])&&a.hasGraphic(c)&&c.addHighlight(a.highlightSet,a.options)};a.prototype.graphicCreated=function(a){this.highlights.forEach(function(b){b.hasGraphic(a)&&a.addHighlight(b.highlightSet,b.options)})};a.prototype.graphicDeleted=function(a){this.highlights.forEach(function(b){b.hasGraphic(a)&&a.removeHighlight(b.highlightSet)})};a.prototype.allGraphicsDeleted=
function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()})};return a}()})},"esri/views/3d/layers/graphics/Graphics3DHighlightSet":function(){define(["require","exports","../../webgl-engine/lib/HighlightSet"],function(x,r,k){return function(){function a(a,c){this.highlightSet=new k;this.ids=new Set;this.options=a;this.objectIdField=c}a.prototype.hasGraphic=function(a){return this.objectIdField?this.ids.has(a.graphic.attributes[this.objectIdField]):this.ids.has(a.graphic.uid)};
return a}()})},"esri/renderers/support/renderingInfoUtils":function(){define(["require","exports"],function(x,r){function k(a,c){if(!a||a.symbol)return null;c=c.renderer;return a&&c&&c.getObservationRenderer?c.getObservationRenderer(a):c}function a(a,c){if(a.symbol)return a.symbol;var b=k(a,c);return b&&b.getSymbol(a,c)}Object.defineProperty(r,"__esModule",{value:!0});r.getRenderer=k;r.getSymbol=a;r.getRenderingInfo=function(b,c){var r=k(b,c),n=a(b,c);if(!n)return null;n={renderer:r,symbol:n};if(r){r.colorInfo&&
(n.color=r.getColor(b).toRgba());if(r.sizeInfo){var f=r.getSize(b);n.size=[f,f,f]}if(r.visualVariables){b=r.getVisualVariableValues(b,c);f=["proportional","proportional","proportional"];for(c=0;c<b.length;c++){var q=b[c],r=q.variable,l=q.value;"color"===r.type?n.color=l.toRgba():"size"===r.type?"outline"===r.target?n.outlineSize=l:(q=r.axis,r=r.useSymbolValue?"symbolValue":l,"width"===q?f[0]=r:"depth"===q?f[1]=r:"height"===q?f[2]=r:f[0]="width-and-depth"===q?f[1]=r:f[1]=f[2]=r):"opacity"===r.type?
n.opacity=l:"rotation"===r.type&&"tilt"===r.axis?n.tilt=l:"rotation"===r.type&&"roll"===r.axis?n.roll=l:"rotation"===r.type&&(n.heading=l)}if(isFinite(f[0])||isFinite(f[1])||isFinite(f[2]))n.size=f}}return n}})},"esri/views/3d/layers/support/projectExtentUtils":function(){define(["require","exports","../../../../portal/support/geometryServiceUtils","../../../../core/promiseUtils","../../../../geometry/support/webMercatorUtils"],function(x,r,k,a,b){Object.defineProperty(r,"__esModule",{value:!0});
r.toView=function(c){var r=c.view.spatialReference,n=c.layer.fullExtent&&c.layer.fullExtent.spatialReference;return!n||n.equals(r)||"local"!==c.view.viewingMode?a.resolve(null):b.canProject(n,r)?a.resolve(b.project(c.layer.fullExtent,r)):k.projectGeometry(c.layer.fullExtent,r,c.layer.portalItem).then(function(a){if(!c.destroyed&&a)return a}).otherwise(function(){return null})}})},"url:esri/views/3d/environment/materials/SimpleAtmosphereMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsSimpleAtmosphere"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n\r\n#ifndef PANORAMIC\r\n\r\n const float TWICEPI \x3d 2.0*3.14159265;\r\n const float ATMOSPHERE_RIM_SEGMENTS \x3d 128.0;\r\n\r\n uniform vec3 silCircleCenter;\r\n uniform vec3 silCircleV1;\r\n uniform vec3 silCircleV2;\r\n uniform vec2 texV;\r\n\r\n#endif\r\n\r\n uniform vec3 lightDirection;\r\n\r\n attribute vec3 $position;\r\n varying vec2 vtc;\r\n varying float falloff;\r\n\r\n void main(void) {\r\n\r\n#ifdef PANORAMIC\r\n\r\n vec3 pos \x3d $position;\r\n float ndotl \x3d lightDirection.z;\r\n vtc \x3d vec2(0, $position.z+0.05);\r\n\r\n#else\r\n\r\n float phi \x3d $position.x * (TWICEPI / ATMOSPHERE_RIM_SEGMENTS) + 1.0;\r\n vec3 pos \x3d (sin(phi) * silCircleV1 + cos(phi) * silCircleV2 + silCircleCenter) * $position.y;\r\n float ndotl \x3d dot(normalize(pos), lightDirection);\r\n\r\n vtc.x \x3d $position.x / ATMOSPHERE_RIM_SEGMENTS;\r\n vtc.y \x3d texV.x * (1.0 - $position.z) + texV.y * $position.z;\r\n\r\n#endif\r\n\r\n falloff \x3d max(0.0, (smoothstep(-1.0, 0.8, ndotl + ndotl)));\r\n\r\n gl_Position \x3d proj * view * vec4(pos, 1.0);\r\n gl_Position.z \x3d gl_Position.w; // project atmosphere onto the far plane\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsSimpleAtmosphere"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform vec4 color;\r\n varying vec2 vtc;\r\n varying float falloff;\r\n\r\n void main() {\r\n vec4 texColor \x3d texture2D(tex, vtc);\r\n gl_FragColor \x3d texColor * color * falloff;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/environment/materials/RealisticAtmosphereMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3c!--Vertex Shader for Atmosphere--\x3e\r\n\x3csnippet name\x3d"vsRealisticAtmosphere"\x3e\x3c![CDATA[\r\n//\r\n// Based on Atmospheric scattering vertex shader by Sean O\'Neil from GPU Gems 2 Chapter 16.\r\n//\r\n// Link: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html\r\n// Download Portal: http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Index.html\r\n// Unmodified Source Code: http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Content/16.zip\r\n//\r\n// Adapted for WebGIS by Jascha Gr\u00fcbel (jgruebel@esri.com), Z\u00fcrich 2015\r\n//\r\n\r\n $vsprecisionf\r\n\r\n //Camera\r\n uniform vec2 halfSizeNearPlane;\r\n uniform vec3 v3CameraUp;\r\n uniform vec3 v3CameraRight;\r\n uniform vec3 v3CameraDir;\r\n uniform vec2 v2CameraCenterOffset;\r\n\r\n //Attributes\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n\r\n //Varyings\r\n varying vec3 v3WorldRay;\r\n varying vec2 vtc;\r\n\r\n#ifdef HAZE\r\n varying vec3 v3EyeDir;\r\n#endif\r\n\r\n void main(void) {\r\n vec3 v3Pos \x3d $position;\r\n vtc \x3d $uv0;\r\n vec2 rayvtc \x3d $uv0 - v2CameraCenterOffset;\r\n\r\n#ifdef HAZE\r\n v3EyeDir \x3d vec3((2.0*halfSizeNearPlane *rayvtc)-halfSizeNearPlane,-1.0);\r\n#else\r\n vec3 v3EyeDir \x3d vec3((2.0*halfSizeNearPlane *rayvtc)-halfSizeNearPlane,-1.0);\r\n#endif\r\n v3WorldRay \x3d v3EyeDir.z*v3CameraDir + v3EyeDir.y*v3CameraUp + v3EyeDir.x*v3CameraRight;\r\n gl_Position \x3d vec4(v3Pos, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereScaleFunction"\x3e\x3c![CDATA[\r\n //Approximation for inner integral based on a radii ratio of 10.25:10\r\n float scale(float fCos){\r\n float x \x3d 1.0 - fCos;\r\n return exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"toneMapperConstants"\x3e\x3c![CDATA[\r\n#ifdef HAZE\r\n const float fOneOverGamma \x3d 1.0;//Gamma \x3d 1.0\r\n#else\r\n const float fOneOverGamma \x3d 0.454545; // Gamma \x3d 2.2\r\n#endif\r\n const vec3 v3OneOverGamma \x3d vec3(fOneOverGamma);\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"exponentialToneMapper"\x3e\x3c![CDATA[\r\n //ToneMapping operators\r\n vec3 expTM(vec3 inputColor,float exposure){\r\n return pow(1.0 - exp(inputColor * -exposure), v3OneOverGamma);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"reinhardToneMapper"\x3e\x3c![CDATA[\r\n vec3 reinhardTM(vec3 inputColor, float exposure){\r\n vec3 intermediate \x3d inputColor *exposure;\r\n intermediate /\x3d (1.0+intermediate);\r\n return pow(intermediate, v3OneOverGamma);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"HSVColorSpace"\x3e\x3c![CDATA[\r\n//based on http://gamedev.stackexchange.com/a/59808\r\n// Hue in range [0,1] instead of 360\u00b0\r\nvec3 rgb2hsv(vec3 c)\r\n{\r\n vec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\r\n vec4 p \x3d mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\r\n vec4 q \x3d mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\r\n\r\n float d \x3d q.x - min(q.w, q.y);\r\n float e \x3d 1.0e-10;\r\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\r\n}\r\n\r\nvec3 hsv2rgb(vec3 c)\r\n{\r\n vec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\r\n vec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\r\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereUniformsConstantsVaryings"\x3e\x3c![CDATA[\r\n\r\n //Light\r\n uniform vec3 v3LightDir; // The direction vector to the light source\r\n uniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\r\n uniform vec3 v3InvWavelengthScaled; //v3InvWavelength * fKr4PI + fKm4PI\r\n\r\n //Radii\r\n uniform vec4 v4Radii; // inner, inner^2, outer, outer^2,\r\n\r\n //Atmosphere\r\n const float fKrESun \x3d 0.075; // Kr * ESun \x3d 0.005 * 15.0\r\n const float fKmESun \x3d 0.015; // Km * ESun \x3d 0.005 * 15\r\n //uniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\r\n //uniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere\'s average density is found)\r\n //uniform float fScaleOverScaleDepth; // fScale / fScaleDepth\r\n //uniform float fOneOverScaleDepth; // 1.0 / fScaleDepth\r\n\r\n //uniform float fScaleDepthBlue; // The scale depth (i.e. the altitude at which the atmosphere\'s average density is found)\r\n //uniform float fScaleOverScaleDepthBlue; // fScale / fScaleDepth\r\n //uniform float fOneOverScaleDepthBlue; // 1.0 / fScaleDepth\r\n\r\n uniform vec4 v4AtmosParams1; //(fScale,fScaleDepth,fScaleOverScaleDepth,fOneOverScaleDepth)\r\n uniform vec4 v4AtmosParams2; //(g,fScaleDepthBlue,fScaleOverScaleDepthBlue,fOneOverScaleDepthBlue)\r\n#ifndef HAZE\r\n uniform vec4 v4AtmosParams3; //(g2,fMiePhaseCoefficients,fLowerAlphaBlendBound,fOneOverOuterRadiusMinusAlphaBlendBound)\r\n#endif\r\n\r\n //Camera\r\n uniform vec3 v3CameraPos; // The camera\'s current position\r\n //uniform float fCameraHeight; // The camera\'s current height\r\n //uniform float fCameraHeight2; // fCameraHeight^2\r\n //uniform float fC; //fCameraHeight2 - fOuterRadius2; // C \x3d ||o-c||^2 - r^2\r\n //uniform float fCSur; //fCameraHeight2 - (fInnerRadius2 - 63756370000.0); // C \x3d ||o-c||^2 - r^2\r\n uniform vec4 v4SphereComp; //The camera\'s current height, CameraHeight^2,fC,fCSur\r\n uniform vec2 nearFar;\r\n\r\n //Camera HDR\r\n#ifdef HAZE\r\n const float fExposure \x3d 1.5;\r\n#else\r\n const float fExposure \x3d 2.0;\r\n#endif\r\n\r\n#ifdef HAZE\r\n //Depth texture\r\n uniform sampler2D tDepth;\r\n#endif\r\n\r\n //Testing variables\r\n uniform float showTest;\r\n\r\n //Varyings\r\n varying vec3 v3EyeDir;\r\n varying vec3 v3WorldRay;\r\n varying vec2 vtc;\r\n\r\n //Loop constants for integral approximation\r\n const float fSamples \x3d 5.0;\r\n const int maxSamples \x3d 5;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmospherePrecomputation"\x3e\x3c![CDATA[\r\n float fInnerRadius \x3d v4Radii[0]; // The inner (planetary) radius\r\n float fInnerRadius2 \x3d v4Radii[1]; // fInnerRadius^2\r\n float fOuterRadius \x3d v4Radii[2]; // The outer (atmosphere) radius\r\n float fOuterRadius2 \x3d v4Radii[3]; // fOuterRadius^2\r\n\r\n float fCameraHeight \x3d v4SphereComp[0];\r\n float fCameraHeight2 \x3d v4SphereComp[1];\r\n float fC \x3d v4SphereComp[2];\r\n float fCSur \x3d v4SphereComp[3];\r\n\r\n#ifdef PLANAR\r\n vec3 cameraPosition \x3d vec3(0.0,0.0,fCameraHeight);\r\n#else\r\n vec3 cameraPosition \x3d v3CameraPos;\r\n#endif\r\n\r\n //Debug variables\r\n vec3 test \x3d vec3(0.0,0.0,0.0);\r\n\r\n //Obtain ray from Camera\r\n vec3 worldSpaceRay \x3d normalize(v3WorldRay);\r\n\r\n //Compute Atmosphere intersection; i.e. ray/sphere intersection\r\n float B \x3d 2.0 * dot(cameraPosition, worldSpaceRay); // B \x3d 2(l * (o-c))\r\n float det \x3d B*B - 4.0 * fC; // det \x3d B^2 - 4.0* C\r\n\r\n //idealized sphere intersection to discard early some pixels\r\n float detSur \x3d B*B - 4.0 * fCSur; // det \x3d B^2 - 4.0* C\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereDiscardPixels"\x3e\x3c![CDATA[\r\n bool continueComputation \x3d true;\r\n#ifdef HAZE\r\n // only use red channel from depth texture.\r\n // see \'Issues\' at https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture\r\n float depthSample \x3d texture2D(tDepth, vtc).r;\r\n\r\n float zNear \x3d nearFar[0];\r\n float zFar \x3d nearFar[1];\r\n\r\n // http://web.archive.org/web/20130416194336/http://olivers.posterous.com/linear-depth-in-glsl-for-real\r\n float zNorm \x3d 2.0 * depthSample - 1.0;\r\n float linDepth \x3d 2.0 * zNear * zFar /\r\n (zFar + zNear - zNorm * (zFar - zNear));\r\n\r\n float nearSurfaceT;\r\n if (detSur\x3e0.0){\r\n nearSurfaceT \x3d 0.5 *(-B - sqrt(detSur));\r\n }\r\n\r\n float rayEndT;\r\n\r\n // find intersections with ground, but only between the near and far\r\n // clipping planes.\r\n if (depthSample \x3c 1.0 \x26\x26 depthSample \x3e 0.0) {\r\n vec3 cameraSpaceRay \x3d normalize(v3EyeDir);\r\n cameraSpaceRay /\x3d cameraSpaceRay.z;\r\n cameraSpaceRay *\x3d linDepth;\r\n#ifndef PLANAR\r\n if((fCameraHeight-fInnerRadius)\x3e8000000.0 \x26\x26 detSur\x3e0.0){\r\n rayEndT \x3d nearSurfaceT;\r\n } else if ((fCameraHeight-fInnerRadius)\x3e2000000.0 \x26\x26 detSur\x3e0.0){\r\n rayEndT \x3d mix(length(cameraSpaceRay),nearSurfaceT,((fCameraHeight-fInnerRadius)-2000000.0)/6000000.0);\r\n } else {\r\n rayEndT \x3d length(cameraSpaceRay);\r\n }\r\n#else\r\n rayEndT \x3d length(cameraSpaceRay);\r\n#endif\r\n } else {\r\n continueComputation \x3d false;\r\n }\r\n#ifdef PLANAR\r\n if (16500.0+ fInnerRadius \x3c fCameraHeight){\r\n continueComputation \x3d false;\r\n }\r\n#endif\r\n#else\r\n if (detSur\x3e0.0){\r\n float nearSurfaceT \x3d 0.5 *(-B - sqrt(detSur));\r\n if (nearSurfaceT \x3e 0.0){\r\n continueComputation \x3d false;\r\n }\r\n }\r\n#endif\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereUnpackAddUniforms"\x3e\x3c![CDATA[\r\n float fScale \x3d v4AtmosParams1.x;\r\n vec2 v2ScaleDepth \x3d vec2(v4AtmosParams1.y,v4AtmosParams2.y);//fScaleDepth, fScaleDepthBlue\r\n vec2 v2ScaleOverScaleDepth \x3d vec2(v4AtmosParams1.z,v4AtmosParams2.z);//fScaleOverScaleDepth, fScaleOverScaleDepthBlue\r\n vec2 v2OneOverScaleDepth \x3d vec2(v4AtmosParams1.w,v4AtmosParams2.w);//fOneOverScaleDepth, fOneOverScaleDepthBlue\r\n\r\n#ifndef HAZE\r\n float g \x3d v4AtmosParams2.x;\r\n float g2 \x3d v4AtmosParams3.x;\r\n float fMiePhaseCoefficients \x3d v4AtmosParams3.y;\r\n float fLowerAlphaBlendBound \x3d v4AtmosParams3.z;\r\n float fOneOverOuterRadiusMinusAlphaBlendBound \x3d v4AtmosParams3.w;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeRayAndLoopSetup"\x3e\x3c![CDATA[\r\n float rayStartT \x3d 0.5 *(-B - sqrt(det)); //near intersection with atmosphere\r\n#ifdef HAZE\r\n float nearT \x3d abs(rayStartT);\r\n float farT \x3d abs(rayEndT);\r\n#else\r\n float rayEndT \x3d 0.5 *(-B + sqrt(det)); //far intersection with atmosphere\r\n\r\n#endif\r\n\r\n float fDistance;//calculate its scattering offset\r\n // Calculate the ray\'s starting position\r\n if (rayStartT \x3c 0.0)\r\n { //ray starts from camera to far\r\n rayStartT \x3d 0.0;\r\n#ifndef HAZE\r\n fDistance \x3d fScale*(fInnerRadius - fCameraHeight);\r\n#endif\r\n }\r\n#ifndef HAZE\r\n else\r\n {//outside atmosphere\r\n fDistance \x3d -1.0;\r\n }\r\n#endif\r\n\r\n // Initialize the scattering loop variables\r\n vec3 v3Start \x3d cameraPosition + worldSpaceRay * rayStartT;\r\n\r\n#ifdef HAZE\r\n vec3 v3End \x3d cameraPosition + worldSpaceRay * rayEndT;\r\n\r\n float fEndLength \x3d length(v3End);\r\n float fLocalCameraHeight \x3d length(v3Start);\r\n\r\n //computed for the original end point to get consistent light angles after possible inversions\r\n float fLightAngle \x3d dot(v3LightDir, v3End) / fEndLength;\r\n\r\n if (nearT \x3e farT)\r\n {\r\n if (fLocalCameraHeight \x3c fEndLength)\r\n {\r\n //Switch positive slopes for flipped rays\r\n v3End \x3d cameraPosition + worldSpaceRay * rayStartT;\r\n v3Start \x3d cameraPosition + worldSpaceRay * rayEndT;\r\n worldSpaceRay *\x3d -1.0;\r\n fEndLength \x3d length(v3End);\r\n fLocalCameraHeight \x3d length(v3Start);\r\n }\r\n else if (fLocalCameraHeight \x3d\x3d fEndLength)\r\n {// create minuscule fake slope for integration if the slope is zero\r\n fLocalCameraHeight +\x3d 1.0; //BUGFIX, if the height of camera and ground is equal the equation breaks, add fake meter to camera height to get\r\n //slope for the camera function\r\n }\r\n }\r\n\r\n //Calculate its scattering offset\r\n // Assumes camera constrains of WSV 3.8\r\n float fCameraDepth;\r\n float fCameraDepthBlue;\r\n if (fLocalCameraHeight \x3e fOuterRadius)\r\n {\r\n fDistance \x3d fInnerRadius - fOuterRadius;\r\n } else\r\n {//outside atmosphere\r\n fDistance \x3d fEndLength - fLocalCameraHeight;\r\n }\r\n\r\n#endif\r\n vec2 v2OpticalStartDepth \x3d exp(fDistance * v2OneOverScaleDepth);\r\n\r\n float fRayLength \x3d rayEndT - rayStartT;\r\n float fSampleLength \x3d fRayLength / fSamples;\r\n float fScaledLength \x3d fSampleLength * fScale;\r\n vec3 v3SampleRay \x3d worldSpaceRay * fSampleLength;\r\n vec3 v3SamplePoint \x3d v3Start + v3SampleRay * 0.5;\r\n\r\n#ifdef HAZE\r\n float fCameraAngle \x3d dot(-worldSpaceRay, v3End) / fEndLength;\r\n float fScaleCameraAngle \x3d scale(fCameraAngle);\r\n vec2 v2CameraOffset \x3d fScaleCameraAngle*v2OpticalStartDepth;\r\n\r\n float scaledValues \x3d scale(fLightAngle) + fScaleCameraAngle;\r\n vec2 v2ScaledValuesDepth \x3d scaledValues * v2ScaleDepth;\r\n#else\r\n float fCameraAngle \x3d dot(worldSpaceRay, v3Start / length(v3Start));\r\n float angleMultiplier \x3d fCameraAngle\x3e0.0?fCameraAngle:0.0;\r\n\r\n float fScaleCameraAngle \x3d scale(fCameraAngle);\r\n vec2 v2CameraOffset \x3d fScaleCameraAngle*v2OpticalStartDepth * v2ScaleDepth;\r\n#endif\r\n\r\n //Loop variables\r\n vec3 v3FrontColor \x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3FrontColorBlue \x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3Attenuate\x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3AttenuateBlue \x3d vec3(0.0, 0.0, 0.0);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeSampleContribution"\x3e\x3c![CDATA[\r\n float fHeight \x3d length(v3SamplePoint);\r\n vec2 v2Depth \x3d exp(v2ScaleOverScaleDepth * (fInnerRadius - fHeight));\r\n#ifdef HAZE\r\n vec2 v2Scatter \x3d v2Depth*v2ScaledValuesDepth-v2CameraOffset;\r\n#else\r\n float fLightAngle \x3d dot(v3LightDir, v3SamplePoint) / fHeight;\r\n float fCameraAngle \x3d dot(worldSpaceRay, v3SamplePoint) / fHeight;\r\n float fTempScaledValues \x3d scale(fLightAngle) - scale(fCameraAngle);\r\n vec2 v2Scatter \x3d v2CameraOffset + fTempScaledValues*v2Depth* v2ScaleDepth;\r\n#endif\r\n v3Attenuate \x3d exp(-v2Scatter.x * v3InvWavelengthScaled);\r\n v3AttenuateBlue \x3d exp(-v2Scatter.y * v3InvWavelengthScaled);\r\n\r\n v3FrontColor +\x3d v3Attenuate * v2Depth.x;\r\n v3FrontColorBlue +\x3d v3AttenuateBlue * v2Depth.y;\r\n\r\n v3SamplePoint +\x3d v3SampleRay;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeHDRColors"\x3e\x3c![CDATA[\r\n //Phase computation\r\n //clamp to avoid numerical instability at fCos \x3d\x3d -1.0 (and close values) to display fake sun\r\n float fCos \x3d clamp(dot(v3LightDir, -worldSpaceRay ),-0.9999999,1.0);\r\n float fOnePlusCos2 \x3d fCos*fCos + 1.0;\r\n#ifdef HAZE\r\n // Finally, scale the Rayleigh colors and set up the varying variables for the pixel shader\r\n vec3 colorCoefficients \x3d (fScaledLength* 0.75 * fOnePlusCos2)*(fKrESun*v3InvWavelength+fKmESun);\r\n\r\n //Scaled Length is only applied afterwards to save multiplications\r\n vec3 v3Color \x3d colorCoefficients *v3FrontColor;\r\n vec3 v3ColorBlue \x3d colorCoefficients *v3FrontColorBlue;\r\n#else\r\n vec3 v3RayleighCoefficients \x3d (fScaledLength*0.75 * fOnePlusCos2*fKrESun)*v3InvWavelength;\r\n float fMieCoefficients \x3d fScaledLength*fKmESun * fMiePhaseCoefficients * fOnePlusCos2 / pow(1.0 + g2 - 2.0*g*fCos, 1.5);\r\n\r\n // Calculate the attenuation factor for the ground\r\n vec3 v3Color \x3d v3RayleighCoefficients * v3FrontColor + fMieCoefficients * v3FrontColor;\r\n vec3 v3ColorBlue \x3d v3RayleighCoefficients * v3FrontColorBlue + fMieCoefficients * v3FrontColorBlue;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputePixelColor"\x3e\x3c![CDATA[\r\n\r\n\r\n //HDR to LDR conversion\r\n vec3 ldrBlue \x3d expTM(v3ColorBlue,2.0*fExposure);\r\n vec3 ldrRed \x3d expTM(v3Color,fExposure);\r\n\r\n //mix reddish and blueish atmosphere\r\n vec3 LDR \x3d mix(ldrBlue,ldrRed,0.2);\r\n#ifdef HAZE\r\n LDR *\x3d (1.0-fCameraAngle);\r\n vec3 hsv \x3d rgb2hsv(LDR);\r\n hsv.y \x3d clamp(hsv.y*1.5,0.0,1.0);//boost haze saturation by 50%\r\n LDR \x3d hsv2rgb(hsv);\r\n vec3 finalColor \x3d LDR;\r\n // when rendering we specify the blend functions such that\r\n // newDestColor \x3d oldDestColor*(1.0-finalColor) + finalColor\r\n#else\r\n //reinhard tonemapper for looking upwards\r\n vec3 ldrReinhard \x3d reinhardTM(v3Color,fExposure);\r\n LDR +\x3d angleMultiplier*ldrReinhard;\r\n\r\n //height dependent parameter to smooth out reddish atmosphere\r\n float side \x3d (rayEndT+rayStartT)*0.5;\r\n float atmoHeight \x3d sqrt(fCameraHeight2 - side*side);\r\n float h2 \x3d clamp(1.0-(atmoHeight-fLowerAlphaBlendBound)/(fOuterRadius-fLowerAlphaBlendBound),0.0,1.0);\r\n\r\n vec3 finalColor \x3d LDR*h2;\r\n vec3 hsv \x3d rgb2hsv(finalColor);\r\n hsv.y \x3d clamp(hsv.y*1.5,0.0,1.0);//boost sky saturation by 50%\r\n finalColor \x3d hsv2rgb(hsv);\r\n#endif\r\n#ifdef PLANAR\r\n#ifndef HAZE\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,7000.0,30000.0);\r\n alpha \x3d alpha / (30000.0-7000.0);\r\n gl_FragColor \x3d vec4(finalColor, 1.0-alpha);\r\n#else\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,0.0,16500.0);\r\n alpha \x3d alpha / (16500.0-0.0);\r\n gl_FragColor \x3d vec4(finalColor, 1.0-alpha);\r\n#endif\r\n#else\r\n#ifndef HAZE\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,7000.0,30000.0);\r\n alpha \x3d alpha / (30000.0-7000.0);\r\n float atmosStrength \x3d clamp((length(ldrRed)-0.05)*1.05,0.0,1.0);\r\n gl_FragColor \x3d vec4(finalColor, atmosStrength*clamp(1.0-(atmoHeight-fInnerRadius)/(fOuterRadius-fInnerRadius),0.0,1.0));\r\n#else\r\n gl_FragColor \x3d vec4(finalColor, 1.0);\r\n#endif\r\n#endif\r\n\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--Fragment Shader for Atmosphere--\x3e\r\n\x3csnippet name\x3d"fsRealisticAtmosphere"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n$atmosphereUniformsConstantsVaryings\r\n\r\n$atmosphereScaleFunction\r\n\r\n //Conversion implementation found in util.xml\r\n$rgba2float\r\n\r\n\r\n$toneMapperConstants\r\n$exponentialToneMapper\r\n#ifndef HAZE\r\n$reinhardToneMapper\r\n#endif\r\n\r\n$HSVColorSpace\r\n\r\n void main()\r\n {\r\n\r\n $atmospherePrecomputation\r\n\r\n //Inside Atmosphere\r\n if (det \x3e\x3d 0.0){\r\n\r\n $atmosphereDiscardPixels\r\n\r\n if(continueComputation){\r\n\r\n $atmosphereUnpackAddUniforms\r\n\r\n $atmosphereComputeRayAndLoopSetup\r\n\r\n // Now loop through the sample rays\r\n for(int i\x3d0; i\x3cmaxSamples; i++)\r\n {\r\n $atmosphereComputeSampleContribution\r\n }\r\n\r\n $atmosphereComputeHDRColors\r\n\r\n $atmosphereComputePixelColor\r\n\r\n //Debug variable overlay\r\n if(showTest\x3e0.0){\r\n gl_FragColor \x3d vec4(test,1.0);\r\n }\r\n\r\n } else {//Not on surface\r\n gl_FragColor \x3d vec4(0.0);\r\n }\r\n } else {//Outside Atmosphere\r\n gl_FragColor \x3d vec4(0.0);\r\n }\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/offscreen.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsOffscreenRenderer"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n attribute vec2 $uv0;\r\n varying vec2 vtc;\r\n\r\n void main(void) {\r\n gl_Position \x3d vec4(position.xy, 0.0, 1.0);\r\n vtc \x3d $uv0.xy * 0.5 + 0.5;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsOffscreenRenderer"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n varying vec2 vtc;\r\n\r\n void main() {\r\n vec4 texColor \x3d texture2D(tex, vtc);\r\n gl_FragColor \x3d texColor;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/environment/materials/StarMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderStar"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tuniform vec4 viewport;\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec4 $color;\r\n attribute float $size;\r\n\r\n\tvarying vec4 vcolor;\r\n\tvarying float vsize;\r\n\r\n\t$alignToPixelCenter\r\n\r\n\tvoid main(void) {\r\n\t\tvec4 posProj \x3d proj * view * model*vec4($position*1.0e25,1.0);//move infinitely far away\r\n\t\tgl_Position \x3d alignToPixelCenter(posProj, viewport.zw); //pixel align position\r\n gl_Position.z \x3d gl_Position.w; // project atmosphere onto the far plane\r\n\t\tvcolor \x3d $color/1.2;\r\n\t\tvsize \x3d size*5.0;\r\n\t\tgl_PointSize \x3d vsize;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderStar"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec4 vcolor;\r\n\tvarying float vsize;\r\n\r\n\tvoid main() {\r\n\t\tfloat cap \x3d 0.7;\r\n\t\tfloat scale \x3d 1.0/cap;\r\n\t\tfloat helper \x3d clamp(length(abs(gl_PointCoord-vec2(0.5))),0.0,cap);\r\n\t\tfloat alpha \x3d clamp((cap-helper)*scale,0.0,1.0);\r\n\t\tfloat intensity \x3d alpha*alpha*alpha;\r\n\t\tif (vsize \x3c 3.0)\r\n\t\t\tintensity *\x3d 0.5;\r\n\t\tgl_FragColor \x3d vec4(1.0,1.0,1.0,intensity);\r\n\t\tgl_FragColor.xyz *\x3d vcolor.xyz;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/HUDMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderHUD"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n uniform float pixelRatio;\r\n uniform vec2 screenOffset;\r\n uniform vec2 anchorPos;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n varying vec3 debugBorderCoords;\r\n#endif\r\n\r\n attribute vec2 $uv0;\r\n attribute vec4 $color;\r\n attribute vec2 $size;\r\n attribute vec4 $auxpos2;\r\n\r\n varying vec4 vcolor;\r\n\r\n varying vec2 vtc;\r\n varying vec2 vsize;\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n varying float voccluded;\r\n#endif\r\n\r\n $vvUniforms\r\n\r\n $alignToPixelCenter\r\n $alignToPixelOrigin\r\n $projectPositionHUD\r\n $vvFunctions\r\n\r\n void main(void) {\r\n ProjectHUDAux projectAux;\r\n vec4 posProj \x3d projectPositionHUD(projectAux);\r\n\r\n vec2 inputSize;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n inputSize \x3d screenSizePerspectiveScaleVec2($size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);\r\n\r\n vec2 screenOffsetScaled \x3d screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);\r\n\r\n#else\r\n\r\n inputSize \x3d $size;\r\n\r\n vec2 screenOffsetScaled \x3d screenOffset;\r\n#endif\r\n\r\n#ifdef VV_SIZE\r\n // only use width (.xx) for proportional scaling\r\n // (if no width was defined in vv, width\r\n // will be a copy of height vv)\r\n inputSize *\x3d vvGetScale($auxpos2).xx;\r\n#endif\r\n\r\n vec2 combinedSize \x3d inputSize * pixelRatio;\r\n vec4 quadOffset \x3d vec4(0);\r\n\r\n#if defined(OCCL_TEST) || defined(BINARY_HIGHLIGHT_OCCLUSION)\r\n bool visible \x3d testVisibilityHUD(posProj);\r\n#endif\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n voccluded \x3d visible ? 0.0 : 1.0;\r\n#endif\r\n\r\n#ifdef OCCL_TEST\r\n if (visible) {\r\n#endif\r\n // UV goes from 0 to 1.99999, where the integer part is used\r\n // for the normalized vertex coordinates, and the fractional\r\n // part is used for texture sampling\r\n vec2 uv01 \x3d floor($uv0);\r\n vec2 uv \x3d $uv0 - uv01;\r\n\r\n // Displace icon based on anchor position (normalized for size) and\r\n // absolute screen offset. anchorPos is [-0.5, 0.5]\r\n quadOffset.xy \x3d ((uv01 - anchorPos) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;\r\n\r\n#ifdef SIGNED_DISTANCE_FIELD\r\n\r\n // SDF primitives might be scaled so that the SDF texture resolution does\r\n // not match the resolution of the canvas, but we still want to render\r\n // outline-only (\'cross\' and \'x\') primitives cleanly. Aligning to a screen\r\n // pixel border at the geometry center achieves this, since SDF textures\r\n // always have power of 2 dimensions.\r\n posProj \x3d alignToPixelOrigin(posProj, viewport.zw) + quadOffset;\r\n#else\r\n posProj +\x3d quadOffset;\r\n\r\n // Aligning vertex positions to the nearest (using \'floor\') screen pixel\r\n // border renders textures with pixel-perfect results. If the texture\r\n // resolution does not match the canvas resolution then aligning is\r\n // redundant.\r\n if (inputSize.x \x3d\x3d $size.x) {\r\n posProj \x3d alignToPixelOrigin(posProj, viewport.zw);\r\n }\r\n#endif\r\n\r\n gl_Position \x3d posProj;\r\n\r\n vtc \x3d uv;\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n debugBorderCoords \x3d vec3(uv01, 1.0 / combinedSize);\r\n#endif\r\n\r\n vsize \x3d inputSize;\r\n#ifdef OCCL_TEST\r\n } else {\r\n vtc \x3d vec2(.0);\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n debugBorderCoords \x3d vec3(0);\r\n#endif\r\n\r\n }\r\n#endif\r\n\r\n gl_Position \x3d posProj;\r\n\r\n#ifdef VV_COLOR\r\n vcolor \x3d vvGetColor($auxpos2, vvColorValues, vvColorColors);\r\n#else\r\n vcolor \x3d $color / 255.0;\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDBaseVariables"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n #extension GL_OES_standard_derivatives : require\r\n\r\n uniform sampler2D tex;\r\n uniform vec4 overrideColor;\r\n uniform vec4 outlineColor;\r\n uniform float outlineSize;\r\n\r\n varying vec4 vcolor;\r\n\r\n varying vec2 vtc;\r\n varying vec2 vsize;\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n varying float voccluded;\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n varying vec3 debugBorderCoords;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDBaseMain"\x3e\x3c![CDATA[\r\n vec4 premultiply(vec4 v) {\r\n return vec4(v.rgb * v.a, v.a);\r\n }\r\n\r\n void main() {\r\n\r\n#ifdef SIGNED_DISTANCE_FIELD\r\n vec4 color \x3d vec4(0.0, 0.0, 0.0, 0.0);\r\n vec4 fillPixelColor \x3d overrideColor * vcolor;\r\n\r\n // Attempt to sample texel centers to avoid thin cross outline\r\n // disappearing with large symbol sizes.\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041\r\n const float txSize \x3d 128.0;\r\n vec2 scaleFactor \x3d ((vsize - txSize) / txSize);\r\n vec2 samplePos \x3d vtc + vec2(1.0, -1.0) * (1.0 / txSize) * scaleFactor;\r\n\r\n // Distance in [-0.5, 0.5]\r\n float d \x3d dot(texture2D(tex, samplePos), vec4(1.0/16777216.0, 1.0/65535.0, 1.0/256.0, 1.0)) - 0.5;\r\n\r\n // Work around loss of precision for \'d \x3d 0.0\'.\r\n // \'0\' gets normalised to 0.5 * 256 \x3d 128 before float packing, but can only\r\n // be stored in the texture as 128 / 255 \x3d 0.502.\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603110\r\n const float diff \x3d (128.0/255.0 - 0.5);\r\n\r\n // adjust all values, not just those close to 0, to avoid discontinuities in\r\n // the outlines of other shapes e.g. circles\r\n d \x3d d - diff;\r\n\r\n // Distance in output units\r\n float dist \x3d d * vsize.x;\r\n\r\n fillPixelColor.a *\x3d clamp(0.5 - dist, 0.0, 1.0);\r\n\r\n if (outlineSize \x3e 0.25) {\r\n vec4 outlinePixelColor \x3d outlineColor;\r\n float clampedOutlineSize \x3d min(outlineSize, 0.5*vsize.x);\r\n outlinePixelColor.a *\x3d clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0);\r\n\r\n // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description)\r\n float compositeAlpha \x3d outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a);\r\n vec3 compositeColor \x3d vec3(outlinePixelColor) * outlinePixelColor.a +\r\n vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a);\r\n\r\n gl_FragColor \x3d vec4(compositeColor, compositeAlpha);\r\n }\r\n else {\r\n gl_FragColor \x3d premultiply(fillPixelColor);\r\n }\r\n\r\n // visualize SDF:\r\n // gl_FragColor \x3d vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);\r\n#else\r\n\r\n // HUDMaterial is rendered with a blending mode that assumes a pre-multiplied\r\n // fragment color. Input textures should already be pre-multiplied and so\r\n // don\'t require adjustment, but the override and vertex colors must be\r\n // modulated by their alpha values.\r\n\r\n gl_FragColor \x3d texture2D(tex, vtc, -0.5) * premultiply(overrideColor * vcolor);\r\n\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n float isBorder \x3d float(any(lessThan(debugBorderCoords.xy, vec2(debugBorderCoords.z))) || any(greaterThan(debugBorderCoords.xy, vec2(1.0 - debugBorderCoords.z))));\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 1, 1), isBorder);\r\n#endif\r\n\r\n if (gl_FragColor.a \x3c 0.1) {\r\n discard;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUD"\x3e\x3c![CDATA[\r\n$fragmentShaderHUDBaseVariables\r\n$fragmentShaderHUDBaseMain\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDHighlight"\x3e\x3c![CDATA[\r\n$fragmentShaderHUDBaseVariables\r\n\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n$fragmentShaderHUDBaseMain\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n // Instead of deciding on a per-pixel basis if the highlight is occluded,\r\n // do it for all highlight pixel based on the centroid occlusion. This\r\n // is a temporary solution for:\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/9645\r\n if (voccluded \x3d\x3d 1.0) {\r\n gl_FragColor \x3d vec4(1.0, 1.0, 0.0, 1.0);\r\n } else {\r\n gl_FragColor \x3d vec4(1.0, 0.0, 1.0, 1.0);\r\n }\r\n#else\r\n $highlightWrite\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"vertexShaderOcclusionTestPixel"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n $alignToPixelCenter\r\n $projectPositionHUD\r\n\r\n void main(void) {\r\n vec4 posProjCenter;\r\n\r\n // Check for special value of position (0, 0, 0) which is used by the Renderer when graphics\r\n // are removed before the VBO is recompacted. If this is the case, then we just project outside\r\n // of clip space.\r\n if (dot($position, $position) \x3e 0.0) {\r\n // Render single point to center of the pixel to avoid subpixel filtering to affect\r\n // the marker color\r\n ProjectHUDAux projectAux;\r\n vec4 posProj \x3d projectPositionHUD(projectAux);\r\n\r\n posProjCenter \x3d alignToPixelCenter(posProj, viewport.zw);\r\n }\r\n else {\r\n // Project out of clip space\r\n posProjCenter \x3d vec4(1e038, 1e038, 1e038, 1.0);\r\n }\r\n\r\n gl_Position \x3d posProjCenter;\r\n gl_PointSize \x3d 1.0;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/TexOnlyGLMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderTexOnly"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4(position, 1.0)).xyz, 1.0);\r\n\t\tvtc \x3d $uv0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderTexOnly"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform vec4 color;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main() {\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tgl_FragColor \x3d texColor * color;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/ssao.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\t\x3csnippet name\x3d"createFsSSAOSrc"\x3e\x3c![CDATA[\r\n\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D rnm;\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\tuniform float\t\tssaoAtt;\r\n\tuniform vec2\t\trnmScale;\r\n\tuniform float\t\tradius;\r\n\tuniform vec2\t\tnearFar;\r\n\tuniform vec3\t\tpSphere[64];\r\n\r\n\tvarying vec2\t\tuv;\r\n\r\n\tconst\tfloat\t\tstrength \x3d .07;\r\n\tconst\tfloat\t\tfalloff \x3d .000002;\r\n\r\n\t$rgba2float\r\n\tvoid main(void) {\r\n\t\tvec3 fres \x3d normalize((texture2D(rnm, uv * rnmScale).xyz * 2.0) - vec3(1.0));\r\n\t\tfloat currentPixelDepth \x3d rgba2float(texture2D(depthMap, uv));\r\n\t\tvec3 ep \x3d vec3(uv.xy, currentPixelDepth);\r\n\t\tvec3 norm \x3d vec3(-1.0) + 2.0 * texture2D(normalMap, uv).xyz;\r\n\t\tfloat bl \x3d .0;\r\n\t\tfloat f \x3d mix(nearFar.x, nearFar.y, currentPixelDepth) / nearFar.x;\r\n\t\tfloat radD \x3d radius / f;\r\n\t\tradD \x3d min(radD, .5);\r\n\t\tfloat depthDifference;\r\n\t\tvec3 ray;\r\n\r\n\t\tfor(int i \x3d 0; i \x3c NUM_TAP_SAMPLES; ++i) {\r\n\t\t\tray \x3d radD*reflect(pSphere[i], fres);\r\n\t\t\tvec2 tc \x3d ep.xy + sign(dot(ray, norm) ) * ray.xy;\r\n\t\t\tif (tc.x \x3e\x3d .0 \x26\x26 tc.y \x3e\x3d .0 \x26\x26 tc.x \x3c\x3d 1.0 \x26\x26 tc.y \x3c\x3d 1.0) {\r\n\t\t\t\tfloat occluderDepth \x3d rgba2float(texture2D(depthMap, tc));\r\n\t\t\t\tvec3 occluderNormal \x3d vec3(-1.0) + 2.0 * texture2D(normalMap, tc).xyz;\r\n\t\t\t\tdepthDifference \x3d currentPixelDepth - occluderDepth;\r\n\t\t\t\tbl +\x3d step(falloff, depthDifference) * (1.0 - dot(occluderNormal, norm)) * (1.0 - smoothstep(falloff, strength, depthDifference));\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tfloat ao \x3d 1.0 + bl * (-1.38 / float(NUM_TAP_SAMPLES)) * ssaoAtt;\r\n\t\tgl_FragColor.a \x3d ao;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"getDepthLinear"\x3e\x3c![CDATA[\r\n\tfloat getDepthLinear(vec2 ssC) {\r\n\t\treturn -(rgba2float(texture2D(depthMap, ssC))*(nearFar[1] - nearFar[0])+nearFar[0]);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"createFsSSAOSrcObscurance"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform mat4 projMatrixInv;\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\r\n\tuniform float intensity;\r\n\r\n\tuniform float projScale;\r\n\tuniform float radius;\r\n\tuniform vec2 nearFar;\r\n\r\n\tuniform vec4 projInfo;\r\n\r\n\tuniform vec2\t screenDimensions;\r\n\r\n\t//noise texture lookup could be replaced with hash function if WebGL gets XOR functionality\r\n\tuniform vec3\t\tpSphere[NUM_TAP_SAMPLES]; //tap position\r\n\tuniform vec2\t\trnmScale;\r\n\tuniform sampler2D rnm; //noise texture\r\n\r\n\t//set z scaling, used to prevent division in ortho mode\r\n\tuniform vec2 zScale;\r\n\r\n\tvarying vec2 uv;\r\n\tvarying vec4 camPos;\r\n\r\n\t$rgba2float\r\n\t$getDepthLinear\r\n\r\n\t/** Returns a unit vector and a screen-space radius for the tap on a unit disk (the caller should scale by the actual disk radius) */\r\n\t/*uniform float numSpiralTurns;\r\n\tvec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){\r\n\t\t// Radius relative to ssR\r\n\t\tfloat alpha \x3d (float(sampleNumber) + 0.5) * (1.0 / float(NUM_TAP_SAMPLES));\r\n\t\tfloat angle \x3d alpha * (numSpiralTurns * 6.28) + spinAngle;\r\n\r\n\t\tssR \x3d alpha;\r\n\t\treturn vec2(cos(angle), sin(angle));\r\n\t}*/\r\n\r\n\r\n\tfloat fallOffFunction(float vv, float vn, float bias) {\r\n\t float radius2 \x3d radius * radius;\r\n\r\n\t\t// A: From the HPG12 paper\r\n\t\t// Note large epsilon to avoid overdarkening within cracks\r\n\t\t// return float(vv \x3c radius2) * max((vn - bias) / (epsilon + vv), 0.0) * radius2 * 0.6;\r\n\r\n\t\t// B: Smoother transition to zero (lowers contrast, smoothing out corners). [Recommended]\r\n\t\tfloat f \x3d max(radius2 - vv, 0.0); return f * f * f * max(vn-bias, 0.0);\r\n\r\n\t\t// C: Medium contrast (which looks better at high radii), no division. Note that the\r\n\t\t// contribution still falls off with radius^2, but we\'ve adjusted the rate in a way that is\r\n\t\t// more computationally efficient and happens to be aesthetically pleasing.\r\n\t\t// return 4.0 * max(1.0 - vv * invRadius2, 0.0) * max(vn - bias, 0.0);\r\n\r\n\t\t// D: Low contrast, no division operation\r\n\t\t// return 2.0 * float(vv \x3c radius * radius) * max(vn - bias, 0.0);\r\n\t}\r\n\r\n\r\n\t/** Compute the occlusion due to sample point \\a Q about camera-space point \\a C with unit normal \\a n_C */\r\n\tfloat aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {\r\n\t\tvec3 v \x3d Q - C;\r\n\t\tfloat vv \x3d dot(v, v);\r\n\t\tfloat vn \x3d dot(normalize(v), n_C);\r\n\t\treturn fallOffFunction(vv, vn, 0.1);\r\n\t}\r\n\r\n\r\n\t/** Reconstruct camera-space P.xyz from screen-space S \x3d (x, y) in\r\n\t\tpixels and camera-space z \x3c 0. Assumes that the upper-left pixel center\r\n\t\tis at (0.5, 0.5) [but that need not be the location at which the sample tap\r\n\t\twas placed!]\r\n\r\n\t\tCosts 3 MADD. Error is on the order of 10^3 at the far plane, partly due to z precision.\r\n\t */\r\n\tvec3 reconstructCSPosition(vec2 S, float z) {\r\n\t\treturn vec3(( (S.xy) * projInfo.xy + projInfo.zw)*(z*zScale.x+zScale.y), z);\r\n\t}\r\n\r\n\tvoid main(void)\r\n\t{\r\n\r\n\t\t//Hash function used in the HPG12 AlchemyAO paper\r\n\t\t//Not supported in WebGL -\x3e using texture lookup as in old SSAO shader instead\r\n\t\t//ivec2 ssC \x3d ivec2(gl_FragCoord.xy);\r\n\t\t//float randomPatternRotationAngle \x3d float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10);\r\n\t\tvec3 fres \x3d normalize((texture2D(rnm, uv * rnmScale).xyz * 2.0) - vec3(1.0));\r\n\r\n\t float currentPixelDepth \x3d getDepthLinear(uv);\r\n\r\n\t if (-currentPixelDepth\x3enearFar.y || -currentPixelDepth\x3cnearFar.x) {\r\n\t\tgl_FragColor \x3d vec4(0);\r\n\t\treturn;\r\n\t }\r\n\r\n\t vec3 currentPixelPos \x3d reconstructCSPosition(gl_FragCoord.xy,currentPixelDepth);\r\n\r\n\t // get the normal of current fragment\r\n\t vec4 norm4 \x3d texture2D(normalMap, uv);\r\n\t vec3 norm \x3d vec3(-1.0) + 2.0 * norm4.xyz;\r\n\t bool isTerrain \x3d norm4.w\x3c0.5;\r\n\r\n\t float sum \x3d .0;\r\n\r\n\t vec4 occluderFragment;\r\n\t vec3 ray;\r\n\r\n\t vec3 tapPixelPos;\r\n\r\n\t // note: the factor 2.0 should not be necessary, but makes ssao much nicer.\r\n\t // bug or deviation from CE somewhere else?\r\n\t float ps \x3d projScale/(2.0*currentPixelPos.z*zScale.x+zScale.y);\r\n\r\n\t for(int i \x3d 0; i \x3c NUM_TAP_SAMPLES; ++i)\r\n\t {\r\n\t\t // get a vector (randomized inside of a sphere with radius 1.0) from a texture and reflect it\r\n\t\t //float ssR;\r\n\t\t //vec2 unitOffset \x3d tapLocation(i, randomPatternRotationAngle, ssR);\r\n\t\t // get the depth of the occluder fragment\r\n\t\t //vec2 offset \x3d vec2(-unitOffset*radius*ssR*ps);\r\n\r\n\t\t vec2 unitOffset \x3d reflect(pSphere[i], fres).xy;\r\n\t\t vec2 offset \x3d vec2(-unitOffset*radius*ps);\r\n\r\n\r\n\t\t //don\'t use current or very nearby samples\r\n\t\t if ( abs(offset.x)\x3c2.0 || abs(offset.y)\x3c2.0) continue;\r\n\r\n\r\n\t\t vec2 tc \x3d vec2(gl_FragCoord.xy + offset);\r\n\t\t if (tc.x \x3c 0.0 || tc.y \x3c 0.0 || tc.x \x3e screenDimensions.x || tc.y \x3e screenDimensions.y) continue;\r\n\t\t vec2 tcTap \x3d tc/screenDimensions;\r\n\t\t float occluderFragmentDepth \x3d getDepthLinear(tcTap);\r\n\r\n\t\t if (isTerrain) {\r\n\t\t \tbool isTerrainTap \x3d texture2D(normalMap, tcTap).w\x3c0.5;\r\n\t\t \tif (isTerrainTap)\r\n\t\t \t\tcontinue;\r\n\t\t }\r\n\r\n\t\t tapPixelPos \x3d reconstructCSPosition(tc, occluderFragmentDepth);\r\n\r\n\t\t sum+\x3d aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);\r\n\t }\r\n\r\n\t // output the result\r\n\r\n\t\tfloat A \x3d max(1.0-sum*intensity/float(NUM_TAP_SAMPLES),0.0);\r\n\r\n\t\t// Anti-tone map to reduce contrast and drag dark region farther\r\n\t\t// (x^0.2 + 1.2 * x^4)/2.2\r\n\t\tA \x3d (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;\r\n\r\n\r\n\t //gl_FragColor \x3d vec4(norm/2.0+0.5, 1.0);\r\n\t //gl_FragColor \x3d vec4(-currentPixelDepth/1000.0);\r\n\t //gl_FragColor \x3d vec4(tapPixelPos.x/100.0);\r\n\t gl_FragColor \x3d vec4(A);\r\n\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsBlurEdgeAware"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\tuniform sampler2D tex;\r\n\r\n\r\n\tuniform vec2 blurSize;\r\n\r\n\r\n\tuniform float g_BlurFalloff;\r\n\tuniform float projScale;\r\n\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tuniform vec2\t\tnearFar;\r\n\r\n\t//set z scaling, used to prevent division in ortho mode\r\n\tuniform vec2 zScale;\r\n\r\n\t$rgba2float\r\n\t$getDepthLinear\r\n\r\n\tfloat BlurFunction(vec2 uv, float r, float center_d, inout float w_total, float sharpness)\r\n\t{\r\n\t\tfloat c \x3d texture2D(tex, uv).r;\r\n\t\tfloat d \x3d getDepthLinear(uv);\r\n\r\n\t\tfloat ddiff \x3d d - center_d;\r\n\r\n\t\tfloat w \x3d exp(-r*r*g_BlurFalloff - ddiff*ddiff*sharpness);\r\n\r\n\t\tw_total +\x3d w;\r\n\r\n\t\treturn w*c;\r\n\t}\r\n\r\n\tvoid main(void)\r\n\t{\r\n\r\n\t\tfloat b \x3d 0.0;\r\n\t\tfloat w_total \x3d 0.0;\r\n\r\n\t\tfloat center_d \x3d getDepthLinear(uv);\r\n\r\n\t\tfloat sharpness \x3d -0.05*projScale/(center_d*zScale.x+zScale.y);\r\n\t\tfor (int r \x3d -RADIUS; r \x3c\x3d RADIUS; ++r)\r\n\t\t{\r\n\t\t\tfloat rf \x3d float(r);\r\n\t\t\tvec2 uvOffset \x3d uv + rf*blurSize;\r\n\t\t\tb +\x3d BlurFunction(uvOffset, rf, center_d, w_total, sharpness);\r\n\t\t}\r\n\r\n\t\tgl_FragColor \x3d vec4(b/w_total);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\t\x3csnippet name\x3d"fsBlurSrc0"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform float blurSize;\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main() {\r\n\t\tint rad \x3d RADIUS - 1;\r\n\r\n\t\tvec4 sum \x3d vec4(0.0);\r\n\t\tfor (int k \x3d -RADIUS; k \x3c\x3d RADIUS; ++k) { \t\t// NOTE for-variable-init must be a const expression\r\n\t\t\tfloat fi \x3d float(k);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurSrc1"\x3e\x3c![CDATA[\r\n\t\t}\r\n\r\n\t\tgl_FragColor \x3d sum / float(RADIUS * RADIUS);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurH"\x3e\x3c![CDATA[\r\n\t$fsBlurSrc0\r\n\t\t\tsum +\x3d texture2D(tex, vec2(uv.x + fi * blurSize, uv.y)) * (float(rad) - abs(fi) + 1.0);\r\n\t$fsBlurSrc1\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurV"\x3e\x3c![CDATA[\r\n\t$fsBlurSrc0\r\n\t\t\tsum +\x3d texture2D(tex, vec2(uv.x, uv.y + fi * blurSize)) * (float(rad) - abs(fi) + 1.0);\r\n\t$fsBlurSrc1\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/highlight.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nSmartly downsamples a texture, halfing its resolution. This allows for a square\r\nscreen region to check if none, any or all pixels were set.\r\n\r\nThe red channel is always ceiled after interpolating the 4 merged pixels.\r\nThis allows to evaluate:\r\nany(pixels.red !\x3d 0.0) as red \x3d\x3d 1.0\r\nnone(pixels.red !\x3d 0.0) as red \x3d\x3d 0.0\r\n\r\nThe green and blue channels are set to floor(max(green, blue)).\r\nThis allows to evaluate:\r\nall(pixels.green || pixels.blue) as green \x3d\x3d 1.0\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\r\n\x3csnippet name\x3d"vsConservativeDownsample"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n\r\n void main()\r\n {\r\n gl_Position \x3d vec4(vec2(1.0) - $position * 2.0, .0, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsConservativeDownsample"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform vec2 invFramebufferDim;\r\n\r\n void main()\r\n {\r\n vec2 coord \x3d gl_FragCoord.xy * invFramebufferDim;\r\n vec4 value \x3d texture2D(tex, coord);\r\n float mx \x3d floor(max(value.g, value.b));\r\n gl_FragColor \x3d vec4(ceil(value.r), mx, mx, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nGaussian blur with linear sampling. Supports different number of samples, but\r\nonly 5 samples have proper weights. Uses linear texture interpolation to reduce\r\nthe number of samples taken.\r\n\r\nDefines:\r\nGRID_OPTIMIZATION (set or !set)\r\nGAUSSIAN_SAMPLES (3,5,7)\r\n\r\nThis technique requires linear filtering on source texture\r\nhttp://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\x3csnippet name\x3d"vsHighlightBlurFastGaussian"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n attribute vec2 $uv0;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n uniform sampler2D coverageTex;\r\n varying vec3 blurCoordinate;\r\n #else\r\n uniform vec2 blurSize;\r\n varying vec2 blurCoordinates[GAUSSIAN_SAMPLES];\r\n #endif\r\n\r\n void main()\r\n {\r\n gl_Position \x3d vec4($position, 0.0, 1.0);\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n // sample the coverage texture at the block center\r\n // and if no coverage detected, create degenerate triangle\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n if (cov.r \x3d\x3d 0.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n }\r\n\r\n // create texture coordinate for blur center\r\n // encode information about fully inside block in z coordinate\r\n blurCoordinate \x3d vec3(gl_Position.xy * .5 + vec2(.5), max(cov.g, cov.b));\r\n #else\r\n vec2 uv \x3d $position.xy * .5 + vec2(.5);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n blurCoordinates[5] \x3d uv + blurSize * 5.1;\r\n blurCoordinates[6] \x3d uv - blurSize * 5.1;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n blurCoordinates[5] \x3d uv + blurSize * 5.1;\r\n blurCoordinates[6] \x3d uv - blurSize * 5.1;\r\n blurCoordinates[7] \x3d uv + blurSize * 7.1;\r\n blurCoordinates[8] \x3d uv - blurSize * 7.1;\r\n #endif\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightBlurFastGaussian"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n uniform vec2 blurSize;\r\n varying vec3 blurCoordinate;\r\n #else\r\n varying vec2 blurCoordinates[GAUSSIAN_SAMPLES];\r\n #endif\r\n\r\n void main()\r\n {\r\n #ifdef GRID_OPTIMIZATION\r\n vec2 uv \x3d blurCoordinate.xy;\r\n vec4 center \x3d texture2D(tex, uv);\r\n\r\n // do not blur if no pixel or all pixels in neighborhood are set\r\n if (blurCoordinate.z \x3d\x3d 1.0) {\r\n gl_FragColor \x3d center;\r\n }\r\n else {\r\n vec4 sum \x3d vec4(0.0);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.294215) * 0.093913;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 5.1) * 0.03;\r\n sum +\x3d texture2D(tex, uv - blurSize * 5.1) * 0.03;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.154164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.5) * 0.204005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.5) * 0.204005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 5.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 5.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 7.5) * 0.05;\r\n sum +\x3d texture2D(tex, uv - blurSize * 7.5) * 0.05;\r\n #endif\r\n\r\n gl_FragColor \x3d sum;\r\n }\r\n #else\r\n vec4 sum \x3d vec4(0.0);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.093913;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[5]) * 0.03;\r\n sum +\x3d texture2D(tex, blurCoordinates[6]) * 0.03;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.154164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.204005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.204005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.123913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.123913;\r\n sum +\x3d texture2D(tex, blurCoordinates[5]) * 0.09;\r\n sum +\x3d texture2D(tex, blurCoordinates[6]) * 0.09;\r\n sum +\x3d texture2D(tex, blurCoordinates[7]) * 0.05;\r\n sum +\x3d texture2D(tex, blurCoordinates[8]) * 0.05;\r\n #endif\r\n\r\n gl_FragColor \x3d sum;\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nMerging blurred outlines with source image, advanced version\r\n\r\nDefines:\r\nGRID_OPTIMIZATION (set or !set)\r\nGRID_DEBUG (set or !set)\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\x3csnippet name\x3d"vsHighlightApply"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n varying vec2 uv;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n attribute vec2 $uv0;\r\n uniform sampler2D coverageTex;\r\n #endif\r\n\r\n void main()\r\n {\r\n #ifdef GRID_OPTIMIZATION\r\n #ifdef GRID_DEBUG\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n // if no highlight pixel set in this block,\r\n // or all pixels set, hide block\r\n if (cov.r \x3d\x3d 0.0 || cov.g \x3d\x3d 1.0 || cov.b \x3d\x3d 1.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n gl_Position \x3d vec4($position, .0, 1.0);\r\n uv \x3d $uv0;\r\n return;\r\n #else\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n // if no highlight pixel set in this block, hide block\r\n if (cov.r \x3d\x3d 0.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n #endif\r\n #endif\r\n\r\n gl_Position \x3d vec4($position, .0, 1.0);\r\n uv \x3d $position.xy * .5 + vec2(.5);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightApply"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform sampler2D origin;\r\n\r\n uniform vec4 color;\r\n uniform float outlineSize;\r\n uniform float blurSize;\r\n uniform vec4 opacities; // [outline, outlineOccluded, fill, fillOccluded]\r\n\r\n varying vec2 uv;\r\n\r\n void main()\r\n {\r\n #if defined(GRID_OPTIMIZATION) \x26\x26 defined(GRID_DEBUG)\r\n gl_FragColor \x3d vec4(uv, 0, 1.0);\r\n #else\r\n // Read the highlight intensity from the blurred highlight image\r\n vec4 blurredHighlightValue \x3d texture2D(tex, uv);\r\n float highlightIntensity \x3d blurredHighlightValue.a;\r\n\r\n // Discard all pixels which are not affected by highlight\r\n if (highlightIntensity \x3d\x3d 0.0) {\r\n discard;\r\n }\r\n\r\n vec4 origin_color \x3d texture2D(origin, uv);\r\n\r\n float outlineIntensity;\r\n float fillIntensity;\r\n\r\n // if occluded\r\n if (blurredHighlightValue.g \x3e blurredHighlightValue.b) {\r\n outlineIntensity \x3d color.w * opacities[1];\r\n fillIntensity \x3d color.w * opacities[3];\r\n }\r\n // if unoccluded\r\n else {\r\n outlineIntensity \x3d color.w * opacities[0];\r\n fillIntensity \x3d color.w * opacities[2];\r\n }\r\n\r\n float inner \x3d 1.0 - outlineSize / 9.0;\r\n float outer \x3d 1.0 - (outlineSize + blurSize) / 9.0;\r\n\r\n float outlineFactor \x3d smoothstep(outer, inner, highlightIntensity);\r\n //float fillFactor \x3d smoothstep(0.6, 0.72, highlightIntensity);\r\n float fillFactor \x3d any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0;\r\n float intensity \x3d outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor;\r\n\r\n // Blending equation: gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\r\n // I.e., color should not be premultiplied with alpha\r\n gl_FragColor \x3d vec4(color.xyz, intensity);\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/occluded.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsRenderOccludedApply"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n varying vec2 uv;\r\n\r\n void main(void) {\r\n gl_Position \x3d vec4($position, 0.0, 1.0);\r\n uv \x3d $position.xy * 0.5 + vec2(0.5);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRenderOccludedApply"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D occludedColorMap;\r\n\r\n varying vec2 uv;\r\n\r\n void main() {\r\n vec4 occludedColor \x3d texture2D(occludedColorMap, uv);\r\n gl_FragColor \x3d occludedColor * vec4(1.0, 1.0, 1.0, 0.4);\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/util.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"alignToPixelCenter"\x3e\x3c![CDATA[\r\n vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {\r\n // From clip space to (0 : 1), bias towards right pixel edge\r\n vec2 xy \x3d vec2(.500123) + .5 * clipCoord.xy / clipCoord.w;\r\n\r\n // Size of a pixel in range (0 : 1)\r\n vec2 pixelSz \x3d vec2(1.0) / widthHeight;\r\n\r\n // Round to nearest pixel center\r\n vec2 ij \x3d (floor(xy * widthHeight) + vec2(0.5)) * pixelSz;\r\n\r\n // Convert back to clip space\r\n vec2 result \x3d (ij * 2.0 - vec2(1.0)) * clipCoord.w;\r\n\r\n return vec4(result, clipCoord.zw);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"alignToPixelOrigin"\x3e\x3c![CDATA[\r\n vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) {\r\n // From clip space to (0 : 1),\r\n vec2 xy \x3d vec2(.5) + .5 * clipCoord.xy / clipCoord.w;\r\n\r\n // Size of a pixel in range (0 : 1)\r\n vec2 pixelSz \x3d vec2(1.0) / widthHeight;\r\n\r\n // Round to nearest pixel border, (0 : 1)\r\n vec2 ij \x3d floor((xy + .5 * pixelSz) * widthHeight) * pixelSz;\r\n\r\n // Convert back to clip space\r\n vec2 result \x3d (ij * 2.0 - vec2(1.0)) * clipCoord.w;\r\n\r\n return vec4(result, clipCoord.zw);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"float2rgba"\x3e\x3c![CDATA[\r\n\tvec4 float2rgba(const in float v) {\r\n\t\tvec4 enc \x3d vec4(1.0, 255.0, 65025.0, 16581375.0) * v;\r\n\t\tenc \x3d fract(enc);\r\n\t\tenc -\x3d enc.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);\r\n\t\treturn enc;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"rgba2float"\x3e\x3c![CDATA[\r\n\tfloat rgba2float(vec4 rgba) {\r\n\t\treturn dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"calcFragDepth"\x3e\x3c![CDATA[\r\n\t#extension GL_OES_standard_derivatives : enable\r\n\r\n\tfloat calcFragDepth(const in float depth) {\r\n\t\t//calc polygon offset\r\n\t\tconst float SLOPE_SCALE \x3d 2.0;\r\n\t\tconst float BIAS \x3d 2.0 * .000015259;\t\t// 1 / (2^16 - 1)\r\n\t\tfloat m \x3d max(abs(dFdx(depth)), abs(dFdy(depth)));\r\n\t\tfloat result \x3d depth + SLOPE_SCALE * m + BIAS;\r\n\t\treturn clamp(result, .0, .999999);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"evalShadow"\x3e\x3c![CDATA[\r\n\t$rgba2float\r\n\r\n\t// "matrix" parameter used to have const qualifier as well, but IE11 couldn\'t deal with it at time of writing.\r\n\t// once IE11 is fine with it, const should probably be re-introduced\r\n\tfloat evalShadow(const in vec3 vpos, const in float depth, const in sampler2D depthTex, const int num, const in vec4 distance, in mat4 matrix[4], const in float halfPxSz) {\r\n\t\t//choose correct cascade\r\n\t\tint i \x3d depth \x3c distance[1] ? 0 : depth \x3c distance[2] ? 1 : depth \x3c distance[3] ? 2 : 3;\r\n\r\n\t\tif (i \x3e\x3d num) return .0;\r\n\r\n\t\tmat4 mat \x3d i \x3d\x3d 0 ? matrix[0] : i \x3d\x3d 1 ? matrix[1] : i \x3d\x3d 2 ? matrix[2] : matrix[3];\r\n\r\n\t\tvec4 lv \x3d mat * vec4(vpos, 1.0);\r\n\t\tlv.xy /\x3d lv.w;\r\n\r\n\t\t//vertex completely outside? -\x3e no shadow\r\n\t\tvec3 lvpos \x3d .5 * lv.xyz + vec3(.5);\r\n\t\tif (lvpos.z \x3e\x3d 1.0) return .0;\r\n\t\tif (lvpos.x \x3c .0 || lvpos.x \x3e 1.0 || lvpos.y \x3c .0 || lvpos.y \x3e 1.0) return .0;\r\n\r\n\t\t//calc coord in cascade texture\r\n\t\tvec2 uv \x3d vec2(float(i - 2 * (i / 2)) *.5, float(i / 2) * .5) + .5 * lvpos.xy;\r\n\r\n\t\tfloat texSize \x3d .5 / halfPxSz;\r\n\r\n\t\t//filter, offset by half pixels\r\n\t\tvec2 st \x3d fract((vec2(halfPxSz) + uv) * texSize);\r\n\r\n\t\tfloat s00 \x3d rgba2float(texture2D(depthTex, uv + vec2(-halfPxSz, -halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s10 \x3d rgba2float(texture2D(depthTex, uv + vec2(halfPxSz, -halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s11 \x3d rgba2float(texture2D(depthTex, uv + vec2(halfPxSz, halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s01 \x3d rgba2float(texture2D(depthTex, uv + vec2(-halfPxSz, halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\r\n\t\treturn mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3c!--\r\n\tScene Lighting Definitions:\r\n\t\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n\r\n\tdefines:\r\n\t\t- SH_ORDER: 1|2|3\r\n\tinput:\r\n\t\t- normal: vec3\r\n\t\t- albedo: vec3\r\n\t - shadow: float\r\n\t\t- ssao: float\r\n\treturn:\r\n\t - color: vec3\r\n--\x3e\r\n\x3csnippet name\x3d"sceneLightingDefinitions"\x3e\x3c![CDATA[\r\n\t$viewingMode\r\n\r\n\t// main light\r\n\t/////////////////////////////////////////\r\n\tuniform vec3 lightingMainDirection;\r\n\tuniform vec3 lightingMainIntensity;\r\n\r\n\t// ambient lighting\r\n\t/////////////////////////////////////////\r\n\t#ifndef SH_ORDER\r\n\t\t#define SH_ORDER 2\r\n\t#endif\r\n\r\n\t#if SH_ORDER \x3d\x3d 0\r\n\t\tuniform vec3 lightingAmbientSH0;\r\n\t#elif SH_ORDER \x3d\x3d 1\r\n\t\tuniform vec4 lightingAmbientSH_R;\r\n\t\tuniform vec4 lightingAmbientSH_G;\r\n\t\tuniform vec4 lightingAmbientSH_B;\r\n\t#elif SH_ORDER \x3d\x3d 2\r\n\t\tuniform vec3 lightingAmbientSH0;\r\n\t\tuniform vec4 lightingAmbientSH_R1;\r\n\t\tuniform vec4 lightingAmbientSH_G1;\r\n\t\tuniform vec4 lightingAmbientSH_B1;\r\n\t\tuniform vec4 lightingAmbientSH_R2;\r\n\t\tuniform vec4 lightingAmbientSH_G2;\r\n\t\tuniform vec4 lightingAmbientSH_B2;\r\n\t#endif\r\n\r\n\t// special tweaking\r\n\t//////////////////////////////////////////\r\n\t\tuniform float lightingFixedFactor;\r\n\t\tuniform float lightingGlobalFactor;\r\n\r\n\t\tuniform float ambientBoostFactor;\r\n\r\n\t// evaluation\r\n\t//////////////////////////////////////////\r\n\r\n\tvec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {\r\n\t\t// evaluate the main light\r\n\t\tfloat dotVal \x3d mix(clamp(-dot(normal, lightingMainDirection), 0.0, 1.0), 1.0, lightingFixedFactor);\r\n\t\tvec3 mainLight \x3d (1.0 - shadow) * lightingMainIntensity * dotVal;\r\n\r\n\t\t// evaluate the sh ambient light\r\n\t\t#if SH_ORDER \x3d\x3d 0\r\n\t\t\tvec3 ambientLight \x3d 0.282095 * lightingAmbientSH0;\r\n\t\t#elif SH_ORDER \x3d\x3d 1\r\n\t\t\tvec4 sh0 \x3d vec4(\r\n\t\t\t\t0.282095,\r\n\t\t\t\t0.488603 * normal.x,\r\n\t\t\t\t0.488603 * normal.z,\r\n\t\t\t\t0.488603 * normal.y\r\n\t\t\t);\r\n\t\t\tvec3 ambientLight \x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R, sh0),\r\n\t\t\t\tdot(lightingAmbientSH_G, sh0),\r\n\t\t\t\tdot(lightingAmbientSH_B, sh0)\r\n\t\t\t);\r\n\t\t#elif SH_ORDER \x3d\x3d 2\r\n\t\t\tvec3 ambientLight \x3d 0.282095 * lightingAmbientSH0;\r\n\r\n\t\t\tvec4 sh1 \x3d vec4(\r\n\t\t\t\t0.488603 * normal.x,\r\n\t\t\t\t0.488603 * normal.z,\r\n\t\t\t\t0.488603 * normal.y,\r\n\t\t\t\t1.092548 * normal.x * normal.y\r\n\t\t\t);\r\n\t\t\tvec4 sh2 \x3d vec4(\r\n\t\t\t\t1.092548 * normal.y * normal.z,\r\n\t\t\t\t0.315392 * (3.0 * normal.z * normal.z - 1.0),\r\n\t\t\t\t1.092548 * normal.x * normal.z,\r\n\t\t\t\t0.546274 * (normal.x * normal.x - normal.y * normal.y)\r\n\t\t\t);\r\n\t\t\tambientLight +\x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R1, sh1),\r\n\t\t\t\tdot(lightingAmbientSH_G1, sh1),\r\n\t\t\t\tdot(lightingAmbientSH_B1, sh1)\r\n\t\t\t);\r\n\t\t\tambientLight +\x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R2, sh2),\r\n\t\t\t\tdot(lightingAmbientSH_G2, sh2),\r\n\t\t\t\tdot(lightingAmbientSH_B2, sh2)\r\n\t\t\t);\r\n\t\t#endif\r\n\t\tambientLight *\x3d (1.0 - ssao);\r\n\r\n\t\t// inverse gamma correction on the albedo color\r\n\t\tfloat gamma \x3d 2.1;\r\n\t\tvec3 albedoGammaC \x3d pow(albedo, vec3(gamma));\r\n\r\n\t\t// physically correct BRDF normalizes by PI\r\n\t\tconst float PI \x3d 3.14159;\r\n\t\tvec3 totalLight \x3d mainLight + ambientLight + additionalLight;\r\n\t\ttotalLight \x3d min(totalLight, vec3(PI, PI, PI));\r\n\t\tvec3 outColor \x3d vec3((albedoGammaC / PI) * (totalLight));\r\n\r\n\t\t// apply gamma correction to the computed color\r\n\t\toutColor \x3d pow(outColor, vec3(1.0/gamma));\r\n\r\n\t\treturn outColor;\r\n\t}\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"sceneLightingAdditionalLightGlobal"\x3e\x3c![CDATA[\r\n\t// heuristic lighting model originally used in the terrain shading\r\n\t// now used to generated additional ambient light\r\n\t#ifdef VIEWING_MODE_GLOBAL\r\n\t\tfloat vndl \x3d -dot(normalize(vpos + localOrigin), lightingMainDirection);\r\n\t#else\r\n\t\tfloat vndl \x3d -dot(vec3(0,0,1), lightingMainDirection);\r\n\t#endif\r\n\tfloat additionalAmbientScale \x3d smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));\r\n\tvec3 additionalLight \x3d ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"normal2envTC"\x3e\x3c![CDATA[\r\n\tvec2 normal2envTC(vec3 normal) {\r\n\t\tfloat v \x3d .5 + .5 * asin(normal.y) * 0.63661977;\r\n\t\tfloat u \x3d .5 - .5 * atan(normal.z, normal.x) * 0.31830988;\r\n\t\treturn vec2(u, v);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderShowDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tattribute vec2 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * vec4($position.x, $position.y, .0, 1.0);\r\n\t\tvtc \x3d $uv0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fragmentShaderShowDepth"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D depthTex;\r\n\tvarying vec2 vtc;\r\n\t$rgba2float\r\n\tvoid main() {\r\n\t//\tgl_FragColor \x3d vec4(vec3(texture2D(depthTex, vtc).a), 1.0);\r\n\t\tgl_FragColor \x3d vec4(rgba2float(texture2D(depthTex, vtc)));\r\n\t//\tgl_FragColor \x3d texture2D(depthTex, vtc);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsUVQuad"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $position;\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d vec4($position.x, $position.y, .0, 1.0);\r\n\t\tuv \x3d $position * .5 + vec2(.5);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"toScreenCoords"\x3e\x3c![CDATA[\r\n\tvec4 toScreenCoords(vec3 vertex) {\r\n\t\tvec4 vClipSpace \x3d proj * view * vec4((model * vec4(vertex, 1.0)).xyz, 1.0);\r\n\t\tvClipSpace.xy *\x3d screenSize;\r\n\t\treturn vClipSpace/abs(vClipSpace.w);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vvUniforms"\x3e\x3c![CDATA[\r\n#if defined(VV_SIZE)\r\n\t#define VV_CUSTOM_MODEL_MATRIX\r\n#endif\r\n\r\n#if defined(VV_SIZE)\r\n\tuniform vec3 vvSizeMinSize;\r\n\tuniform vec3 vvSizeMaxSize;\r\n\tuniform vec3 vvSizeOffset;\r\n\tuniform vec3 vvSizeFactor;\r\n#elif defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tuniform vec3 vvSizeValue;\r\n#endif\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tuniform mat3 vvSymbolRotation;\r\n#endif\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tuniform vec3 vvSymbolAnchor;\r\n#endif\r\n\r\n#ifdef VV_COLOR\r\n\t#define VV_COLOR_N 8\r\n\tuniform float vvColorValues[VV_COLOR_N];\r\n\tuniform vec4 vvColorColors[VV_COLOR_N];\r\n#endif\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vvFunctions"\x3e\x3c![CDATA[\r\n// Evaluation of size\r\n#if defined(VV_SIZE)\r\n\tvec3 vvGetScale(vec4 featureAttribute) {\r\n\t\treturn clamp(vvSizeOffset + featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);\r\n\t}\r\n#elif defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tvec3 vvGetScale(vec4 featureAttribute) {\r\n\t\treturn vvSizeValue;\r\n\t}\r\n#endif\r\n\r\n// Applying the model matrix\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tvec4 vvTransformPosition(vec3 position, vec4 featureAttribute) {\r\n\t\treturn vec4(vvSymbolRotation * (vvGetScale(featureAttribute) * (position + vvSymbolAnchor)), 1.0);\r\n\t}\r\n\r\n\tvec4 vvTransformNormal(vec3 normal, vec4 featureAttribute) {\r\n\t\t// Normal transform is the inverse transpose of model transform\r\n\t\treturn vec4(vvSymbolRotation * normal / vvGetScale(featureAttribute), 1.0);\r\n\t}\r\n#endif\r\n\r\n#ifdef VV_COLOR\r\n\tvec4 vvGetColor(vec4 featureAttribute, float values[VV_COLOR_N], vec4 colors[VV_COLOR_N]) {\r\n\t\tfloat value \x3d featureAttribute.y;\r\n\t\tif (value \x3c\x3d values[0]) {\r\n\t\t\treturn colors[0];\r\n\t\t}\r\n\r\n\t\tfor (int i \x3d 1; i \x3c VV_COLOR_N; ++i) {\r\n\t\t\tif (values[i] \x3e\x3d value) {\r\n\t\t\t\tfloat f \x3d (value - values[i-1]) / (values[i] - values[i-1]);\r\n\t\t\t\treturn mix(colors[i-1], colors[i], f);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn colors[VV_COLOR_N - 1];\r\n\t}\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"rgb2hsv"\x3e\x3c![CDATA[\r\nvec3 rgb2hsv(vec3 c)\r\n{\r\n\tvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\r\n\tvec4 p \x3d mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\r\n\tvec4 q \x3d mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\r\n\r\n\tfloat d \x3d q.x - min(q.w, q.y);\r\n\tfloat e \x3d 1.0e-10;\r\n\treturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"hsv2rgb"\x3e\x3c![CDATA[\r\nvec3 hsv2rgb(vec3 c)\r\n{\r\n\tvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\r\n\tvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\r\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"colorMixMode"\x3e\x3c![CDATA[\r\n$rgb2hsv\r\n$hsv2rgb\r\n\r\n\r\n/*\r\n * The color mix modes are encoded in the symbol color as follows:\r\n * - Fully transparent symbols are represented with alpha 0 for\r\n * all color mix modes (except ignore).\r\n * - color mix mode ignore is encoded as multiply with white\r\n * - the other 3 color mix modes (tint, replace, multiply) are\r\n * equally distributed on the remaining 255 alpha values, which\r\n * gives us 85 possible alpha values\r\n *\r\n * alpha 0 : fully transparent\r\n * alpha in [ 1 - 85]: tint\r\n * alpha in [ 86 - 170]: replace\r\n * alpha in [171 - 255]: multiply\r\n */\r\nvec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {\r\n float symbolAlpha \x3d 0.0;\r\n\r\n const float maxTint \x3d 85.0;\r\n const float maxReplace \x3d 170.0;\r\n const float scaleAlpha \x3d 3.0;\r\n\r\n if (symbolColor.a \x3d\x3d 0.0) {\r\n colorMixMode \x3d 1; // fully transparent -\x3e multiply\r\n symbolAlpha \x3d 0.0;\r\n }\r\n else if (symbolColor.a \x3c\x3d maxTint) {\r\n colorMixMode \x3d 0; // tint\r\n symbolAlpha \x3d scaleAlpha * symbolColor.a;\r\n }\r\n else if (symbolColor.a \x3c\x3d maxReplace) {\r\n colorMixMode \x3d 3; // replace\r\n symbolAlpha \x3d scaleAlpha * (symbolColor.a - maxTint);\r\n }\r\n else {\r\n colorMixMode \x3d 1; // multiply\r\n symbolAlpha \x3d scaleAlpha * (symbolColor.a - maxReplace);\r\n }\r\n\r\n return vec4(symbolColor.rgb, symbolAlpha);\r\n}\r\n\r\nvec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {\r\n\r\n // workaround for artifacts in OSX using Intel Iris Pro\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475\r\n vec3 internalMixed \x3d internalColor * textureColor;\r\n vec3 allMixed \x3d internalMixed * externalColor;\r\n\r\n if (mode \x3d\x3d 1 /* multiply */) {\r\n return allMixed;\r\n }\r\n else if (mode \x3d\x3d 2 /* ignore */ ) {\r\n return internalMixed;\r\n }\r\n else if (mode \x3d\x3d 3 /* replace */ ) {\r\n return externalColor;\r\n }\r\n else {\r\n // tint (or something invalid)\r\n vec3 hsvIn \x3d rgb2hsv(internalMixed);\r\n vec3 hsvTint \x3d rgb2hsv(externalColor);\r\n vec3 hsvOut \x3d vec3(hsvTint.x, hsvTint.y, hsvIn.z * hsvTint.z);\r\n return hsv2rgb(hsvOut);\r\n }\r\n}\r\n\r\nfloat mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {\r\n\r\n // workaround for artifacts in OSX using Intel Iris Pro\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475\r\n float internalMixed \x3d internalOpacity * textureOpacity;\r\n float allMixed \x3d internalMixed * externalOpacity;\r\n\r\n if (mode \x3d\x3d 2 /* ignore */ ) {\r\n return internalMixed;\r\n }\r\n else if (mode \x3d\x3d 3 /* replace */ ) {\r\n return externalOpacity;\r\n }\r\n else {\r\n // multiply or tint (or something invalid)\r\n return allMixed;\r\n }\r\n}\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"highlightWrite"\x3e\x3c![CDATA[\r\n // the following uniforms are common to all highlight shaders:\r\n // uniform sampler2D depthTex\r\n // uniform vec4 highlightViewportPixelSz\r\n float sceneDepth \x3d texture2D(depthTex, (gl_FragCoord.xy - highlightViewportPixelSz.xy) * highlightViewportPixelSz.zw).r;\r\n if (gl_FragCoord.z \x3e sceneDepth + 5e-6) {\r\n gl_FragColor \x3d vec4(1.0, 1.0, 0.0, 1.0);\r\n }\r\n else {\r\n gl_FragColor \x3d vec4(1.0, 0.0, 1.0, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"screenSizePerspective"\x3e\x3c![CDATA[\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n// Note that the implementation here should be kept in sync with the corresponding\r\n// CPU implementation (used for hitTest etc) in screenSizePerspectiveUtils.ts\r\n\r\n/**\r\n * Compute the screen size perspective lower bound from pre-computed screen\r\n * size perspective factors (or parameters, since both store the pixel lower\r\n * bound information in the same place). When computing the minimum size,\r\n * the padding (e.g. text halo) is scaled with the same factor as the\r\n * original size scales to reach the minimum size.\r\n *\r\n * {\r\n * x: N/A\r\n * y: N/A\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nfloat screenSizePerspectiveMinSize(float size, vec4 factor) {\r\n\r\n // Original calculation:\r\n // padding \x3d 2 * factor.w\r\n // minSize \x3d factor.z\r\n //\r\n // minSize + minSize / size * padding\r\n //\r\n // Incorporates padding (factor.w, e.g. text halo size) into the\r\n // minimum bounds calculation, taking into account that padding\r\n // would scale down proportionally to the size.\r\n //\r\n // Calculation below is the same, but avoids division by zero when\r\n // size would be zero, without branching using step.\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10683\r\n\r\n // nonZeroSize is 1 if size \x3e 0, and 0 otherwise\r\n float nonZeroSize \x3d 1.0 - step(size, 0.0);\r\n\r\n return (\r\n factor.z * (\r\n 1.0 +\r\n nonZeroSize * // Multiply by nzs ensures if size is 0, then we ignore\r\n // proportionally scaled padding\r\n 2.0 * factor.w / (\r\n size + (1.0 - nonZeroSize) // Adding 1 - nzs ensures we divide either by size, or by 1\r\n )\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * Computes the view angle dependent screen size perspective factor. The goal\r\n * of this factor is that:\r\n *\r\n * 1. There is no perspective when looking top-down\r\n * 2. There is a smooth and quick transition to full perspective when\r\n * tilting.\r\n */\r\nfloat screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {\r\n return absCosAngle * absCosAngle * absCosAngle;\r\n}\r\n\r\n/**\r\n * Precomputes a set of factors that can be used to apply screen size perspective\r\n * The factors are based on the viewing angle, distance to camera and the screen size\r\n * perspective parameters:\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n *\r\n * The result is a set of factors that can be used to apply the perspective:\r\n *\r\n * {\r\n * x: distance based relative scale factor (0 -\x3e 1)\r\n * y: view dependent scale factor\r\n * z: minPixelSize (abs)\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nvec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {\r\n return vec4(min(params.x / (distanceToCamera - params.y), 1.0), screenSizePerspectiveViewAngleDependentFactor(absCosAngle), params.z, params.w);\r\n}\r\n\r\n/**\r\n * Applies screen size perspective factors to a single dimension size, given the viewing angle,\r\n * distance to camera and perspective parameters. The factors can be calculated from the screen size\r\n * perspective parameters using screenSizePerspectiveScaleFactorFloat.\r\n *\r\n * Note that for single scale application, the screenSizePerspectiveScaleFloat can be used, which\r\n * will call this method, providing it the factors calculated from screenSizePerspectiveScaleFactorFloat.\r\n */\r\n\r\nfloat applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {\r\n return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));\r\n}\r\n\r\n/**\r\n * Applies screen size perspective parameters to a single dimension size, given the viewing angle,\r\n * distance to camera and perspective parameters\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nfloat screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {\r\n return applyScreenSizePerspectiveScaleFactorFloat(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\r\n}\r\n\r\n/**\r\n * Applies screen size perspective factors to a vec2 size (width/height), given the viewing angle,\r\n * distance to camera and perspective parameters. The factors can be calculated from the screen size\r\n * perspective parameters using screenSizePerspectiveScaleFactorVec2.\r\n *\r\n * Note that for single scale application, the screenSizePerspectiveScaleVec2 can be used, which\r\n * will call this method, providing it the factors calculated from screenSizePerspectiveScaleFactorVec2.\r\n */\r\nvec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {\r\n return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / size.y, 1.0), size, factor.y);\r\n}\r\n\r\n/**\r\n * Applies screen size perspective parameters to a vec2 size (width/height), given the viewing angle,\r\n * distance to camera and perspective parameters\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nvec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {\r\n return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\r\n}\r\n\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"computeNormal"\x3e\x3c![CDATA[\r\n\t#ifdef GROUND_NORMAL_SHADING\r\n\t\t#ifdef VIEWING_MODE_GLOBAL\r\n\t\t\tvec3 normal \x3d normalize(vpos + localOrigin);\r\n\t\t#else\r\n\t\t\tvec3 normal \x3d vec3(0,0,1);\r\n\t\t#endif\r\n\t#else\r\n\t\t\t// compute normal\r\n\t\t#ifndef DOUBLESIDED\r\n\t\t\t\tvec3 normal \x3d vnormal;\r\n\t\t#else\r\n\t\t\t\tvec3 normal \x3d dot(vnormal, viewDir)\x3e0.0 ? -vnormal : vnormal;\r\n\t\t#endif\r\n\t\tnormal \x3d normalize(normal);\r\n\t#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/hud.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"commonAttributesAndUniformsHUD"\x3e\x3c![CDATA[\r\n attribute vec3 $position;\r\n attribute vec3 $normal;\r\n attribute vec4 $auxpos1;\r\n\r\n uniform mat4 proj;\r\n\r\n uniform mat4 view;\r\n uniform mat4 viewNormal;\r\n\r\n uniform mat4 model;\r\n uniform mat4 modelNormal;\r\n\r\n uniform vec4 viewport;\r\n\r\n uniform vec3 camPos;\r\n\r\n uniform float polygonOffset;\r\n uniform float cameraGroundRelative;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\r\n // [ screenLength, distanceFactor, minWorldLength, maxWorldLength ]\r\n uniform vec4 verticalOffset;\r\n\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n // [ divisor, offset, minPixelSize, paddingPixels ]\r\n uniform vec4 screenSizePerspectiveAlignment;\r\n\r\n#endif\r\n\r\n uniform sampler2D hudVisibilityTexture;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"projectPositionHUD"\x3e\x3c![CDATA[\r\n $screenSizePerspective\r\n\r\n // Corresponds to cos(10 deg), used to compare against dot product of two vectors\r\n const float SMALL_OFFSET_ANGLE \x3d 0.984807753012208;\r\n\r\n struct ProjectHUDAux {\r\n vec3 posModel;\r\n vec3 posView;\r\n vec3 vnormal;\r\n\r\n float distanceToCamera;\r\n float absCosAngle;\r\n };\r\n\r\n\r\n /**\r\n * Apply the simulated polygon offset for HUD objects that improves\r\n * issues with Z-fighting.\r\n *\r\n * @param posView {vec3} (inout) the position in view space. Will be modified in place.\r\n * @param pointGroundDistance {float} the distance from the point geometry to the ground surface.\r\n * @param absCosAngle {float} the absolute cosine of the angle between the world-up at the point geometry\r\n * and the view direction.\r\n *\r\n * Dependencies:\r\n *\r\n * Attributes:\r\n * - auxpos1: contains centerOffset and pointGroundDistance\r\n *\r\n * Uniforms:\r\n * - cameraGroundRelative: indicates whether camera is above (1) or below (-1) ground.\r\n * This is used for emulated polygon offset for improved visibility of points sitting on the surface.\r\n * - polygonOffset: a constant polygon offset to bring the point closer to the viewer for\r\n * reduced flickering.\r\n * - viewport: the viewport [x, y, width, height]\r\n */\r\n float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) {\r\n float pointGroundSign \x3d sign(pointGroundDistance);\r\n\r\n if (pointGroundSign \x3d\x3d 0.0) {\r\n pointGroundSign \x3d 1.0;\r\n }\r\n\r\n // cameraGroundRelative is -1 if camera is below ground, 1 if above ground\r\n // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise\r\n float groundRelative \x3d cameraGroundRelative * pointGroundSign;\r\n\r\n // view angle dependent part of polygon offset emulation\r\n // we take the absolute value because the sign that is dropped is\r\n // instead introduced using the ground-relative position of the symbol and the camera\r\n if (polygonOffset \x3e .0) {\r\n float cosAlpha \x3d clamp(absCosAngle, 0.01, 1.0);\r\n\r\n float tanAlpha \x3d sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha;\r\n float factor \x3d (1.0 - tanAlpha / viewport[2]);\r\n\r\n // same side of the terrain\r\n if (groundRelative \x3e 0.0) {\r\n posView *\x3d factor;\r\n }\r\n // opposite sides of the terrain\r\n else {\r\n posView /\x3d factor;\r\n }\r\n }\r\n\r\n return groundRelative;\r\n }\r\n\r\n /**\r\n * Project the 3d position of a HUD object from world space to clip space. In addition\r\n * to standard model view projection, it also emulates a polygon offset to\r\n * help with points above/below ground and icon flickering. The resulting location\r\n * is the anchor of the HUD object, i.e. the position that is used also for testing\r\n * visibility of the HUD object. Note that the returned projected position is not\r\n * aligned to a pixel center or border, it is up to the caller to align if necessary.\r\n *\r\n * Dependencies:\r\n *\r\n * Attributes:\r\n * - position: contains the point world position\r\n * - normal: contains the world normal pointing up at the point\r\n * - auxpos1: contains centerOffset and pointGroundDistance\r\n *\r\n * Uniforms:\r\n * - model: the object -\x3e world transformation matrix\r\n * - modelNormal: the object -\x3e world normal transformation matrix (inv transp of model)\r\n * - view: the world -\x3e view transformation matrix\r\n * - viewNormal: the world -\x3e view normal transformation matrix (inv transp of view)\r\n * - proj: the view -\x3e clip projection matrix\r\n * - verticalOffset: a vec4 containing:\r\n * - the screen height of the vertical offset\r\n * - the screen height of the vertical offset as a fraction of camera distance.\r\n * - the minimum world size vertical offset.\r\n * - the maximum world size vertical offset.\r\n * This will do a screen sized offset of the point along its normal (used for line callouts)\r\n * - screenSizePerspectiveAlignment: a vec3 containing\r\n * - the view distance dependent divisor\r\n * - the view distance dependent offset\r\n * - the minimum pixel size\r\n * - the amount of padding in pixels around the region to be scaled (not used for alignment)\r\n * - cameraGroundRelative: indicates whether camera is above (1) or below (-1) ground.\r\n * This is used for emulated polygon offset for improved visibility of points sitting on the surface.\r\n * - polygonOffset: a constant polygon offset to bring the point closer to the viewer for\r\n * reduced flickering.\r\n * - camPos: the position of the camera in world space\r\n * - viewport: the viewport [x, y, width, height]\r\n */\r\n vec4 projectPositionHUD(out ProjectHUDAux aux) {\r\n // centerOffset is in view space and is used to implement world size offsetting\r\n // of labels with respect to objects. It also pulls the label towards the viewer\r\n // so that the label is visible in front of the object.\r\n vec3 centerOffset \x3d $auxpos1.xyz;\r\n\r\n // The pointGroundDistance is the distance of the geometry to the ground and is\r\n // negative if the point is below the ground, or positive if the point is above\r\n // ground.\r\n float pointGroundDistance \x3d $auxpos1.w;\r\n\r\n aux.posModel \x3d (model * vec4($position, 1.0)).xyz;\r\n aux.posView \x3d (view * vec4(aux.posModel, 1.0)).xyz;\r\n aux.vnormal \x3d (modelNormal * vec4($normal, 1.0)).xyz;\r\n\r\n // Screen sized offset in world space, used for example for line callouts\r\n // Note: keep this implementation in sync with the CPU implementation, see\r\n // - MaterialUtil.verticalOffsetAtDistance\r\n // - HUDMaterial.applyVerticalOffsetTransformation\r\n\r\n aux.distanceToCamera \x3d length(aux.posView);\r\n\r\n vec3 viewDirObjSpace \x3d normalize(camPos - aux.posModel);\r\n float cosAngle \x3d dot(aux.vnormal, viewDirObjSpace);\r\n\r\n aux.absCosAngle \x3d abs(cosAngle);\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n#if defined(VERTICAL_OFFSET) || defined(CENTER_OFFSET_UNITS_SCREEN)\r\n vec4 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);\r\n#endif\r\n\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float verticalOffsetScreenHeight \x3d applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);\r\n#else\r\n float verticalOffsetScreenHeight \x3d verticalOffset.x;\r\n#endif\r\n\r\n float worldOffset \x3d clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w);\r\n vec3 modelOffset \x3d aux.vnormal * worldOffset;\r\n\r\n aux.posModel +\x3d modelOffset;\r\n\r\n vec3 viewOffset \x3d (viewNormal * vec4(modelOffset, 1.0)).xyz;\r\n aux.posView +\x3d viewOffset;\r\n\r\n // Since we elevate the object, we need to take that into account\r\n // in the distance to ground\r\n pointGroundDistance +\x3d worldOffset;\r\n\r\n#endif\r\n\r\n float groundRelative \x3d applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView);\r\n\r\n#ifndef CENTER_OFFSET_UNITS_SCREEN\r\n // Apply x/y in view space, but z in screen space (i.e. along posView direction)\r\n aux.posView +\x3d vec3(centerOffset.x, centerOffset.y, 0);\r\n\r\n // Same material all have same z !\x3d 0.0 condition so should not lead to\r\n // branch fragmentation and will save a normalization if it\'s not needed\r\n if (centerOffset.z !\x3d 0.0) {\r\n aux.posView -\x3d normalize(aux.posView) * centerOffset.z;\r\n }\r\n#endif\r\n\r\n vec4 posProj \x3d proj * vec4(aux.posView, 1.0);\r\n\r\n#ifdef CENTER_OFFSET_UNITS_SCREEN\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float centerOffsetY \x3d applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);\r\n#else\r\n float centerOffsetY \x3d centerOffset.y;\r\n#endif\r\n\r\n posProj.xy +\x3d vec2(centerOffset.x, centerOffsetY) * 2.0 / viewport.zw * posProj.w;\r\n\r\n#endif\r\n\r\n // constant part of polygon offset emulation\r\n posProj.z -\x3d groundRelative * polygonOffset * posProj.w;\r\n\r\n return posProj;\r\n }\r\n\r\n /**\r\n * Test for visibility of a HUD object.\r\n *\r\n * Dependencies:\r\n *\r\n * Uniforms:\r\n * - hudVisibilityTexture: the texture that contains the visibility information\r\n * - markerColor: the special marker color that is used to write visibility information\r\n * - viewport: the viewport\r\n */\r\n bool testVisibilityHUD(vec4 posProj) {\r\n // For occlusion testing, use the nearest pixel center to avoid\r\n // subpixel filtering messing up the color we use to test for\r\n vec4 posProjCenter \x3d alignToPixelCenter(posProj, viewport.zw);\r\n\r\n return texture2D(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w).r \x3e 0.0;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/BillboardMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderBillboard"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n\tattribute vec3 $position;\r\n\tattribute vec3 $normal;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\tvarying vec3 vnormal;\r\n\tconst float size \x3d 1.05;\r\n\r\n\tvoid main(void) {\r\n\t\tvec3 pos \x3d (view * model * vec4($position, 1.0)).xyz;\r\n\t\tvec2 uv01 \x3d floor($uv0);\r\n\t\tvec2 uv \x3d $uv0 - uv01;\r\n\t\tvec3 zDir \x3d normalize(-pos);\r\n\t\tvec3 xDir \x3d normalize(cross(vec3(.0, 1.0, .0), zDir));\r\n\t\tvec3 yDir \x3d cross(zDir, xDir);\r\n\t\tpos +\x3d xDir * (uv01.x - .5) * size;\r\n\t\tpos +\x3d yDir * (uv01.y - .5) * size;\r\n\t\tvec4 pos4 \x3d proj * vec4(pos, 1.0);\r\n\t\tgl_Position \x3d pos4;\r\n\t\tvtc \x3d uv;\r\n\t\tvnormal \x3d normalize((modelNormal * vec4($normal, 1.0)).xyz);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderBillboard"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec4 lightAmbient;\r\n\tuniform vec4 lightDiffuse;\r\n\tuniform vec3 lightDirection;\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\tvarying vec3 vnormal;\r\n\r\n\tvoid main() {\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tif (texColor.a \x3c .15) discard;\r\n\t\tgl_FragColor \x3d texColor;\r\n\t\tgl_FragColor.rgb *\x3d lightAmbient.rgb * lightAmbient.w + lightDiffuse.rgb * lightDiffuse.w * dot(lightDirection, vnormal);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderBillboardDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tuniform vec2 nearFar;\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\tvarying float depth;\r\n\tconst float size \x3d 1.05;\r\n\r\n\tvoid main(void) {\r\n\t\tvec3 pos \x3d (view * model * vec4($position, 1.0)).xyz;\r\n\t\tvec2 uv01 \x3d floor($uv0);\r\n\t\tvec2 uv \x3d $uv0 - uv01;\r\n\t\tpos.x +\x3d (uv01.x - .5) * size;\r\n\t\tpos.y +\x3d (uv01.y - .5) * size;\r\n\t\tvec4 eye \x3d vec4(pos, 1.0);\r\n\t\tgl_Position \x3d proj * eye;\r\n\t\tdepth \x3d (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]);\r\n\t\tvtc \x3d uv;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/ColorMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderColorMaterial"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\r\n\tattribute vec3 $position;\r\n#ifdef VERTEXCOLORS\r\n\tattribute vec4 $color;\r\n\r\n\tvarying vec4 vColor;\r\n#endif\r\n\r\n\tvoid main(void) {\r\n#ifdef VERTEXCOLORS\r\n\t\tvColor \x3d $color * 0.003921568627451; // \x3d 1/255;\r\n#endif\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4($position, 1.0)).xyz, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderColorMaterial"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec4 eColor;\r\n#ifdef VERTEXCOLORS\r\n\tvarying vec4 vColor;\r\n#endif\r\n\r\n\tvoid main() {\r\n#ifdef VERTEXCOLORS\r\n\t\tgl_FragColor \x3d vColor * eColor;\r\n#else\r\n\t\tgl_FragColor \x3d eColor;\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/LineCalloutMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderLineCallout"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n attribute vec2 $uv0;\r\n\r\n uniform float lineSize;\r\n uniform vec2 pixelToNDC;\r\n uniform float borderSize;\r\n uniform vec2 screenOffset;\r\n\r\n varying vec4 coverageSampling;\r\n varying vec2 lineSizes;\r\n\r\n $alignToPixelOrigin\r\n $alignToPixelCenter\r\n\r\n $projectPositionHUD\r\n\r\n void main(void) {\r\n ProjectHUDAux projectAux;\r\n vec4 endPoint \x3d projectPositionHUD(projectAux);\r\n\r\n#ifdef OCCL_TEST\r\n if (!testVisibilityHUD(endPoint)) {\r\n gl_Position \x3d vec4(1e38, 1e38, 1e38, 1);\r\n }\r\n else {\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n vec4 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);\r\n vec2 screenOffsetScaled \x3d applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor);\r\n#else\r\n vec2 screenOffsetScaled \x3d screenOffset;\r\n#endif\r\n\r\n // Add view dependent polygon offset to get exact same original starting point. This is mostly\r\n // used to get the correct depth value\r\n vec3 posView \x3d (view * model * vec4($position, 1.0)).xyz;\r\n applyHUDViewDependentPolygonOffset($auxpos1.w, projectAux.absCosAngle, posView);\r\n\r\n vec4 startPoint \x3d proj * vec4(posView, 1);\r\n\r\n // Apply screen offset to both start and end point\r\n vec2 screenOffsetNorm \x3d screenOffsetScaled * 2.0 / viewport.zw;\r\n\r\n startPoint.xy +\x3d screenOffsetNorm * startPoint.w;\r\n endPoint.xy +\x3d screenOffsetNorm * endPoint.w;\r\n\r\n // Align start and end to pixel origin\r\n vec4 startAligned \x3d alignToPixelOrigin(startPoint, viewport.zw);\r\n vec4 endAligned \x3d alignToPixelOrigin(endPoint, viewport.zw);\r\n\r\n#ifdef DEPTH_HUD\r\n\r\n#ifdef DEPTH_HUD_ALIGN_START\r\n endAligned \x3d vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);\r\n#else\r\n startAligned \x3d vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);\r\n#endif\r\n\r\n#endif\r\n\r\n vec4 projectedPosition \x3d mix(startAligned, endAligned, $uv0.y);\r\n\r\n // The direction of the line in screen space\r\n vec2 screenSpaceDirection \x3d normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w);\r\n vec2 perpendicularScreenSpaceDirection \x3d vec2(screenSpaceDirection.y, -screenSpaceDirection.x);\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n float lineSizeScaled \x3d applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor);\r\n float borderSizeScaled \x3d applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor);\r\n\r\n#else\r\n\r\n float lineSizeScaled \x3d lineSize;\r\n float borderSizeScaled \x3d borderSize;\r\n\r\n#endif\r\n\r\n float halfPixelSize \x3d lineSizeScaled * 0.5;\r\n\r\n // Calculate a pixel offset from the edge of the pixel, s.t. we keep the line aligned\r\n // to pixels if it has a full pixel size. Since pixel aligned biases to the bottom-left,\r\n // we bias the size to the right (for odd sizes) to balance out the bias. Grow sub-pixel\r\n // sizes towards the left or right s.t. there is a smooth transition (e.g. from 2 to 3 px).\r\n float halfWholePixelSize \x3d floor(lineSizeScaled) * 0.5;\r\n float halfPixelSizeInt \x3d floor(halfWholePixelSize);\r\n\r\n // Sub-pixel offset if we need to grow sub-pixels to the left\r\n float subpixelOffset \x3d -fract(lineSizeScaled) * float(halfWholePixelSize \x3e 0.0);\r\n\r\n // Pixel offset aligning to whole pixels and adding subpixel offset if needed\r\n float pixelOffset \x3d -halfPixelSizeInt + subpixelOffset;\r\n\r\n // Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size\r\n float padding \x3d 1.0 + borderSizeScaled;\r\n vec2 ndcOffset \x3d (pixelOffset - padding + $uv0 * (lineSizeScaled + padding + padding)) * pixelToNDC;\r\n\r\n // Offset x/y from the center of the line in screen space\r\n projectedPosition.xy +\x3d perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w;\r\n\r\n // Compute a coverage varying which we can use in the fragment shader to determine\r\n // how much a pixel is actually covered by the line (i.e. to anti alias the line).\r\n // This works by computing two coordinates that can be linearly interpolated and then\r\n // subtracted to find out how far away from the line edge we are.\r\n float edgeDirection \x3d ($uv0.x * 2.0 - 1.0);\r\n\r\n float halfBorderSize \x3d 0.5 * borderSizeScaled;\r\n float halfPixelSizeAndBorder \x3d halfPixelSize + halfBorderSize;\r\n float outerEdgeCoverageSampler \x3d edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0);\r\n\r\n float isOneSided \x3d float(lineSizeScaled \x3c 2.0 \x26\x26 borderSize \x3c 2.0);\r\n\r\n coverageSampling \x3d vec4(\r\n // Edge coordinate\r\n outerEdgeCoverageSampler,\r\n\r\n // Border edge coordinate\r\n outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided,\r\n\r\n // Line offset\r\n halfPixelSize - 0.5,\r\n\r\n // Border offset\r\n halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided)\r\n );\r\n\r\n lineSizes \x3d vec2(lineSizeScaled, borderSizeScaled);\r\n\r\n gl_Position \x3d projectedPosition;\r\n\r\n#ifdef OCCL_TEST\r\n }\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet\x3e\x3c![CDATA[\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderLineCallout"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform vec4 color;\r\n uniform vec4 borderColor;\r\n\r\n varying vec4 coverageSampling;\r\n varying vec2 lineSizes;\r\n\r\n void main() {\r\n // Mix between line and border coverage offsets depending on whether we need\r\n // a border (based on the sidedness).\r\n vec2 coverage \x3d min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes);\r\n\r\n // Mix between border and line color based on the line coverage (conceptually the line\r\n // blends on top of the border background).\r\n //\r\n // Anti-alias by blending final result using the full (including optional border) coverage\r\n // and the color alpha\r\n float borderAlpha \x3d color.a * borderColor.a * coverage.y;\r\n float colorAlpha \x3d color.a * coverage.x;\r\n\r\n float finalAlpha \x3d mix(borderAlpha, 1.0, colorAlpha);\r\n\r\n#ifdef DEPTH_HUD\r\n\r\n if (finalAlpha \x3c 0.01) {\r\n discard;\r\n }\r\n\r\n#else\r\n\r\n // Compute the finalRgb, but keep it pre-multiplied (for unpre-multiplied you\r\n // need to divide by finalAlpha). We avoid the division here by setting the\r\n // appropriate blending function in the material.\r\n vec3 finalRgb \x3d mix(borderColor.rgb * borderAlpha, color.rgb, colorAlpha);\r\n\r\n gl_FragColor \x3d vec4(finalRgb, finalAlpha);\r\n\r\n#endif\r\n\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/LeafCardMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderLeafCard"\x3e\r\n\t\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n\r\n\tuniform vec3 localOrigin;\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec4 $normal;\r\n\tattribute vec4 $uv0;\r\n\tvarying vec2 vtc;\r\n\tvarying vec3 vnormal;\r\n\tvarying float ambientLeaf;\r\n\r\n\tuniform float trafoScale;\r\n\tvarying vec3 vpos;\r\n\r\n\tvec2 rotate(vec2 pos, float angle) {\r\n\t\tfloat c \x3d cos(angle);\r\n\t\tfloat s \x3d sin(angle);\r\n\t\treturn vec2(c * pos.x - s * pos.y, s * pos.x + c * pos.y);\r\n\t}\r\n\r\n\tvoid main(void) {\r\n\r\n\t\tvpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\r\n\t\tvec3 pos \x3d (view * model * vec4($position, 1.0)).xyz;\r\n\t\tvec2 uv01 \x3d floor($uv0.xy);\r\n\t\tvec2 uv \x3d $uv0.xy - uv01;\r\n\r\n \t\tvec2 up \x3d rotate(vec2(1,0), $uv0.z);\r\n \t\tvec3 xDir \x3d vec3(up.x,up.y,0.0);\r\n \t\tvec3 yDir \x3d vec3(-up.y,up.x,0.0);\r\n\r\n\t\tpos +\x3d xDir * (uv01.x - .5) * $uv0.w *trafoScale;\r\n\t\tpos +\x3d yDir * (uv01.y - .5) * $uv0.w *trafoScale;;\r\n\t\tvec4 pos4 \x3d proj * vec4(pos, 1.0);\r\n\t\tgl_Position \x3d pos4;\r\n\t\tvtc \x3d uv;\r\n\t\tambientLeaf \x3d normal.w;\r\n\t\tvnormal \x3d normalize((modelNormal * vec4($normal.xyz, 1.0)).xyz);\r\n\t}\r\n]]\x3e\r\n\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderLeafCard"\x3e\r\n\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec3 camPos;\r\n\r\n\tuniform vec3 diffuse;\r\n\r\n\tuniform vec3 localOrigin;\r\n\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\tvarying vec3 vnormal;\r\n\tvarying float ambientLeaf;\r\n\r\n\tvarying vec3 vpos;\r\n\r\n\t$sceneLightingDefinitions\r\n\r\n\tvoid main() {\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\r\n\t\tvec3 normal \x3d normalize(vnormal);\r\n\t\tvec3 albedo \x3d diffuse * ambientLeaf * texColor.rgb;\r\n\r\n\t\tfloat ssao \x3d 1.0;\r\n\r\n\t\t$sceneLightingAdditionalLightGlobal\r\n\r\n\t\tvec3 color \x3d evaluateSceneLighting(normal, albedo, 1.0, 1.0 - ssao, additionalLight);\r\n\r\n\t\tgl_FragColor \x3d vec4(color, texColor.a);\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"vertexShaderLeafCardDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n \tuniform mat4 proj;\r\n \tuniform mat4 view;\r\n \tuniform mat4 model;\r\n \tuniform vec2 nearFar;\r\n\r\n \tattribute vec3 $position;\r\n \tattribute vec4 $uv0;\r\n\r\n \tuniform float trafoScale;\r\n\r\n \tvarying vec2 vtc;\r\n \tvarying float depth;\r\n\r\n \tvec2 rotate(vec2 pos, float angle) {\r\n \t\tfloat c \x3d cos(angle);\r\n \t\tfloat s \x3d sin(angle);\r\n \t\treturn vec2(c * pos.x - s * pos.y, s * pos.x + c * pos.y);\r\n \t}\r\n\r\n \tvoid main(void) {\r\n \t\tvec3 pos \x3d (view * model * vec4($position, 1.0)).xyz;\r\n \t\tvec2 uv01 \x3d floor($uv0.xy);\r\n \t\tvec2 uv \x3d $uv0.xy - uv01;\r\n\r\n \t\tvec2 up \x3d rotate(vec2(1,0), $uv0.z);\r\n \t\tvec3 xDir \x3d vec3(up.x,up.y,0.0);\r\n \t\tvec3 yDir \x3d vec3(-up.y,up.x,0.0);\r\n\r\n \t\tpos +\x3d xDir * (uv01.x - .5) * $uv0.w*trafoScale;\r\n \t\tpos +\x3d yDir * (uv01.y - .5) * $uv0.w*trafoScale;\r\n \t\tvec4 pos4 \x3d proj * vec4(pos, 1.0);\r\n \t\tgl_Position \x3d pos4;\r\n \t\tvtc \x3d uv;\r\n\r\n \t\tdepth \x3d (-pos.z - nearFar[0]) / (nearFar[1] - nearFar[0]);\r\n\r\n \t}\r\n ]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/Material.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"calculateVerticalOffset"\x3e\x3c![CDATA[\r\n $viewingMode\r\n\r\n#ifdef VERTICAL_OFFSET\r\n // [ verticalOffsetPerDistance, minWorldLength, maxWorldLength ]\r\n uniform vec4 verticalOffset;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n uniform vec4 screenSizePerspectiveAlignment;\r\n\r\n $screenSizePerspective\r\n\r\n#endif\r\n\r\n vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {\r\n float viewDistance \x3d length((view * vec4(worldPos, 1)).xyz);\r\n float verticalOffsetOffsetDistance \x3d verticalOffset.x * viewDistance;\r\n\r\n#ifdef VIEWING_MODE_GLOBAL\r\n vec3 worldNormal \x3d normalize(worldPos + localOrigin);\r\n#else\r\n vec3 worldNormal \x3d vec3(0, 0, 1);\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float cosAngle \x3d dot(worldNormal, normalize(worldPos - camPos));\r\n\r\n float verticalOffsetScreenHeight \x3d screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);\r\n#else\r\n float verticalOffsetScreenHeight \x3d verticalOffset.x;\r\n#endif\r\n\r\n // Screen sized offset in world space, used for example for line callouts\r\n float worldOffset \x3d clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);\r\n\r\n return worldNormal * worldOffset;\r\n }\r\n#endif\r\n]]\x3e\r\n\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n\r\n\tuniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n attribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n#endif\r\n#ifdef INSTANCEDCOLOR\r\n\tattribute vec4 instanceColor;\r\n#endif\r\n\tattribute vec3 $position;\r\n\tattribute vec3 $normal;\r\n\tvarying vec3 vpos;\r\n\tvarying vec3 vnormal;\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n#endif\r\n\r\n#ifdef VERTEXCOLORS\r\n\tattribute vec4 $color;\r\n#endif\r\n\r\n#ifdef SYMBOLVERTEXCOLORS\r\n attribute vec4 $symbolColor;\r\n#endif\r\n\r\n#if defined(VV_SIZE) || defined(VV_COLOR)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\r\n$vvUniforms\r\n\r\n#if defined(VERTEXCOLORS)\r\n\tvarying vec4 vcolor;\r\n#endif\r\n\r\n#if defined(INSTANCEDCOLOR) || defined(VV_COLOR) || defined(SYMBOLVERTEXCOLORS)\r\n\tuniform vec4 externalColor;\r\n\tvarying vec4 vcolorExt;\r\n#endif\r\n\r\n#if defined(SYMBOLVERTEXCOLORS)\r\n\tvarying mediump float colorMixMode; // varying int is not supported in WebGL\r\n#endif\r\n\r\n\t$vvFunctions\r\n\r\n\t$colorMixMode\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n\t\tvpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\t\tvnormal \x3d normalize((modelNormal * vvTransformNormal($normal, instanceFeatureAttribute)).xyz);\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n\t\tvpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\t\tvnormal \x3d normalize((modelNormal * vec4($normal, 1.0)).xyz);\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n\t\tgl_Position \x3d proj * view * vec4(vpos, 1.0);\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\t\t// Shadowmap\'s cascading index used to be based on \'1.0 / gl_FragCoord.w\'\r\n\t\t// (i.e. the perspective interpolation of \'gl_Position.w\'). Precision\r\n\t\t// issues on iPad/iPhone with the \'w\' component require the depth to be\r\n\t\t// passed as varying to properly drive the cascading shadow map index.\r\n\t\tlinearDepth \x3d gl_Position.w;\r\n#endif\r\n\r\n#ifdef VERTEXCOLORS\r\n\t\tvcolor \x3d $color * 0.003921568627451; // \x3d 1/255\r\n#endif\r\n\r\n#if defined(INSTANCEDCOLOR) || defined(VV_COLOR) || defined(SYMBOLVERTEXCOLORS)\r\n\t\tvcolorExt \x3d externalColor;\r\n#endif\r\n#ifdef INSTANCEDCOLOR\r\n\t\tvcolorExt *\x3d instanceColor;\r\n#endif\r\n#ifdef VV_COLOR\r\n\t\tvcolorExt *\x3d vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);\r\n#endif\r\n#ifdef SYMBOLVERTEXCOLORS\r\n int symbolColorMixMode;\r\n vcolorExt *\x3d decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; // \x3d 1/255;\r\n colorMixMode \x3d float(symbolColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongSrc"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tuniform vec3 camPos;\r\n\tuniform vec3 localOrigin;\r\n\r\n\t$sceneLightingDefinitions\r\n\r\n\t// material parameters\r\n\t//////////////////////////////////////////\r\n\tuniform vec3 ambient;\r\n\tuniform vec3 diffuse;\r\n\tuniform vec3 specular;\r\n\tuniform float shininess;\r\n\tuniform float opacity;\r\n\tuniform float layerOpacity;\r\n\r\n#ifdef SYMBOLVERTEXCOLORS\r\n\tvarying mediump float colorMixMode; // varying int is not supported in WebGL\r\n#else\r\n uniform int colorMixMode;\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tuniform sampler2D depthTex;\r\n\tuniform int shadowMapNum;\r\n\tuniform vec4 shadowMapDistance;\r\n\tuniform mat4 shadowMapMatrix[4];\r\n\tuniform float depthHalfPixelSz;\r\n#endif\r\n\r\n#ifdef RECEIVE_SSAO\r\n\tuniform sampler2D ssaoTex;\r\n\tuniform vec4 viewportPixelSz;\r\n#endif\r\n\r\n\r\n\tvarying vec3 vpos;\r\n\tvarying vec3 vnormal;\r\n#if defined(VERTEXCOLORS)\r\n\tvarying vec4 vcolor;\r\n#endif\r\n#if defined(INSTANCEDCOLOR) || defined(VV_COLOR) || defined(SYMBOLVERTEXCOLORS)\r\n\tvarying vec4 vcolorExt;\r\n#else\r\n\tuniform vec4 externalColor;\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n\t$evalShadow\r\n#endif\r\n\r\n\t$colorMixMode\r\n\r\n\tvoid main() {\r\n\t\tvec3 viewDir \x3d normalize(vpos - camPos);\r\n\r\n\t\t$computeNormal\r\n\r\n\t\tvec3 reflDir \x3d normalize(reflect(viewDir, normal));\r\n\r\n\t\t// compute ssao\r\n\t\t#ifdef RECEIVE_SSAO\r\n\t\t\t\tfloat ssao \x3d texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;\r\n\t\t\t\tssao \x3d viewportPixelSz.z \x3c 0.0 ? 1.0 : ssao;\r\n\t\t#else\r\n\t\t\t\tfloat ssao \x3d 1.0;\r\n\t\t#endif\r\n\r\n\t\t// At global scale we create some additional ambient light based on the main light to simulate global illumination\r\n\t\t// This also defines "additionalAmbientScale" which might be used as a shadow fallback further down\r\n\t\t$sceneLightingAdditionalLightGlobal\r\n\r\n\t\t// compute shadowing\r\n\t\tfloat shadow \x3d 0.0;\r\n\t\t#ifdef RECEIVE_SHADOWS\r\n\t\t\tshadow \x3d evalShadow(vpos, linearDepth, depthTex, shadowMapNum, shadowMapDistance, shadowMapMatrix, depthHalfPixelSz);\r\n\t\t#elif defined(VIEWING_MODE_GLOBAL)\r\n\t\t\t// at global scale (and in global scenes) we fall back to this approximation\r\n\t\t\t// to shadow objects on the dark side of the earth\r\n\t\t\tshadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);\r\n\t\t#endif\r\n\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"externalColorMix"\x3e\x3c![CDATA[\r\n\tvec3 matColor \x3d max(ambient, diffuse); // combine the old material parameters into a single one\r\n\t#if defined(VERTEXCOLORS) \x26\x26 (defined(INSTANCEDCOLOR) || defined(VV_COLOR) || defined(SYMBOLVERTEXCOLORS))\r\n\t\t\t// Internal colors: varying vcolor + uniform ambient/diffuse, external colors: varying vcolorExt\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(vcolor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(vcolor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));\r\n\t#elif defined(VERTEXCOLORS)\r\n\t\t\t// Internal colors: varying vcolor + uniform ambient/diffuse, external colors: uniform externalColor\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(vcolor.rgb * matColor, texColor.rgb, externalColor.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(vcolor.a * opacity, texColor.a, externalColor.a, int(colorMixMode));\r\n\t#elif defined(INSTANCEDCOLOR) || defined(VV_COLOR) || defined(SYMBOLVERTEXCOLORS)\r\n\t\t\t// Internal colors: uniform ambient/diffuse, external colors: varying vcolorExt\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\r\n\t#else\r\n\t\t\t// Internal colors: uniform ambient/diffuse, external colors: uniform externalColor\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(matColor, texColor.rgb, externalColor.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(opacity, texColor.a, externalColor.a, int(colorMixMode));\r\n\t#endif\r\n\talbedo_+\x3d 0.25 * specular; // don\'t completely ignore specular for now\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhong"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsPhongSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhong"\x3e\x3c![CDATA[\r\n\t\t$fsprecisionf\r\n\r\n\t\t$fsPhongSrc\r\n\r\n\t\tvec4 texColor \x3d vec4(1,1,1,1);\r\n\t\t$externalColorMix\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsPhongSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\r\n\t$fsPhongSrc\r\n\r\n\t\t// read texture color\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\r\n\t\t$externalColorMix\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongAtlasTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec4 $uv0;\r\n\tattribute vec4 $region;\r\n\tvarying vec2 vtc;\r\n\tvarying vec4 regionV;\r\n\t$vsPhongSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0.xy;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t\tregionV \x3d $region/65535.0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongAtlasTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform vec2 texSize;\r\n\tvarying vec2 vtc;\r\n\tvarying vec4 regionV;\r\n\r\n\tfloat calcMipMapLevel(const vec2 ddx, const vec2 ddy) {\r\n\t\t// from:\r\n\t\t// - OpenGLES Common Profile Specification Version 2.0.25, Section 3.7.7 - Texture Minification\r\n\t\t// - https://www.opengl.org/discussion_boards/showthread.php/171485-Texture-LOD-calculation-(useful-for-atlasing)\r\n\t\t// - http://www.linedef.com/virtual-texture-demo.html\r\n\t\tfloat deltaMaxSqr \x3d max(dot(ddx, ddx), dot(ddy, ddy));\r\n\t\treturn max(0.5 * log2(deltaMaxSqr), 0.0);\r\n\t}\r\n\r\n\t$fsPhongSrc\r\n\r\n\t\tvec2 uv \x3d vtc;\r\n\t\tuv \x3d fract(uv);\r\n\t\t//[umin, vmin, umax, vmax]\r\n\r\n\t\tvec2 atlasScale \x3d regionV.zw - regionV.xy;\r\n\t\tuv \x3d uv.xy * atlasScale + regionV.xy;\r\n\r\n\t\tvec4 texColor;\r\n\t\t#ifdef GL_OES_standard_derivatives\r\n\t\t\t#extension GL_OES_standard_derivatives : enable\r\n\r\n\t\t\t// calculate derivative of continuous texture coordinate\r\n\t\t\t// to avoid mipmapping artifacts caused by manual wrapping in shader\r\n\t\t\tvec2 dUVdx \x3d dFdx(vtc) * atlasScale;\r\n\t\t\tvec2 dUVdy \x3d dFdy(vtc) * atlasScale;\r\n\r\n\t\t\t#ifdef GL_EXT_shader_texture_lod\r\n\t\t\t\t#extension GL_EXT_shader_texture_lod : enable\r\n\r\n\t\t\t\t// workaround for artifacts in Windows 10 using Intel HD Graphics 4000 series\r\n\t\t\t\t// see: https://devtopia.esri.com/Zurich-R-D-Center/arcgis-js-api-canvas3d-issues/issues/768\r\n\t\t\t\tconst float epsilon \x3d 1.0E-32;\r\n\t\t\t\tfloat zeroUVShift \x3d uv.x \x3d\x3d 0.0 \x26\x26 uv.y \x3d\x3d 0.0 ? epsilon : 0.0;\r\n\r\n\t\t\t\ttexColor \x3d texture2DGradEXT(tex, uv + zeroUVShift, dUVdx, dUVdy);\r\n\t\t\t#else\r\n\t\t\t\t// use bias to compensate for difference in automatic vs desired mipmap level\r\n\t\t\t\tvec2 dUVdxAuto \x3d dFdx(uv);\r\n\t\t\t\tvec2 dUVdyAuto \x3d dFdy(uv);\r\n\t\t\t\tfloat mipMapLevel \x3d calcMipMapLevel(dUVdx * texSize, dUVdy * texSize);\r\n\t\t\t\tfloat autoMipMapLevel \x3d calcMipMapLevel(dUVdxAuto * texSize, dUVdyAuto * texSize);\r\n\t\t\t\ttexColor \x3d texture2D(tex, uv, mipMapLevel - autoMipMapLevel);\r\n\t\t\t#endif\r\n\t\t#else\r\n\t\t\ttexColor \x3d texture2D(tex, uv);\r\n\t\t#endif\r\n\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\r\n\t\t$externalColorMix\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n\t]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsPhongTexturedRefl"\x3e\x3c![CDATA[\r\n\t\t$fsprecisionf\r\n\r\n\t\tuniform sampler2D tex;\r\n\t\tuniform sampler2D reflTex;\r\n\t\tuniform float reflectivity;\r\n\t\tvarying vec2 vtc;\r\n\r\n\t\t$normal2envTC\r\n\r\n\t\t$fsPhongSrc\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\t\tvec4 reflColor \x3d texture2D(reflTex, normal2envTC(reflDir));\r\n\r\n\t\t$externalColorMix\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\t\tshadedColor.rgb \x3d mix(shadedColor.rgb, reflColor.rgb, reflectivity);\r\n\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepthSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n uniform mat4 modelNormal;\r\n#endif\r\n\tuniform vec2 nearFar;\r\n\tattribute vec3 $position;\r\n\tvarying float depth;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n\t\tvec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n vec4 eye \x3d view * vec4(vpos, 1);\r\n\r\n\t\tgl_Position \x3d proj * eye;\r\n\t\tdepth \x3d (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsDepthSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepthTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsDepthSrc\r\n#ifndef FLIPV\r\n vtc \x3d $uv0;\r\n#else\r\n vtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormalSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n\tattribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n#endif\r\n\tuniform mat4 viewNormal;\r\n\tattribute vec3 $position;\r\n\tattribute vec3 $normal;\r\n\tvarying vec3 vnormal;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\t\tvnormal \x3d normalize((viewNormal * modelNormal * vvTransformNormal($normal, instanceFeatureAttribute)).xyz);\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\t\tvec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\t\tvnormal \x3d normalize((viewNormal * modelNormal * vec4($normal, 1.0)).xyz);\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4(vpos, 1);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormal"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsNormalSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormalTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsNormalSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlightSrc"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n uniform mat4 modelNormal;\r\n#endif\r\n\tattribute vec3 $position;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n vec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n\t\tgl_Position \x3d proj * view * vec4(vpos, 1);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlight"\x3e\x3c![CDATA[\r\n\t$vsHighlightSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlightTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsHighlightSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepthSrc"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\tvarying float depth;\r\n\r\n\tvoid main() {\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepth"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\t$calcFragDepth\r\n\t$float2rgba\r\n\t$fsDepthSrc\r\n#ifndef BIAS_SHADOWMAP\r\n\t\tgl_FragColor \x3d float2rgba(depth);\r\n#else\r\n\t\tgl_FragColor \x3d float2rgba(calcFragDepth(depth));\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepthTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\t$calcFragDepth\r\n\t$float2rgba\r\n\r\n\t$fsDepthSrc\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n#ifndef BIAS_SHADOWMAP\r\n\t\tgl_FragColor \x3d float2rgba(depth);\r\n#else\r\n\t\tgl_FragColor \x3d float2rgba(calcFragDepth(depth));\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsNormal"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec3 vnormal;\r\n\tvoid main() {\r\n\t\tvec3 normal \x3d normalize(vnormal);\r\n\t\tif (gl_FrontFacing \x3d\x3d false) normal \x3d -normal;\r\n\r\n#ifndef ALPHA_ZERO\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 1.0);\r\n#else\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 0.0);\r\n#endif\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsNormalTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec3 vnormal;\r\n\tvarying vec2 vtc;\r\n\tuniform sampler2D tex;\r\n\tvoid main() {\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n\t\tvec3 normal \x3d normalize(vnormal);\r\n\t\tif (gl_FrontFacing \x3d\x3d false) normal \x3d -normal;\r\n#ifndef ALPHA_ZERO\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 1.0);\r\n#else\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 0.0);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlight"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n\tvoid main() {\r\n\t\t$highlightWrite\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec2 vtc;\r\n\tuniform sampler2D tex;\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n\tvoid main() {\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n\r\n\t\t$highlightWrite\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/RibbonLineMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonLine"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\r\n\tuniform float extLineWidth;\r\n\tuniform float nearPlane;\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tattribute vec4 $color;\r\n\tvarying vec4 vColor;\r\n\r\n\tattribute float size;\r\n\r\n#ifndef WALL\r\n\tuniform float miterLimit;\r\n\tattribute vec3 $auxpos1;\r\n\tattribute vec3 $auxpos2;\r\n#endif\r\n\r\n#ifdef SCREENSCALE\r\n\tuniform vec2 screenSize;\r\n\t$toScreenCoords\r\n#define VECTYPE vec2\r\n#define ZEROVEC vec2(0.0, 0.0)\r\n#define PERPENDICULAR(v) vec2(v.y, -v.x);\r\n#define ISOUTSIDE (left.x * right.y - left.y * right.x)*$uv0.y \x3e 0.0\r\n\r\n#else //ifdef SCREENSCALE\r\n\r\n#define VECTYPE vec3\r\n#define ZEROVEC vec3(0.0, 0.0, 0.0)\r\n// these macros are only valid for "strip" type lines:\r\n#define PERPENDICULAR(v) cross(up/*vec3(0.0, 1.0, 0.0)*/, v)\r\n#define ISOUTSIDE dot(cross(left, right), up/*vec3(0.0, 1.0, 0.0)*/)*$uv0.y \x3c 0.0\r\n\r\n#endif //ifdef SCREENSCALE\r\n\r\n\tfloat interp(float ncp, vec4 a, vec4 b) {\r\n\t\treturn (-ncp - a.z) / (b.z - a.z);\r\n\t}\r\n\r\n#ifdef SCREENSCALE\r\n\r\n void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next) {\r\n\t\tfloat vnp \x3d nearPlane*0.99;\r\n\r\n\t\t//We have four vertices per point on the line. Start and end vertices\r\n\t\t//are treated differently --\x3e d \x3e 0, d \x3c 0\r\n\t\tfloat d \x3d abs($uv0.y) - 1.1;\r\n\r\n\t\t//current pos behind ncp --\x3e we need to clip\r\n\t\tif(pos.z \x3e -nearPlane) {\r\n\t\t\tif (d \x3c 0.0) {\r\n\t\t\t\t//previous in front of ncp\r\n\t\t\t\tif(prev.z \x3c -nearPlane) {\r\n\t\t\t\t\tpos \x3d mix(prev, pos, interp(vnp, prev, pos));\r\n\t\t\t\t\tnext \x3d pos;\r\n\t\t\t\t} else {\r\n\t\t\t\t pos \x3d vec4(0, 0, 0, 1);\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t//next in front of ncp\r\n\t\t\tif(d \x3e 0.0) {\r\n\t\t\t\tif(next.z \x3c -nearPlane) {\r\n\t\t\t\t\tpos \x3d mix(pos, next, interp(vnp, pos, next));\r\n\t\t\t\t\tprev \x3d pos;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpos \x3d vec4(0, 0, 0, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\telse {\r\n\t\t\t//current position visible\r\n\t\t\t//previous behind ncp\r\n\t\t\tif (prev.z \x3e -nearPlane) {\r\n\t\t\t\tprev \x3d mix(pos, prev, interp(vnp, pos, prev));\r\n\t\t\t}\r\n\t\t\t//next behind ncp\r\n\t\t\tif (next.z \x3e -nearPlane) {\r\n\t\t\t\tnext \x3d mix(next, pos, interp(vnp, next, pos));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tpos\x3d proj * pos;\r\n\t\tpos.xy *\x3d screenSize;\r\n\t\tpos /\x3d pos.w;\r\n\r\n\t\tnext \x3d proj * next;\r\n\t\tnext.xy *\x3d screenSize;\r\n\t\tnext /\x3d next.w;\r\n\r\n\t\tprev \x3d proj * prev;\r\n\t\tprev.xy *\x3d screenSize;\r\n\t\tprev /\x3d prev.w;\r\n }\r\n\r\n#endif // SCREENSCALE\r\n\r\n\tvoid main(void) {\r\n\r\n\tfloat lineWidth \x3d extLineWidth + $size;\r\n\r\n#ifdef SCREENSCALE\r\n\r\n#if 0\r\n\t\tvec4 pos \x3d toScreenCoords($position.xyz);\r\n\t\tvec2 left \x3d (pos - toScreenCoords($auxpos1)).xy;\r\n\t\tvec2 right \x3d (toScreenCoords($auxpos2) - pos).xy;\r\n#else\r\n\t\tvec4 pos \x3d view * vec4((model * vec4($position.xyz, 1.0)).xyz, 1.0);\r\n\t\tvec4 prev \x3d view * vec4((model * vec4($auxpos1.xyz, 1.0)).xyz, 1.0);\r\n\t\tvec4 next \x3d view * vec4((model * vec4($auxpos2.xyz, 1.0)).xyz, 1.0);\r\n\r\n\t\tclipAndTransform(pos, prev, next);\r\n\r\n\t\tvec2 left \x3d (pos - prev).xy;\r\n\t\tvec2 right \x3d (next - pos).xy;\r\n#endif\r\n\r\n#else // ifdef SCREENSCALE\r\n\t\tvec4 pos \x3d vec4($position, 1.0);\r\n#ifndef WALL\r\n\t\tvec3 left \x3d $position.xyz - $auxpos1;\r\n\t\tvec3 right \x3d $auxpos2 - $position.xyz;\r\n\t\tvec3 up \x3d normalize($position.xyz);\r\n#endif // ifndef WALL\r\n#endif // ifdef SCREENSCALE\r\n\r\n#ifdef WALL\r\n\t\tfloat displacementLen \x3d lineWidth;\r\n\t\tvec3 displacementDir \x3d normalize($position.xyz);//vec3(0.0, 1.0, 0.0);\r\n#else // ifdef WALL\r\n\r\n\t\tfloat leftLen \x3d length(left);\r\n\t\tleft \x3d (leftLen \x3e 0.001) ? left/leftLen : ZEROVEC;\r\n\r\n\t\tfloat rightLen \x3d length(right);\r\n\t\tright \x3d (rightLen \x3e 0.001) ? right/rightLen : ZEROVEC;\r\n\r\n\t\t// determine if vertex is on the "outside or "inside" of the join\r\n\t\tbool isOutside \x3d ISOUTSIDE;\r\n\r\n\t\t// compute miter join position first\r\n\t\tfloat displacementLen \x3d lineWidth;\r\n\t\tVECTYPE displacementDir \x3d normalize(left + right);\r\n\t\tdisplacementDir \x3d PERPENDICULAR(displacementDir);\r\n\t\tif (leftLen \x3e 0.001 \x26\x26 rightLen \x3e 0.001) {\r\n\t\t\tfloat nDotSeg \x3d dot(displacementDir, left);\r\n\t\t\tdisplacementLen /\x3d length(nDotSeg*left - displacementDir);\r\n\r\n\t\t\t// limit displacement of inner vertices\r\n\t\t\tif (!isOutside)\r\n\t\t\t\tdisplacementLen \x3d min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));\r\n\t\t}\r\n\r\n\t\tif (isOutside \x26\x26 (displacementLen \x3e miterLimit*lineWidth)) {\r\n\t\t\t// convert to bevel join if miterLimit is exceeded\r\n\t\t\tif (leftLen \x3c 0.001)\r\n\t\t\t displacementDir \x3d right;\r\n\t\t\telse if (rightLen \x3c 0.001)\r\n\t\t\t\tdisplacementDir \x3d left;\r\n\t\t\telse\r\n\t\t\t\tdisplacementDir \x3d (abs($uv0.y) - 1.1 \x3c 0.0) ? left : right;\r\n\t\t\tdisplacementDir \x3d normalize(displacementDir);\r\n\t\t\tdisplacementDir \x3d PERPENDICULAR(displacementDir);\r\n\t\t\tdisplacementLen \x3d lineWidth;\r\n\t\t}\r\n\r\n#endif // ifdef WALL\r\n\r\n#ifdef SCREENSCALE\r\n\t\tpos.xy +\x3d displacementDir * floor($uv0.y + 0.5) * displacementLen;\r\n\t\tpos.xy /\x3d screenSize;\r\n#else\r\n\t\tpos.xyz +\x3d displacementDir * floor($uv0.y + 0.5) * displacementLen;\r\n\t\tpos \x3d proj * view * model * pos;\r\n#endif\r\n\r\n\t\tvtc \x3d $uv0;\r\n\t\tvColor \x3d $color * 0.003921568627451; // \x3d 1/255\r\n\t\tgl_Position \x3d pos;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"fsRibbonLine"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tuniform vec4 eColor;\r\n\tvarying vec4 vColor;\r\n\tvarying vec2 vtc;\r\n\r\n#ifdef STIPPLE\r\n uniform float stippleLengthDoubleInv;\r\n#endif\r\n\r\n\tvoid main() {\r\n\r\n#ifdef STIPPLE\r\n if (fract(vtc.x * stippleLengthDoubleInv) \x3e 0.5) {\r\n discard;\r\n }\r\n#endif\r\n\r\n gl_FragColor \x3d eColor * vColor;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonLineHighlight"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n#ifdef STIPPLE\r\n uniform float stippleLengthDoubleInv;\r\n#endif\r\n\r\n\tvoid main() {\r\n#ifdef STIPPLE\r\n if (fract(vtc.x * stippleLengthDoubleInv) \x3e 0.5) {\r\n discard;\r\n }\r\n#endif\r\n\r\n\t\tgl_FragColor \x3d vec4(1.0, 1.0, 1.0, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/WaterMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderWater"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tattribute vec3 $position;\r\n\tvarying vec3 vpos;\r\n\tvarying float linearDepth;\r\n\r\n\tvoid main(void) {\r\n\t\tvpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\t\tgl_Position \x3d proj * view * vec4(vpos, 1.0);\r\n\t\tlinearDepth \x3d gl_Position.w;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderWater"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec3 color;\r\n\tuniform float scale;\r\n\tuniform float speed;\r\n\r\n\tuniform vec4 lightAmbient;\r\n\tuniform vec4 lightDiffuse;\r\n\tuniform vec4 lightSpecular;\r\n\tuniform vec3 lightDirection;\r\n\r\n\tuniform vec3 camPos;\r\n\r\n\tuniform sampler2D noiseTex;\r\n\tuniform sampler2D reflTex;\r\n\r\n\tuniform sampler2D depthTex;\r\n\tuniform int shadowMapNum;\r\n\tuniform vec4 shadowMapDistance;\r\n\tuniform mat4 shadowMapMatrix[4];\r\n\tuniform float depthHalfPixelSz;\r\n\r\n\tvarying vec3 vpos;\r\n\tvarying float linearDepth;\r\n\r\n\t$evalShadow\r\n\r\n\t$normal2envTC\r\n\r\n\tvec2 rotate(vec2 pos, float angle) {\r\n\t\tfloat c \x3d cos(angle);\r\n\t\tfloat s \x3d sin(angle);\r\n\t\treturn vec2(c * pos.x - s * pos.y, s * pos.x + c * pos.y);\r\n\t}\r\n\r\n\tfloat compDelta(vec2 pos) {\r\n\t\tconst float PI_THIRD \x3d 1.04719755;\r\n\r\n\t\tfloat result \x3d .0;\r\n\t\tfloat s \x3d 1.0;\r\n\t\tfor (int i \x3d 0; i \x3c 6; ++i) {\r\n\t\t\tvec2 tc \x3d pos / (20.0 * s);\r\n\t\t\ttc +\x3d rotate(vec2(1.0 + speed, .0), PI_THIRD * float(i));\r\n\t\t\tresult +\x3d s * texture2D(noiseTex, tc).r;\r\n\t\t\ts *\x3d 1.5;\r\n\t\t}\r\n\t\treturn result * scale * .2;\r\n\t}\r\n\r\n\tvoid main() {\r\n\t\tvec3 viewVec \x3d normalize(camPos - vpos);\r\n\r\n\t\tfloat d0 \x3d compDelta(vpos.xz);\r\n\t\tfloat dx \x3d compDelta(vpos.xz + vec2(.05, .0));\r\n\t\tfloat dz \x3d compDelta(vpos.xz + vec2(.0, .05));\r\n\r\n\t\tvec3 normal \x3d normalize(vec3(d0 - dx, .05, d0 - dz));\r\n\r\n\t\tfloat fresnel \x3d clamp(1.0 - 1.25 * dot(viewVec, normal), .0, 1.0);\r\n\r\n\t\tfloat shadow \x3d 0.0;\r\n\t\tif (halfPxSz \x3e\x3d .0) {\r\n\t\t\tshadow \x3d evalShadow(vpos, linearDepth, depthTex, shadowMapNum, shadowMapDistance, shadowMapMatrix, depthHalfPixelSz);\r\n\t\t}\r\n\r\n\t\tvec3 reflDir \x3d reflect(-viewVec, normal);\r\n\t\tif (reflDir.y \x3c .02) reflDir.y \x3d 0.04 - reflDir.y;\r\n\r\n\t\tvec3 reflCol \x3d texture2D(reflTex, normal2envTC(reflDir)).rgb * lightAmbient.rgb*lightSpecular.w;\r\n\t\treflCol *\x3d .5 + max(lightDirection.y, .0) * .5; // ?\t+\r\n\t\tvec3 waterColor \x3d color * (lightAmbient.rgb * lightAmbient.w + (1.0 - shadow) * max(lightDirection.y, .0) * lightDiffuse.rgb * lightDiffuse.w);\r\n\t\tvec3 finalColor \x3d mix(waterColor, reflCol, .15 + .6 * fresnel);\r\n\r\n\t\tvec3 spec \x3d pow(max(dot(reflDir, lightDirection), .001), 80.0) * lightSpecular.rgb * lightSpecular.w * 2.0;\r\n\t\tfinalColor +\x3d (1.0 - shadow) * lightDiffuse.w * spec;\r\n\r\n\t\tgl_FragColor \x3d vec4(finalColor, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/MeasurementArrowMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsMeasurementArrow"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform mat4 model;\r\n\r\n uniform float width;\r\n\r\n attribute vec3 $position;\r\n attribute vec3 $normal;\r\n attribute vec2 $uv0;\r\n attribute float $auxpos1;\r\n\r\n varying vec2 vtc;\r\n varying float vlength;\r\n varying float vradius;\r\n\r\n void main(void) {\r\n vec3 bitangent \x3d $normal;\r\n\r\n vtc \x3d $uv0;\r\n vlength \x3d $auxpos1;\r\n vradius \x3d 0.5 * width;\r\n\r\n vec4 pos \x3d view * vec4((model * vec4($position + vradius * bitangent * $uv0.y, 1.0)).xyz, 1.0);\r\n gl_Position \x3d proj * pos;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsMeasurementArrow"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform float outlineSize;\r\n uniform vec4 outlineColor;\r\n uniform float stripeLength;\r\n uniform vec4 stripeEvenColor;\r\n uniform vec4 stripeOddColor;\r\n\r\n varying vec2 vtc;\r\n varying float vlength;\r\n varying float vradius;\r\n\r\n #define INV_SQRT2 (1.0 / sqrt(2.0))\r\n\r\n vec4 arrowColor(vec2 tc, float len) {\r\n float d \x3d INV_SQRT2 * (tc.x - abs(tc.y));\r\n d \x3d min(d, INV_SQRT2 * (len - tc.x - abs(tc.y)));\r\n d \x3d min(d, 1.0 - abs(tc.y));\r\n\r\n if (d \x3c 0.0) {\r\n return vec4(0.0);\r\n } else if (d \x3c outlineSize) {\r\n return outlineColor;\r\n } else {\r\n return fract(0.5 / stripeLength * tc.x * vradius) \x3e\x3d 0.5 ? stripeOddColor : stripeEvenColor;\r\n }\r\n }\r\n\r\n void main(void) {\r\n vec2 ntc \x3d vec2(vtc.x / vradius, vtc.y);\r\n vec4 color \x3d arrowColor(ntc, vlength / vradius);\r\n if (color.a \x3d\x3d 0.0) {\r\n discard;\r\n }\r\n gl_FragColor \x3d color;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/SimpleGLMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderSimple"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tattribute vec3 $position;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4($position, 1.0)).xyz, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderSimple"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec4 color;\r\n\r\n\tvoid main() {\r\n\t\tgl_FragColor \x3d color;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/webgl-engine/materials/internal/BlendLayers.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderBlendLayers"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\r\n\tuniform float scale;\r\n\tuniform vec2 offset;\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d vec4($position, 1.0);\r\n\t\tuv \x3d $uv0 * scale + offset;;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderBlendLayers"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform float opacity;\r\n\r\n\tvoid main() {\r\n\t\tvec4 color \x3d texture2D(tex, uv);\r\n\r\n // Note: output in pre-multiplied alpha for correct alpha compositing\r\n\t\tgl_FragColor \x3d vec4(color.xyz, 1.0) * color.a * opacity;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"url:esri/views/3d/terrain/TerrainMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrain"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform vec3 origin;\r\n uniform vec2 texOffset;\r\n uniform float texScale;\r\n uniform mat4 viewNormal;\r\n\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n varying vec2 vtc;\r\n varying vec3 vpos;\r\n varying vec3 vnormal;\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n varying float linearDepth;\r\n#endif\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n varying vec2 vuv;\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n uniform vec3 lightDirection;\r\n varying vec3 wpos;\r\n varying vec3 wview;\r\n varying vec3 wnormal;\r\n varying vec3 wlight;\r\n#endif\r\n\r\n#ifdef OVERLAY\r\n uniform vec2 overlayTexOffset;\r\n uniform vec2 overlayTexScale;\r\n varying vec2 vtcOverlay;\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n varying float screenSizeDistanceToCamera;\r\n varying float screenSizeCosAngle;\r\n\r\n#endif\r\n\r\n void main(void) {\r\n vpos \x3d $position;\r\n\r\n#ifdef SPHERICAL\r\n vnormal \x3d normalize(vpos + origin);\r\n#else\r\n vnormal \x3d vec3(0, 0, 1); // WARNING: up-axis dependent code\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n wpos \x3d (view * vec4(vpos, 1.0)).xyz;\r\n wnormal \x3d (viewNormal * vec4(normalize(vpos+origin), 1.0)).xyz;\r\n wlight \x3d (view * vec4(lightDirection, 1.0)).xyz;\r\n#endif\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n vuv \x3d $uv0;\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n\r\n vec3 viewPos \x3d (view * vec4(vpos, 1.0)).xyz;\r\n\r\n screenSizeDistanceToCamera \x3d length(viewPos);\r\n\r\n vec3 viewSpaceNormal \x3d (viewNormal * vec4(normalize(vpos + origin), 1.0)).xyz;\r\n screenSizeCosAngle \x3d abs(viewSpaceNormal.z);\r\n\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4(vpos, 1.0);\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n // Shadowmap\'s cascading index used to be based on \'1.0 / gl_FragCoord.w\'\r\n // (i.e. the perspective interpolation of \'gl_Position.w\'). Precision\r\n // issues on iPad/iPhone with the \'w\' component require the depth to be\r\n // passed as varying to properly drive the cascading shadow map index.\r\n linearDepth \x3d gl_Position.w;\r\n#endif\r\n\r\n vtc \x3d $uv0*texScale + texOffset;\r\n\r\n#ifdef OVERLAY\r\n vtcOverlay \x3d $uv0*overlayTexScale + overlayTexOffset;\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainCommon"\x3e\x3c![CDATA[\r\n uniform vec3 lightDirection;\r\n uniform vec3 viewDirection;\r\n uniform sampler2D depthTex;\r\n uniform int shadowMapNum;\r\n uniform vec4 shadowMapDistance;\r\n uniform mat4 shadowMapMatrix[4];\r\n uniform float depthHalfPixelSz;\r\n uniform sampler2D ssaoTex;\r\n uniform vec4 viewportPixelSz;\r\n uniform sampler2D tex;\r\n uniform float opacity;\r\n\r\n varying vec3 vpos;\r\n varying vec3 vnormal;\r\n varying vec2 vtc;\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n varying vec2 vuv;\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n varying vec3 wpos;\r\n varying vec3 wview;\r\n varying vec3 wnormal;\r\n varying vec3 wlight;\r\n#endif\r\n\r\n $sceneLightingDefinitions\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n $screenSizePerspective\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n varying float screenSizeDistanceToCamera;\r\n varying float screenSizeCosAngle;\r\n#endif\r\n\r\n const vec3 ambient \x3d vec3(0.2,0.2,0.2);\r\n const vec3 diffuse \x3d vec3(0.8,0.8,0.8);\r\n const float diffuseHardness \x3d 2.5;\r\n\r\n#ifdef OVERLAY\r\n uniform sampler2D overlayTex;\r\n uniform float overlayOpacity;\r\n varying vec2 vtcOverlay;\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n\t$evalShadow\r\n#endif\r\n\r\n float lum(vec3 c) {\r\n float max \x3d max(max(c.r, c.g), c.b);\r\n float min \x3d min(min(c.r, c.g), c.b);\r\n return (min + max) * 0.5;\r\n }\r\n\r\n#ifdef ATMOSPHERE\r\n vec3 atmosphere(vec3 lightPos, vec3 normal, vec3 view) {\r\n vec3 surfaceColor \x3d vec3(0.0);\r\n vec3 fuzzySpecColor \x3d vec3(1.0);\r\n vec3 subColor \x3d vec3(0.0);\r\n float rollOff \x3d 1.0;\r\n\r\n vec3 Ln \x3d normalize(lightPos);\r\n vec3 Nn \x3d normalize(normal);\r\n vec3 Hn \x3d normalize(view + Ln);\r\n\r\n float ldn \x3d dot(Ln, Nn);\r\n float diffComp \x3d max(0.0, ldn);\r\n float vdn \x3d 1.0 - dot(view, Nn);\r\n float ndv \x3d dot(view, Ln);\r\n\r\n vec3 diffContrib \x3d surfaceColor * diffComp;\r\n float subLamb \x3d max(0.0, smoothstep(-rollOff, 1.0, ldn) - smoothstep(0.0, 1.0, ldn));\r\n\r\n vec3 subContrib \x3d subLamb * subColor;\r\n vec3 vecColor \x3d vec3(vdn);\r\n\r\n vec3 diffuseContrib \x3d (subContrib + diffContrib);\r\n vec3 specularContrib \x3d (vecColor * fuzzySpecColor);\r\n\r\n return (diffContrib + specularContrib) * rollOff;\r\n }\r\n#endif\r\n\r\n void main() {\r\n vec3 a \x3d ambient;\r\n\r\n float shadow \x3d 0.0;\r\n#ifdef RECEIVE_SHADOWS\r\n shadow \x3d evalShadow(vpos, linearDepth, depthTex, shadowMapNum, shadowMapDistance, shadowMapMatrix, depthHalfPixelSz);\r\n#endif\r\n float vndl \x3d dot(normalize(vnormal), lightDirection);\r\n float k \x3d smoothstep(0.0, 1.0, clamp(vndl*diffuseHardness, 0.0, 1.0));\r\n vec3 d \x3d (1.0 - shadow/1.8) * diffuse * k;\r\n\r\n float ssao \x3d viewportPixelSz.w \x3c .0 ? 1.0 : texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;\r\n vec4 texCol \x3d texture2D(tex, vtc);\r\n\r\n#ifdef OVERLAY\r\n if ((vtcOverlay.x \x3e 0.0) \x26\x26 (vtcOverlay.y \x3e 0.0) \x26\x26 (vtcOverlay.x \x3c 1.0) \x26\x26 (vtcOverlay.y \x3c 1.0)) {\r\n vec4 overlayTexCol \x3d texture2D(overlayTex, vtcOverlay);\r\n overlayTexCol *\x3d overlayOpacity;\r\n texCol \x3d texCol * (1.0 - overlayTexCol.a) + overlayTexCol; // texCol and overlayTexCol have pre-multiplied alpha\r\n }\r\n#endif\r\n\r\n vec3 atm \x3d vec3(0.0);\r\n#ifdef ATMOSPHERE\r\n float ndotl \x3d max(0.0, min(1.0, vndl));\r\n atm \x3d atmosphere(wlight, wnormal, -viewDirection);\r\n atm *\x3d max(0.0, min(1.0, (1.0-lum(texCol.rgb)*1.5))); //avoid atmosphere on bright base maps\r\n atm *\x3d max(0.0, min(1.0, ndotl*2.0)); // avoid atmosphere on dark side of the globe\r\n#endif\r\n\r\n vec3 albedo \x3d atm + texCol.rgb;\r\n vec3 normal \x3d normalize(vnormal);\r\n\r\n // heuristic shading function used in the old terrain, now used to add ambient lighting\r\n float additionalAmbientScale \x3d smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));\r\n\t\tvec3 additionalLight \x3d ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\r\n\r\n gl_FragColor \x3d vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), texCol.a) * opacity;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n // This is only used for debug rendering the screenSize perspective\r\n\r\n float perspectiveScale \x3d screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, screenSizePerspective);\r\n\r\n if (perspectiveScale \x3c\x3d 0.25) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 0, 1), perspectiveScale * 4.0);\r\n }\r\n else if (perspectiveScale \x3c\x3d 0.5) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(0, 0, 1, 1), (perspectiveScale - 0.25) * 4.0);\r\n }\r\n else if (perspectiveScale \x3e\x3d 0.99) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(0, 1, 0, 1), 0.2);\r\n }\r\n else {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 1, 1), (perspectiveScale - 0.5) * 2.0);\r\n }\r\n\r\n#endif\r\n\r\n // closing } is missing here, it\'s in the shaders using this snippet below\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainWireframe"\x3e\x3c![CDATA[\r\n#ifdef GL_OES_standard_derivatives\r\n#extension GL_OES_standard_derivatives : enable\r\n#endif\r\n\r\n $fsprecisionf\r\n\r\n struct WireframeSettings {\r\n float width;\r\n float falloff;\r\n float subdivision;\r\n vec4 color;\r\n float wireOpacity;\r\n float surfaceOpacity;\r\n };\r\n\r\n uniform WireframeSettings wireframe;\r\n\r\n $fsTerrainCommon\r\n\r\n vec2 vuvScaled \x3d vuv * wireframe.subdivision;\r\n vec2 vuvMod \x3d fract(vuvScaled);\r\n\r\n#ifdef GL_OES_standard_derivatives\r\n vec2 dVuv \x3d fwidth(vuvScaled);\r\n dVuv \x3d max(vec2(0.00001), dVuv); // workaround against flickering skirts, see #10245\r\n#else\r\n // Something that reasonably works\r\n vec2 dVuv \x3d vec2(0.05);\r\n#endif\r\n\r\n vec2 edgeFactors \x3d smoothstep((wireframe.width - wireframe.falloff) * dVuv,\r\n wireframe.width * dVuv, min(vuvMod, 1.0 - vuvMod));\r\n\r\n float edgeFactor \x3d 1.0 - min(edgeFactors.x, edgeFactors.y);\r\n\r\n#ifdef WIREFRAME\r\n gl_FragColor \x3d vec4(mix(gl_FragColor.rgb, wireframe.color.rgb, edgeFactor * wireframe.color.a),\r\n mix(wireframe.surfaceOpacity, wireframe.wireOpacity, edgeFactor));\r\n#endif\r\n\r\n\r\n#ifdef TILE_BORDERS\r\n dVuv \x3d fwidth(vuv);\r\n edgeFactors \x3d smoothstep((wireframe.width - wireframe.falloff) * dVuv,\r\n wireframe.width * dVuv, min(vuv, 1.0 - vuv));\r\n edgeFactor \x3d 1.0 - min(edgeFactors.x, edgeFactors.y);\r\n\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrain"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n $fsTerrainCommon\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainNormal"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform vec3 origin;\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform mat4 viewNormal;\r\n attribute vec3 $position;\r\n varying vec3 vnormal;\r\n\r\n void main(void) {\r\n#ifdef SPHERICAL\r\n vec4 normal \x3d vec4(normalize($position + origin), 1.0);\r\n#else\r\n vec4 normal \x3d vec4(0.0, 1.0, 0.0, 1.0);\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n vnormal \x3d normalize((viewNormal * normal).xyz);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainDepthOnly"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n\r\n attribute vec3 $position;\r\n\r\n void main() {\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainDepthOnly"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n void main() {\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainHighlight"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform vec2 overlayTexScale;\r\n uniform vec2 overlayTexOffset;\r\n\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n\r\n varying vec2 vtcOverlay;\r\n\r\n void main() {\r\n vtcOverlay \x3d $uv0*overlayTexScale + overlayTexOffset;\r\n\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainHighlight"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D overlayTex;\r\n\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n varying vec2 vtcOverlay;\r\n\r\n void main() {\r\n vec4 texCol \x3d vec4(0,0,0,0);\r\n if ((vtcOverlay.x \x3e 0.0) \x26\x26 (vtcOverlay.y \x3e 0.0) \x26\x26 (vtcOverlay.x \x3c 1.0) \x26\x26 (vtcOverlay.y \x3c 1.0)) {\r\n texCol \x3d texture2D(overlayTex, vtcOverlay);\r\n }\r\n\r\n if (texCol.a \x3d\x3d 0.0) {\r\n // Here we have to write black, instead of discarding the fragment in order to overwrite\r\n // the highlights which might have been written by skirts of other tiles.\r\n // As a consequence skirts are not visible, but terrain overwrites draped highlights.\r\n gl_FragColor \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n\r\n $highlightWrite\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
"*now":function(x){x(['dojo/i18n!*preload*esri/views/nls/SceneView*["ar","ca","cs","da","de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])},"*noref":1}});
define("../core/accessorSupport/watch dojo/_base/kernel dojo/dom dojo/Deferred dojo/when ./View ./BreakpointsOwner ./DOMContainer ./ViewAnimation ../geometry/HeightModelInfo ../geometry/SpatialReference ../geometry/support/scaleUtils ../geometry/support/webMercatorUtils ../Camera ../Graphic ../geometry/Point ../geometry/Extent ../geometry/ScreenPoint ../Viewpoint ../core/Scheduler ../core/sniff ../core/watchUtils ../core/promiseUtils ../core/Error ../core/Logger ../core/HandleRegistry ../webscene/Environment ./support/screenshotUtils ./support/WebGLRequirements ./3d/state/ViewState ./3d/state/ViewStateManager ./3d/environment/SceneViewEnvironment ./3d/environment/SceneViewEnvironmentManager ./3d/constraints/Constraints ./3d/input/SceneInputManager ./3d/lib/glMatrix ./3d/support/projectionUtils ./3d/webgl-engine/Stage ./3d/webgl-engine/lib/Selector ./3d/support/CombinedElevationProvider ./3d/support/HighlightOptions ./3d/support/RenderCoordsHelper ./3d/support/MapCoordsHelper ./3d/support/ResourceController ./3d/support/DisplayQualityProfile ./3d/support/QualitySettings ./3d/support/SharedSymbolResources ./3d/support/pointsOfInterest/PointsOfInterest ./3d/support/debugFlags ./3d/terrain/TerrainSurface ./3d/terrain/terrainUtils ./3d/layers/graphics/Deconflictor ./3d/layers/GraphicsView3D ./ui/3d/DefaultUI3D".split(" "),function(x,
r,k,a,b,c,t,n,f,q,l,y,B,v,w,D,F,G,p,z,A,J,I,K,L,O,P,U,N,R,S,T,V,h,ca,Q,e,d,g,m,u,C,M,Y,W,da,fa,aa,ea,ja,ga,la,ia,Z){fa=fa.default;S=S.default;h=h.default;var pa=L.getLogger("esri.views.SceneView");R=R.ViewState;var ma=Q.vec3d,sa=ma.create(),E={point:new D(0,0,0),retval:null};aa=aa.default;return n.createSubclass([c,t],{declaredClass:"esri.views.SceneView",properties:{activeTool:{value:null,set:function(a){if(a&&!this.ready)pa.error("#activeTool\x3d","cannot set active tool while view is not ready");
else{var b=this._get("activeTool");a!==b&&(b&&b.deactivate(this.inputManager._inputManager),this._set("activeTool",a),a&&a.activate(this.inputManager._inputManager))}}},animation:{type:f,readOnly:!0,aliasOf:"state.animation"},basemapTerrain:{readOnly:!0,value:null},elevationProvider:{readOnly:!0,value:null},camera:{type:v,aliasOf:"stateManager.camera"},canvas:{readOnly:!0,value:null},center:{type:D,aliasOf:"stateManager.center"},clippingArea:{type:F,dependsOn:["map.clippingArea","map.clippingEnabled",
"viewingMode"],get:function(){if("global"===this.viewingMode)return null;if(this._userClippingArea)return this._userClippingArea;var a=this.get("map.clippingEnabled"),b=this.get("map.clippingArea");if(!a||!b)return this._clippingArea=null;if(!(b instanceof F))return pa.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea;if(B.canProject(b.spatialReference,this.spatialReference))b=B.project(b,this.spatialReference);else return pa.error("#clippingArea",
"setting clippingArea with incompatible SpatialReference"),this._clippingArea;return this._clippingArea&&b&&this._clippingArea.equals(b)?this._clippingArea:this._clippingArea=b},set:function(a){this.ready&&"global"===this.viewingMode&&a?pa.error("#clippingArea\x3d","Clipping area is only supported in local viewingMode"):(this._userClippingArea=a,this.notifyChange("clippingArea"))}},constraints:{type:h,value:null},dataExtent:{dependsOn:["basemapTerrain.extent","clippingArea","map"],readOnly:!0,get:function(){function a(a){a&&
(a=B.project(a,c))&&(d&&(a=a.intersection(d)),a&&b.push(a))}var b=[],c=this.spatialReference||l.WGS84,d=this.clippingArea;d&&(d=B.project(d,c));var e=this._get("basemapTerrain");e&&e.spatialReference&&a(new F({xmin:e.extent[0],ymin:e.extent[1],zmin:0,xmax:e.extent[2],ymax:e.extent[3],zmax:0,spatialReference:e.spatialReference}));this.map&&this.map.allLayers.forEach(function(b){a(b.fullExtent)});return 0<b.length?(e=b.reduce(function(a,b){return a.union(b)}),e.hasZ?(e.zmin=Math.min(0,e.zmin),e.zmax=
Math.max(0,e.zmax)):(e.zmin=0,e.zmax=0),e):new F({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:c})}},environment:{value:null,set:function(a){a!==this._defaults.environment&&(this._externallySet.environment=!0);a?a instanceof T?this._set("environment",a):a instanceof P?this.environment.lighting=a.lighting:a.declaredClass?this._set("environment",a):this._set("environment",new T(a)):this._set("environment",new T)}},environmentManager:{},extent:{type:F,aliasOf:"stateManager.extent"},frustum:{aliasOf:"stateManager.frustum"},
fullOpacity:1,groundExtent:{dependsOn:["basemapTerrain.extent"],readOnly:!0,get:function(){var a=this._get("basemapTerrain");if(a&&a.spatialReference){var b=a.extent;return new F({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:a.spatialReference})}return new F({spatialReference:this.spatialReference||l.WGS84})}},initialExtentRequired:{dependsOn:["stateManager.hasInitialView"],get:function(){return!this.stateManager.hasInitialView}},interacting:{dependsOn:["state.interacting"],readOnly:!0,
get:function(){return!!this.state&&this.state.interacting}},map:{value:null},mapCoordsHelper:{},padding:{aliasOf:"stateManager.padding"},pointsOfInterest:aa,screenSizePerspectiveEnabled:!0,state:{readOnly:!0,value:null},stateManager:{readOnly:!0},inputManager:{},qualityProfile:{set:function(a){W.isValidProfile(a)&&(W.apply(a,this),this._set("qualityProfile",a))}},qualitySettings:{type:da},ready:{dependsOn:["viewingMode"]},renderCoordsHelper:{},resolution:{dependsOn:["scale","spatialReference"],readOnly:!0,
get:function(){return null!=this.spatialReference?y.getResolutionForScale(this.scale,this.spatialReference):0}},scale:{aliasOf:"stateManager.scale"},spatialReference:{dependsOn:["map.initialViewProperties.spatialReference","defaultsFromMap.isSpatialReferenceDone"]},spatialReferenceWarningDelay:1E3,isHeightModelInfoRequired:!0,type:"3d",ui:{type:Z},updating:{},updatingPercentage:0,viewingMode:{dependsOn:["map.initialViewProperties.viewingMode","spatialReference"],get:function(){var a=this.get("map.initialViewProperties.viewingMode"),
b=this.spatialReference;a||(a=!b||b.isWebMercator||b.isWGS84?"global":"local");return a},set:function(a){this._internallyReady?pa.error("#viewingMode","viewingMode cannot be set once view is ready"):0<=["local","global"].indexOf(a)?this._override("viewingMode",a):void 0===a&&this._clearOverride("viewingMode")}},viewpoint:{type:p,aliasOf:"stateManager.viewpoint"},zoom:{aliasOf:"stateManager.zoom"},highlightOptions:{type:u}},getDefaults:function(a){var b=this.inherited(arguments);b.constraints||a.constraints||
(b.constraints=new h);b.environment||a.environment||(this._defaults.environment=new T,b.environment=this._defaults.environment);b.qualitySettings=new da;b.qualityProfile=W.getDefaultProfile();b.highlightOptions=new u;return b},constructor:function(){J.when(this,"ready",this._viewReadyHandler.bind(this));this._internallyReady=!1;this._initialProps={};this._initialDefaultSpatialReference=this._gotoTask=this._userClippingArea=null;this.inputManager=new ca({view:this});this.stateManager=new S({view:this});
this._clippingArea=this._constraints=null;this._defaults={};this._externallySet={};this.resourceController=new Y(this);this.deconflictor=new la(this);this._evaluateUpdating=this._evaluateUpdating.bind(this);this._layerViewsUpdatingHandles={};this._stageHandles=new O;this.watch("map",function(a){a&&a.load&&a.load()})},initialize:function(){this.environmentManager=new V({view:this});this._updateUpdatingMonitorsHandle=this.allLayerViews.on("change",this._updateUpdatingMonitors.bind(this));this._updateUpdatingMonitors({added:this.allLayerViews.toArray(),
removed:[],moved:[]});J.whenNot(this,"ready",this._viewUnreadyHandler.bind(this));var a;J.init(this.defaultsFromMap,"isSpatialReferenceDone",function(b){var c=!!(this.map&&0<this.map.allLayers.length);b&&!this.spatialReference&&c||!a?b&&!this.spatialReference&&c&&!a&&(a=I.after(this.spatialReferenceWarningDelay),a.then(function(){pa.warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})):(a.cancel(),a=null)}.bind(this));J.init(this.qualitySettings,
"gpuMemoryLimit",function(a){this.resourceController&&this.resourceController.setMaxGpuMemory(a)}.bind(this))},destroy:function(){this.activeTool=null;x.dispatchTarget(this);this.environmentManager.destroy();this._disposeGraphicsView();this._updateUpdatingMonitorsHandle.remove();this._updateUpdatingMonitorsHandle=null;this._stageHandles.remove();this.inputManager&&(this.inputManager.destroy(),this.inputManager=null)},destroyLayerViews:function(){for(var a in this._layerViewsUpdatingHandles)this._layerViewsUpdatingHandles[a].remove();
this._layerViewsUpdatingHandles={};this.stateManager.deinit();this._disposeSurface();this.inherited(arguments);this._stage&&(this._stage.dispose(),this._stage=null,this._stageHandles.remove());this._setCanvas(null);this.deconflictor.destroy();this.deconflictor=null;this.resourceController.destroy();this.resourceController=null},on:function(a,b,c){var d=this.inputManager.viewEvents.register(a,b,c);return d?d:this.inherited(arguments)},toMap:function(a,b,c){if(!this.ready)return pa.error("#toMap()",
"Scene view cannot be used before it is ready"),null;a=this._normalizePointArgs(a,b,void 0,c);b=this._stage.pick([a.point.x,this.height-a.point.y]).getMinResult();return this._computeMapPointFromIntersectionResult(b,a.retval)},toScreen:function(a,b,c,d){if(!this.ready)return pa.error("#toScreen()","Scene view cannot be used before it is ready"),null;a=this._normalizePointArgs(a,b,c,d);e.pointToVector(a.point,sa,this.renderSpatialReference);return this.engineToScreen(sa,a.retval)},pixelSizeAt:function(a,
b,c){if(!this.ready)return pa.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if("esri.geometry.ScreenPoint"===a.declaredClass){if(!this._stage.pick([a.x,this.height-a.y]).getMinResult().getIntersectionPoint(sa))return 0}else a=this._normalizePointArgs(a,b,c,void 0),e.pointToVector(a.point,sa,this.renderSpatialReference);return this.state.camera.computePixelSizeAt(sa)},hitTest:function(a,c){if(!this.ready)return pa.error("#hitTest()","Scene view cannot be used before it is ready"),
null;a=this._normalizePointArgs(a,c,void 0,void 0);var d=[a.point.x,this.height-a.point.y],e=this._stage.pick(d,null,!0);a=e.getMinResult();var f=this._computeMapPointFromIntersectionResult(a),g;switch(a.targetType){case "None":g=null;break;case "StageObject":g=this._getGraphicFromStageObject(a.target,a.triangleNr);break;case "StagePoint":g=this._getGraphicFromStagePoint(a.target)}return b(g).otherwise(function(){return null}).then(function(a){var b=[];(a||f)&&b.push({mapPoint:f,graphic:a});a={screenPoint:d,
results:b};ea.SCENEVIEW_HITTEST_RETURN_SELECTOR&&(a.selector=e);return a})},goTo:function(a,b){return this.stateManager.goTo(a,b)},animateTo:function(a,b){r.deprecated(this.declaredClass+".animateTo is deprecated. Use .goTo instead.","","4.0");return this.goTo(a,b)},takeScreenshot:function(b){if(this.ready){b=U.adjustScreenshotSettings(b,this);var c=new a;this._stage.requestScreenCapture(b,function(a){z.schedule(function(){c.resolve(a)})});return c.promise}pa.error("#takeScreenshot()","Scene view cannot be used before it is ready")},
engineToScreen:function(a,b){var c=ma.create();this.state.camera.projectPoint(a,c);a=c[0];var d=this.height-c[1],c=c[2];return b?(b.x=a,b.y=d,b.z=c,b):new G({x:a,y:d,z:c})},getDefaultSpatialReference:function(){return this.get("map.initialViewProperties.spatialReference")||this.get("defaultsFromMap.spatialReference")||this.get("defaultsFromMap.isSpatialReferenceDone")&&this._initialDefaultSpatialReference||null},validate:function(){var a=N.check();A("safari")&&9>A("safari")&&(a=new K("sceneview:browser-not-supported",
"This browser is not supported by SceneView (Safari \x3c 9)",{type:"safari",requiredVersion:9,detectedVersion:A("safari")}));return a?(pa.warn("#validate()",a.message),I.reject(a)):I.resolve()},isSpatialReferenceSupported:function(a,b){var c=a.isGeographic,d=a.isWebMercator,e=a.isWGS84,f="local"===this.viewingMode,g=!(!this._isOverridden("viewingMode")&&!this.get("map.initialViewProperties.viewingMode"));if(g){if(f&&c||!f&&!d&&!e)return!1}else if(c&&!e)return!1;if(b)if(ga.isTiledLayer(b)){if(g?c=
ga.getTiledLayerInfo(b,a,this.viewingMode):(c=ga.getTiledLayerInfo(b,a,"global"),null==c.tileInfo&&(c=ga.getTiledLayerInfo(b,a,"local"))),null==c.tileInfo)return!1}else if((e||d)&&!f)return null==this._initialDefaultSpatialReference&&(this._initialDefaultSpatialReference=a),g||this._internallyReady||(this.viewingMode="global"),!1;return!0},has:function(a){return this._stage.has(a)},flushDisplayModifications:function(){this._stage.processDirty()},getDrawingOrder:function(a){return this.allLayerViews.findIndex(function(b){return b.layer&&
b.layer.uid===a})},getViewForGraphic:function(a){return a.layer?this.allLayerViews.find(function(b){return b.layer===a.layer}):this._graphicsView},whenViewForGraphic:function(a){return a.layer?this.whenLayerView(a.layer):I.resolve(this._graphicsView)},renderSpatialReference:null,_graphicsView:null,_surfaceReadyWatchHandle:null,_stageHandles:null,_computeMapPointFromIntersectionResult:function(a,b){if(a.getIntersectionPoint(sa)){b=this._computeMapPointFromVec3d(sa,b);var c=this._get("basemapTerrain");
"terrain"===a.intersector&&c&&(a=c.getElevation(b),null!==a&&(b.z=a));return b}return null},_computeMapPointFromVec3d:function(a,b){var c=this.spatialReference||l.WGS84;e.vectorToVector(a,this.renderSpatialReference,a,c)||(c=l.WGS84,e.vectorToVector(a,this.renderSpatialReference,a,c));b?(b.x=a[0],b.y=a[1],b.z=a[2],b.spatialReference=c):b=new D(a,c);return b},_getGraphicFromStageObject:function(a,b){var c=a.getMetadata();if(null!=c&&null!=c.layerUid){if(c.layerUid===this._graphicsView.mockLayerId)return this._graphicsView.getGraphicsFromStageObject(a,
b);if(c=this.map.findLayerByUid(c.layerUid))return this.whenLayerView(c).then(function(c){if(c&&null!=c.getGraphicsFromStageObject&&!c.suspended)return c.getGraphicsFromStageObject(a,b)})}return null},_getGraphicFromStagePoint:function(a){var b=this._computeMapPointFromVec3d(a.point),b=new w(b);a=a.metadata.layerUid;null!=a&&(b.layer=this.map.findLayerByUid(a));return b},_viewingModeToManifold:function(a){return{local:"planar",global:"spherical"}[a]},_initBasemapTerrain:function(a){this._disposeBasemapTerrain();
this._set("basemapTerrain",new ja(this,this._viewingModeToManifold(a)));this._set("elevationProvider",new m({view:this}));this.elevationProvider.register("ground",this.basemapTerrain)},_initGlobe:function(a){this._initCoordinateSystem();this._initState();this._stage.setViewParams({backgroundColor:[0,0,0,0],maxFarNearRatio:0,frustumCullingEnabled:!1});this._initBasemapTerrain(a);this.pointsOfInterest=new aa({view:this});this._initStateManager()},_initCoordinateSystem:function(){if(this.spatialReference){var a=
this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(a)||(this.mapCoordsHelper=new M(this.map,a));var b=this.renderCoordsHelper?this.renderCoordsHelper.unitInMeters:1,c="global"===this.viewingMode,a=c?e.SphericalECEFSpatialReference:a;a!==this.renderSpatialReference&&(this.renderSpatialReference=a,this.renderCoordsHelper=C.createRenderCoordsHelper(c?"global":"local",a),this._stage&&this._stage.setIntersectTolerance(g.DEFAULT_TOLERANCE/this.renderCoordsHelper.unitInMeters),
this._constraints&&this._constraints.scale(b/this.renderCoordsHelper.unitInMeters))}else this.renderSpatialReference=this.renderCoordsHelper=this.mapCoordsHelper=null},_cameraAlmostEquals:function(a,b){return 1E-5>Math.abs(a.tilt-b.tilt)&&1E-5>Math.abs(a.heading-b.heading)&&1E-5>Math.abs(a.fov-b.fov)&&a.position.equals(b.position)},_evaluateUpdating:function(){var a=0,b=0,c=!1;this.allLayerViews.forEach(function(d){d.updating&&(c=!0,d=d.updatingPercentage,null!=d&&(++b,a+=d))});this._graphicsView&&
this._graphicsView.updating&&(c=!0);c!==this.updating&&(this.updating=c);a=0!==b?a/b:c?100:0;this.updatingPercentage!==a&&(this.updatingPercentage=a)},_updateUpdatingMonitors:function(a){for(var b=0;b<a.removed.length;b++){var c=a.removed[b],d=this._layerViewsUpdatingHandles[c.uid];d&&(delete this._layerViewsUpdatingHandles[c.uid],c.destroyed||d.remove())}for(b=0;b<a.added.length;b++)c=a.added[b],c.destroyed||(d=c.watch(["updating","updatingPercentage"],this._evaluateUpdating),this._layerViewsUpdatingHandles[c.uid]=
d);this._evaluateUpdating()},_pickRay:function(a,b,c,d,e,f,g){return this._stage?this._stage.pickRay(a,b,c,d,e,f,g):null},_pickRayWithBeginPoint:function(a,b,c,d,e){return this._stage?this._stage.pickRayWithBeginPoint(a,b,c,d,e):null},_removeHandles:function(a){for(var b=0;b<a.length;b++){var c=a[b];this[c]&&(this[c].remove(),this[c]=null)}},_setCanvas:function(a){a!==this._get("canvas")&&this._set("canvas",a)},_disposeSurface:function(){this._removeHandles(["_stageFrameTask","_updateDrawingOrderHandle",
"onViewExtentUpdateHandle","_mapLayersChangeHandle"]);this.pointsOfInterest&&(this.pointsOfInterest.destroy(),this.pointsOfInterest=null);this._disposeBasemapTerrain();this._setNavigation(null);this.environmentManager&&this.environmentManager.disposeRendering()},_disposeBasemapTerrain:function(){var a=this._get("basemapTerrain");a&&(a.destroy(),this._set("basemapTerrain",null))},_disposeNavigation:function(){var a=this._get("navigation");a&&(a.destroy(),this._set("navigation",null))},_setNavigation:function(a){this._get("navigation")!==
a&&(this._disposeNavigation(),this._set("navigation",a))},_initStage:function(){var a={};a.deactivatedWebGLExtensions=this.deactivatedWebGLExtensions;a.viewingMode=this.viewingMode;this.renderCanvas&&(a.canvas=this.renderCanvas);this._stage=new d(this.viewingMode,k.byId(this.surface),a);this._stage.selectionState=!1;this._stageHandles.add(J.init(this.qualitySettings,"antialiasingEnabled",function(){this._stage.setRenderParams({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})}.bind(this)));
this._stageHandles.add(J.watch(this,this.highlightOptions.keys().map(function(a){return"highlightOptions."+a}),function(){this._stage.setRenderParams({defaultHighlightOptions:u.toEngineOptions(this.highlightOptions)})}.bind(this)));this._stageHandles.add(J.init(this,"highlightOptions",function(){this._stage.setRenderParams({defaultHighlightOptions:u.toEngineOptions(this.highlightOptions)})}.bind(this)));this.renderCoordsHelper&&this._stage.setIntersectTolerance(g.DEFAULT_TOLERANCE/this.renderCoordsHelper.unitInMeters);
this._setCanvas(this._stage.getCanvas());this._stageFrameTask=z.addFrameTask(this._stage.getFrameTask())},_initSurface:function(){this._initStage();this._initGlobe(this.viewingMode);this.sharedSymbolResources=new fa({stage:this._stage,viewingMode:this.viewingMode,resourceController:this.resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})},_initGraphicsView:function(){this._surfaceReadyWatchHandle=J.whenTrueOnce(this,"basemapTerrain.ready",function(){this._graphicsView=
new ia({view:this,graphics:this.graphics});this._surfaceReadyWatchHandle=null;this._layerViewsUpdatingHandles[this._graphicsView.mockLayerId]=J.init(this._graphicsView,"updating",this._evaluateUpdating)}.bind(this))},_disposeGraphicsView:function(){this._surfaceReadyWatchHandle&&(this._surfaceReadyWatchHandle.remove(),this._surfaceReadyWatchHandle=null);if(this._graphicsView){var a=this._graphicsView.mockLayerId;this._layerViewsUpdatingHandles[a].remove();delete this._layerViewsUpdatingHandles[a];
this._graphicsView.destroy();this._graphicsView=null}},_normalizePointArgs:function(a,b,c,d,e){e=e||E;var f=e.point;f.spatialReference=void 0;"object"===typeof a?(f.x=a.x,f.y=a.y,f.z=a.z,a.spatialReference&&(f.spatialReference=a.spatialReference),e.retval=b):(f.x=a,f.y=b,"number"!==typeof c&&void 0!==c?(f.z=void 0,e.retval=c):(f.z=c,e.retval=d));f.spatialReference||(f.spatialReference=this.spatialReference||l.WGS84);return e},_initState:function(){this._set("state",new R({viewingMode:this.viewingMode,
spatialReference:this.spatialReference}))},_initStateManager:function(){this.stateManager.init()},_viewReadyHandler:function(a,b){b||("global"===this.viewingMode&&(this._clippingArea=null),this._internallyReady=!0,this._initSurface(),this._initGraphicsView(),!this._externallySet.environment&&(a=this.get("map.initialViewProperties.environment"))&&(this.environment=a),this._updateDrawingOrderHandle=this.allLayerViews.on("change",this._updateDrawingOrder.bind(this)),this._updateDrawingOrder({added:this.allLayerViews.toArray(),
removed:[],moved:[]}),this.environmentManager.updateReadyChange(!0))},_viewUnreadyHandler:function(a,b){b&&(this.activeTool&&(this.activeTool.deactivate(this.inputManager._inputManager),this._set("activeTool",null)),this._initialDefaultSpatialReference=null,this.environmentManager.updateReadyChange(!1),this._disposeGraphicsView(),this._internallyReady=!1,this.stateManager.deinit(),this._disposeSurface(),this.state.destroy(),this._set("state",null),this.sharedSymbolResources&&(this.sharedSymbolResources.destroy(),
this.sharedSymbolResources=null),this._stage&&(this._stage.dispose(),this._stage=null,this._stageHandles.remove()),this._setCanvas(null))},_heightModelInfoGetter:function(){var a=this.getDefaultHeightModelInfo();return null!=a?q.deriveUnitFromSR(a,this.spatialReference):null},_isIncompatibleSpatialReference:function(a){return a&&!a.equals(this.spatialReference)&&!B.canProject(a,this.spatialReference)},_updateDrawingOrder:function(){var a=this.allLayerViews.length-1;this.allLayerViews.forEach(function(b,
c){null!=b.drawingOrder&&(b.drawingOrder=a-c)},this)},_mapSetter:function(a){a!==this._get("map")&&(this._mapLayersChangeHandle&&(this._mapLayersChangeHandle.remove(),this._mapLayersChangeHandle=null),a&&(this._mapLayersChangeHandle=a.allLayers.on("change",this.notifyChange.bind(this,"dataExtent"))),this.inherited(arguments))}})});